# [SOLVED] NTFS mounts on 2.6.38 but not on 2.6.39

## GoatFounDeR

Hi,

I've updated my kernel from 2.6.38-r6 to 2.6.39-r3 (normal gentoo-sources) but it seems I have a problem mounting my ntfs usb drive. Here is some information from my old and new kernels that might help solve this.

kernel 2.6.38-r6

================

$ dmesg | grep sdb

[    4.311991] sd 4:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)

[    4.312735] sd 4:0:0:0: [sdb] Write Protect is off

[    4.312786] sd 4:0:0:0: [sdb] Mode Sense: 00 00 00 00

[    4.312789] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.314239] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.321275]  sdb: sdb1 sdb2

[    4.322853] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.322903] sd 4:0:0:0: [sdb] Attached SCSI disk

rootfs on / type rootfs (rw)

/dev/root on / type xfs (rw,noatime,attr2,noquota)

proc on /proc type proc (rw,relatime)

rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)

debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)

udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)

devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)

shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)

usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)

binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

fusectl on /sys/fs/fuse/connections type fusectl (rw)

/dev/sdb2 on /media/2TB Drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

As you can see sdb mounts correctly and is working.

kernel 2.6.39-r3

================

rootfs on / type rootfs (rw)

/dev/root on / type xfs (rw,noatime,attr2,delaylog,noquota)

proc on /proc type proc (rw,relatime)

rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)

udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)

devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)

shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)

binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

fusectl on /sys/fs/fuse/connections type fusectl (rw)

/dev/sdc1 on /media/PENDRIVE type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

[    4.278939] sd 4:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)

[    4.279686] sd 4:0:0:0: [sdb] Write Protect is off

[    4.279735] sd 4:0:0:0: [sdb] Mode Sense: 00 00 00 00

[    4.279738] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.281185] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.281686]  sdb: sdb1

[    4.281735] sdb: p1 size 4294967295 extends beyond EOD, enabling native capacity

[    4.283185] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.283685]  sdb: sdb1

[    4.283734] sdb: p1 size 4294967295 extends beyond EOD, truncated

[    4.285560] sd 4:0:0:0: [sdb] Assuming drive cache: write through

[    4.286112] sd 4:0:0:0: [sdb] Attached SCSI disk

Is there a kernel option that I might have missed? 

If there is any information that might be of use, just ask  :Smile: 

Thanks in advance for the help.Last edited by GoatFounDeR on Sat Jul 30, 2011 8:13 pm; edited 1 time in total

----------

## DONAHUE

```
grep -i ntfs /usr/src/linux/.config
```

if you don't see  *Quote:*   

> CONFIG_NTFS_FS=y

 ntfs support is no longer in your kernel

----------

## GoatFounDeR

Thanks for the quick reply. but it seems I do have ntfs support compiled in to my kernel.

 *Quote:*   

> CONFIG_NTFS_FS=y
> 
> # CONFIG_NTFS_DEBUG is not set
> 
> CONFIG_NTFS_RW=y

 

When I try to mount the drive I get this message.

 *Quote:*   

> 
> 
> mount: wrong fs type, bad option, bad superblock on /dev/sdb,
> 
>        missing codepage or helper program, or other error
> ...

 

And here is dmesg:

 *Quote:*   

> [  201.765439] NTFS-fs error (device sdb): read_ntfs_boot_sector(): Primary boot sector is invalid.
> 
> [  201.765442] NTFS-fs error (device sdb): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
> 
> [  201.765446] NTFS-fs error (device sdb): ntfs_fill_super(): Not an NTFS volume.
> ...

 

other settings in my kernel that might help:

 *Quote:*   

> CONFIG_FAT_DEFAULT_CODEPAGE=437
> 
> CONFIG_NLS_CODEPAGE_437=y
> 
> CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
> ...

 

----------

## Gusar

Remove ntfs support from the kernel, it has very limited (practically useless) write support. You weren't using it before anyway, you were using ntfs-3g, which is a fuse driver: *Quote:*   

> /dev/sdb2 on /media/2TB Drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

 

The problem is here: *Quote:*   

> [ 4.281735] sdb: p1 size 4294967295 extends beyond EOD, enabling native capacity

 

It seems the kernel doesn't support disks larger than 4GB?? That's just weird.

Anyway, as your disk is 2TB, you need support for that in the kernel, check that you have it: "Support for large (2TB+) block devices and files" (CONFIG_LBDAF)

And make sure there's fuse support too: "FUSE (Filesystem in Userspace) support" (CONFIG_FUSE_FS)

----------

## NeddySeagoon

GoatFounDeR,

Do not use kernel NTFS is you need NTFS write support. Read works, write is limited to changing the content of existing files, provided the file size does not change.

For ntfs support, you need File System in User Space (FUSE) support in the kernel and the ntfs-3g package from portage. 

Its safe to have both.

If you want to mount with the kernel ntfs driver, use -t ntfs

To mount with ntfs-3g, its -t ntfs3g

----------

## NeddySeagoon

Gusar,

Well caught!

I suspect thats because /dev/sdb is a part of a fake raid0 set.  This gets you a partition table on one drive that describes the entire raid0 space.

If the raid set is two drives, the last sector in the partition table will be for two drives worth of data and is indeed past the end of the drive.

Its actually nothing to worry about as you can't mount such a single drive anyway. You bring up the raid set and access the /dev/mapper/...  and all is well with the world.

----------

## GoatFounDeR

Thanks for the help NeddySeagoon and Gusar. I've removed ntfs support from the kernel and emerge ntfs3g. Also fuse is now enabled. There seems to be a small problem. I cant find the CONFIG_LBDAF option. I've read online it depends on CONFIG_64BIT and I have that set to true. This is what I see in my menuconfig

```
--- Enable the block layer

             [*]   Block layer SG support v4

             [ ]   Block layer data integrity support

                   IO Schedulers  --->
```

Also doing a grep for CONFIG_LBDAF returns nothing. Might lbdaf depend on something I have not selected?

PS: sorry for the late reply, had to go out with my sister before she returns home tomorrow.

----------

## Gusar

Actually, it depends on !64BIT. I think a 64bit kernel has LBDAF by default. So from this perspective you should be set.

PS. Man, I think I'll soon be considered stone-age, still living in a 32bit world  :Smile: 

----------

## GoatFounDeR

I've decided to use my old kernel and relax and see what I can find tomorrow. So far it seems I might have turned of some obscure setting or something and broke support for my drive. I will post here if I find something useful. 

hehe, full 64bit is still to scary for me, but multi-lib seems nice and stable so far  :Smile: 

----------

## DONAHUE

perhaps run "chkdsk <windows name for the partition perhaps, C:> /f " from installed windows (will probably require a windows reboot) or from the install cd to normalize the partition ?

----------

## GoatFounDeR

I've finally came around to play with the kernel again. And found what I did wrong. I accidentally turned of my partition support for windows drives. Which caused the kernel to read the partition table incorrectly and gave the error:

 *Quote:*   

> [ 4.281735] sdb: p1 size 4294967295 extends beyond EOD, enabling native capacity 

 

So for other people that might have this problem in the future turn on these kernel features and it might help you too.

```
File systems  --->

    Partition Types  --->

        I think msdos one is not really needed

        [*]   PC BIOS (MSDOS partition tables) support

        [*]   Windows Logical Disk Manager (Dynamic Disk) support
```

Thanks to Gusar, NeddySeagoon and DONAHUE for taking time to help and point this noob in the right direction.

----------

