# Alias "ntfs" to "ntfs-3g"

## wswartzendruber

Is there a way to alias the ntfs FS type to ntfs-3g?  My NTFS external isn't being recognized and won't automount.

----------

## pappy_mcfae

 *wswartzendruber wrote:*   

> Is there a way to alias the ntfs FS type to ntfs-3g?  My NTFS external isn't being recognized and won't automount.

 

Alias? I'm not quite sure what you mean. If you want ntfs-3g to work, you need the following:

1) NTFS support via the kernel

2) fuse support via kernel module

3) emerge -av ntfs3g 

5) a proper /etc/fstab, and

6) a command to mount it as r/w in /etc/conf.d/local.start.

Below are my /etc/fstab and /etc/conf.d/local.start for your perusal:

/etc/fstab

```
none      /proc      proc     defaults 0 0

none      /dev/shm   tmpfs    defaults 0 0

/dev/sda1 /mnt/fat16 vfat     defaults 0 0

/dev/sda3 /          reiserfs defaults 0 1

/dev/sda4 none       swap     sw       0 0

/dev/sda5 /mnt/winXP ntfs-3g  ro       1 0

# Written by Pappy McFae

```

/etc/conf.d/local.start (snippet) 

```
ebegin "Starting NTFS write support"

umount /dev/sda5

mount -t ntfs-3g /dev/sda5 /mnt/winXP

eend
```

I have this setup working on two machines, and I will get it working on this one as soon as I buy the hard drive onto which I am going to install XP. Until then, it remains unpolluted by the evil one from Washington.

Blessed be!

Pappy

----------

## irgu

 *pappy_mcfae wrote:*   

> Alias? I'm not quite sure what you mean. If you want ntfs-3g to work, you need the following:
> 
> 1) NTFS support via the kernel
> 
> 2) fuse support via kernel module
> ...

 

The 1) isn't needed and the 6) neither if you change 5) like this:

/dev/sda5 /mnt/winXP ntfs-3g  defaults       0 0

Any more optimization?  :Smile: 

----------

## crazycat

Just an example of a fstab line:

```

/dev/disk/by-label/windows /mnt/win32 ntfs-3g noatime,nodiratime,force,rw,locale=UTF-8,streams_interface=windows 0 4

```

Also utf-8 will make it possible to create case sensitive directories which are not visible on windows without some hacking.

----------

## wswartzendruber

I'm talking about support for hotplugging.  Do I have to have an entry in fstab for each one?

----------

## pappy_mcfae

 *irgu wrote:*   

> /dev/sda5 /mnt/winXP ntfs-3g  defaults       0 0

 

Thanks for that! It works, but it does take a bit away from the dramatic flair of writing my own little snippet of code that looked cool at startup. I guess I'll just have to live with not seeing that bit anymore.  :Smile: 

Blessed be!

Pappy

----------

## cyrillic

 *wswartzendruber wrote:*   

> I'm talking about support for hotplugging.  Do I have to have an entry in fstab for each one?

 

Hotplugging with hal and udev works without any /etc/fstab entries.

----------

## wswartzendruber

 *cyrillic wrote:*   

>  *wswartzendruber wrote:*   I'm talking about support for hotplugging.  Do I have to have an entry in fstab for each one? 
> 
> Hotplugging with hal and udev works without any /etc/fstab entries.

 

RIGHT...BUT...it tries to mount it as "ntfs" instead of "ntfs-3g"  I'm looking for a way to alias "ntfs" as really being "ntfs-3g"

----------

## cyrillic

 *wswartzendruber wrote:*   

> RIGHT...BUT...it tries to mount it as "ntfs" instead of "ntfs-3g" 

 

Removing NTFS support from your kernel will fix this.

----------

## irgu

You may need to do the below as well

```

ln -s /bin/ntfs-3g /sbin/mount.ntfs

```

----------

## Strupniveral

I've a similar issue with my NTFS device.

Into my /etc/fstab I have the following entry:

```

/dev/sdb1       /mnt/usb/usb1   auto            noauto,users,uid=fileuser,gid=filegrp,umask=0007        0 0

```

(since I want to automount my USB devices on my system, I can't specify the FS type)

If I do not specify any mount.ntfs symlink, I can plug my device and it's automatically mounted into the right location (/mnt/usb/usb1); the system log shows the following lines:

```

Jul 16 18:47:42 skynet kernel: usb 1-2: USB disconnect, address 4

Jul 16 18:47:51 skynet kernel: usb 1-2: new high speed USB device using ehci_hcd and address 5

Jul 16 18:47:52 skynet kernel: usb 1-2: configuration #1 chosen from 1 choice

Jul 16 18:47:52 skynet kernel: scsi5 : SCSI emulation for USB Mass Storage devices

Jul 16 18:47:57 skynet kernel: scsi 5:0:0:0: Direct-Access     WDC WD50 00AAJS-00TKA0    12.0 PQ: 0 ANSI: 0

Jul 16 18:47:57 skynet kernel: sd 5:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)

Jul 16 18:47:57 skynet kernel: sd 5:0:0:0: [sdb] Write Protect is off

Jul 16 18:47:57 skynet kernel: sd 5:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)

Jul 16 18:47:57 skynet kernel: sd 5:0:0:0: [sdb] Write Protect is off

Jul 16 18:47:57 skynet kernel:  sdb: sdb1

Jul 16 18:47:57 skynet kernel: sd 5:0:0:0: [sdb] Attached SCSI disk

Jul 16 18:47:57 skynet kernel: sd 5:0:0:0: Attached scsi generic sg1 type 0

Jul 16 18:48:02 skynet kernel: NTFS volume version 3.1.

```

However, I can't write on such device, so I suppose that the default NTFS driver is used, right?

Then, I created the first of following 2 symlinks:

```

skynet ~ # ls -l /sbin/ | grep mount.ntfs

lrwxrwxrwx 1 root root      12 Jul 16 18:58 mount.ntfs -> /bin/ntfs-3g

lrwxrwxrwx 1 root root      12 Jul  9 19:07 mount.ntfs-3g -> /bin/ntfs-3g

skynet ~ # ls -l /sbin/ | grep mount.ntfs

```

If I plug the device its not automounted and into system logs I have the following entries:

```

Jul 16 18:59:11 skynet kernel: usb 1-2: new high speed USB device using ehci_hcd and address 6

Jul 16 18:59:11 skynet kernel: usb 1-2: configuration #1 chosen from 1 choice

Jul 16 18:59:11 skynet kernel: scsi6 : SCSI emulation for USB Mass Storage devices

Jul 16 18:59:16 skynet kernel: scsi 6:0:0:0: Direct-Access     WDC WD50 00AAJS-00TKA0    12.0 PQ: 0 ANSI: 0

Jul 16 18:59:16 skynet kernel: sd 6:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)

Jul 16 18:59:16 skynet kernel: sd 6:0:0:0: [sdb] Write Protect is off

Jul 16 18:59:16 skynet kernel: sd 6:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)

Jul 16 18:59:16 skynet kernel: sd 6:0:0:0: [sdb] Write Protect is off

Jul 16 18:59:16 skynet kernel:  sdb: sdb1

Jul 16 18:59:16 skynet kernel: sd 6:0:0:0: [sdb] Attached SCSI disk

Jul 16 18:59:16 skynet kernel: sd 6:0:0:0: Attached scsi generic sg1 type 0

```

The only difference is that the last line is missing.

However, if I run 'mount /mnt/usb/usb1' into a terminal, the device is mounted correctly and I can read/write it.

At last, I don't think is a permission issue on ntfs-3g:

```

skynet ~ # ls -l /bin/ntfs-3g                

-rwxr-xr-x 1 root root 38724 Jul  9 19:07 /bin/ntfs-3g

skynet ~ # 

```

Can anybody help me?

TYA!

Luca

----------

## wswartzendruber

Basically I want to tell the thing, "Hey!  If you see 'ntfs', pretend it's 'ntfs-3g' instead!"

----------

## pappy_mcfae

I don't think such a thing is possible. Ntfs and ntfs-3g are two distinct keywords with different meanings. And since they come up in the /etc/fstab file before the file systems are fully mounted, it stands to reason that such a thing is impossible.

Considering that all one needs to do is add -3g to ntfs, if it was doable, it would add an unnecessary level of complexity, and a possible point for failure. The fancier you make the plumbing, the easier it is to stop up the drain.

Blessed be!

Pappy

----------

## Strupniveral

Honestly, I don't get your point...

Let's exclude the automount thing for a while; now, I have the following line in fstab:

```

/dev/sdb1       /mnt/usb/usb1   auto            noauto,users,uid=fileuser,gid=filegrp,umask=0007        0 0

```

so I do not specify any fs type, right?

CASE 1: without '/etc/mount.ntfs -> /sbin/ntfs-3g' symlink

If I run 'mount /mnt/usb/usb1' the device is correctly mounted (I can cd into the mount point and browse my files) but I can't write into it; so I can suppose it's using the ntfs support included into kernel, right?

CASE 2: with '/etc/mount.ntfs -> /sbin/ntfs-3g' symlink

If I run 'mount /mnt/usb/usb1' the device is correctly mounted AND I can write into it. Hence it's using ntfs-3g.

Correct me if I'm wrong, but it seems the "auto" FS selection is working correctly.

Now, let's introduce HAL + ivman.

If we are in case 1, the device is automounted into the mount point defined into fstab but I can't write into it; so it seems that my fstab is red (otherwise how could it guess the mount point?) and the device is mounted using the kenel's ntfs support.

If we are in case 2, instead, the device is not automounted.

The only difference between the two scenarios is the symlink.

Then, when I plug the device, the fs type is detected correctly (I've no issues with fat usb sticks), it finds the mount.ntfs link (if it's broken or missing, the disk is mounted with kernel's ntfs), but it can't mount it.

Now, my question is: why the "mount" command uses correctly ntfs-3g while it's not automounted?

The permissions on /sbin, /bin  and /bin/ntfs-3g are 755, while on /sbin/mount.ntfs are 777

Thanks,

Luca

----------

## skellr

/etc/filesystems ?

Edit nvm...  :Wink: 

----------

## Strupniveral

It was empty (except the last *).

I added ntfs-3g in the middle but nothing changes...

----------

## skellr

Brainfart I think. I was thinking it could try ntfs-3g first before trying ntfs but there I suppose there is only one "ntfs filesystem".

----------

## pappy_mcfae

 *Strupniveral wrote:*   

> Honestly, I don't get your point...
> 
> Let's exclude the automount thing for a while; now, I have the following line in fstab:
> 
> ```
> ...

 

Wrong. Until you emerge ntfs3g, if you want to read your ntfs volumes, you need kernel support. If you emerge ntfs3g, then you can completely bypass that. You still need to set up fuse as a module in your kernel .config since it is a dependency of ntfs-3g, but you don't have to worry about putting nfts support into the kernel proper.

 *Quote:*   

> CASE 1: without '/etc/mount.ntfs -> /sbin/ntfs-3g' symlink
> 
> If I run 'mount /mnt/usb/usb1' the device is correctly mounted (I can cd into the mount point and browse my files) but I can't write into it; so I can suppose it's using the ntfs support included into kernel, right?

 

Yes. That would be a very safe assumption.

 *Quote:*   

> CASE 2: with '/etc/mount.ntfs -> /sbin/ntfs-3g' symlink
> 
> If I run 'mount /mnt/usb/usb1' the device is correctly mounted AND I can write into it. Hence it's using ntfs-3g.
> 
> Correct me if I'm wrong, but it seems the "auto" FS selection is working correctly.

 

As far as reading is concerned, yes.

 *Quote:*   

> Now, let's introduce HAL + ivman.
> 
> If we are in case 1, the device is automounted into the mount point defined into fstab but I can't write into it; so it seems that my fstab is red (otherwise how could it guess the mount point?) and the device is mounted using the kenel's ntfs support.
> 
> If we are in case 2, instead, the device is not automounted.
> ...

 

I don't know the answer to that question. 

As far as I know, the best thing to do in your situation would be to set something up in the /etc/fstab file, and to have the drive in question plugged in at boot time. I'm sure there's a better way, but someone else will have to share that information with you. 

Blessed be!

Pappy

EDIT: This is the line from my /etc/fstab that I use for my ntfs partition. 

```
/dev/sda5 /mnt/winXP ntfs-3g defaults 1 0
```

----------

## cyrillic

 *Strupniveral wrote:*   

> Now, my question is: why the "mount" command uses correctly ntfs-3g while it's not automounted? 

 

My question is: Why would you want second generation NTFS support (provided by the kernel) and third generation NTFS support (provided by ntfs-3g) installed together on the same computer ?

Doing this causes confusion, and provides no actual benefit.

----------

## astor84

 *cyrillic wrote:*   

>  *Strupniveral wrote:*   Now, my question is: why the "mount" command uses correctly ntfs-3g while it's not automounted?  
> 
> My question is: Why would you want second generation NTFS support (provided by the kernel) and third generation NTFS support (provided by ntfs-3g) installed together on the same computer ?
> 
> Doing this causes confusion, and provides no actual benefit.

 

Agreed.

I removed NTFS support from my kernel over a year ago (in favor of using fuse+ntfs-3g) and have never looked back. There is seriously no point in using the in-kernel NTFS support or even having it compiled in these days.

----------

