Automount external drives

General support questions
skolnick
Posts: 209
Joined: 2007/11/24 16:05:26

Automount external drives

Post by skolnick » 2011/07/18 18:44:17

Hi!

I have a CentOS 6.0 desktop computer, and it has connected several external USB drives. These are formatted using NTFS, because I need to share information between windows/linux/mac and many files are bigger than the 4GB limit of FAT32. This same machine used to have Ubuntu 10.04 (because of long-term support) but being a fan of RPM, I formatted it and installed CentOS on it. Now, on Ubuntu, the drives would automount on login (or maybe on startup, I never tried accessing the drives on a console session) but the point is that they were available immediately after logging in with no user intervention. This is not happening on CentOS, the drives mount fine if I go to Computer and mount them, but they are not automounted and it's tiresome having to mount 5 drives everytime I login. I am using repoforge's (rpmforge's) fuse-ntfs-3g-2010.10.2-1.el6.rf.i686 to provide the NTFS read and write support.

Any hints or suggestions about this issue are greatly appreciated.

Best regards,

Germán.

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: Automount external drives

Post by r_hartman » 2011/07/19 10:00:31

You do not mention how you mount them manually, from root or from your userid.
If you mount from your userid, you could add a mount-script to the startup programs.

If you mount from root, you could add a mount-section to /etc/gdm/PostLogin/Default
In that case you can also unmount upon logout by adding an unmount-section to /etc/gdm/PostSession/Default

These scripts will run under root, but with all the user's settings, like $HOME, $USER, etc.

Alternatively, they can probably be mounted from /etc/fstab, but then may cause boot issues when booting with a drive missing.

EDIT: USB initialization may be too late in the boot sequence to allow mounting through /etc/fstab.

skolnick
Posts: 209
Joined: 2007/11/24 16:05:26

Re: Automount external drives

Post by skolnick » 2011/07/19 17:44:01

Hi!

Thanks for replying. I mount the drives by double clicking the "Computer" icon on my desktop (I use the default GNOME that comes with CentOS 6), and then double-clicking over the icon of each drive. They all appear along with the DVD drive and other partitions. I do this as my user, not as root. Having to add a mount script sound more like a hack than a real solution. Besides, I'm sure this can be done with no scripts since the GNOME desktop on ubuntu didi it transparently. Also, if the drive is disconnected, the script would fail, which leads to havint to implement error validation, etc...

Thanks for any light on this strange issue.

Regards,

Germán Andrés.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Automount external drives

Post by pschaff » 2011/07/19 18:06:41

NTFS support is not enabled in CentOS by default. How did you enable it? EPEL? If so did you install ntfsprogs-gnomevfs ?

If you plug in the drives after booting do they automount?

skolnick
Posts: 209
Joined: 2007/11/24 16:05:26

Re: Automount external drives

Post by skolnick » 2011/07/19 18:41:13

Hi!

Thanks for the reply :)

[quote]
pschaff wrote:
NTFS support is not enabled in CentOS by default. How did you enable it? EPEL? [/quote]
As I told in the first post, I am using repoforge's (rpmforge's) fuse-ntfs-3g-2010.10.2-1.el6.rf.i686 to provide the NTFS read and write support.

[quote]
pschaff wrote:
If so did you install ntfsprogs-gnomevfs ?[/quote]
I just checked and this package is not installed. I'll try installing it, rebooting and post here the result.

Edit: I tried installing ti but yum could not find the package. The only external repo I have enabled is rpmforge (for all of my software needs), elrepo (for nvidia support), and adobe (for flash-plugin). Since I use rpmforge, I did not installed EPEL because I know they have conflicts in some packages.

[quote]
pschaff wrote:
If you plug in the drives after booting do they automount?[/quote]
Yes, they mount just fine and the corresponding icon appears in the GNOME desktop with no problem.

Regards.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Automount external drives

Post by pschaff » 2011/07/19 19:19:06

Sorry I missed the mention of RPMforge - failed to scan back far enough in the thread. I have seen reports of EPEL NTFS packages working where the ones from RPMforge did not, and you are right about mutual incompatibilities. RPMforge has gnome-vfs2-ntfs which may be worth a try:[code]
Name : gnome-vfs2-ntfs
Arch : x86_64
Version : 1.13.1
Release : 1.el6.rf
Size : 5.1 k
Repo : rpmforge
Summary : NTFS GNOME virtual filesystem module
URL : http://linux-ntfs.sourceforge.net/
License : GPL
Description: This package contains the NTFS GNOME virtual filesystem (VFS) module which
: allows GNOME VFS clients to seamlessly utilize the NTFS library.[/code]

I'm not sure that the fact that the automount works with Ubuntu necessarily means is should work the same way with EL derivatives. The hotplug event seems to be required to trigger the mount.

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: Automount external drives

Post by r_hartman » 2011/07/19 19:47:56

[quote]
skolnick wrote:
I mount the drives by double clicking the "Computer" icon on my desktop (I use the default GNOME that comes with CentOS 6), and then double-clicking over the icon of each drive. They all appear along with the DVD drive and other partitions.[/quote]

Sounds to me like they're already mounted, then. You wouldn't have the icons otherwise, unless I misread your statement.

skolnick
Posts: 209
Joined: 2007/11/24 16:05:26

Re: Automount external drives

Post by skolnick » 2011/07/20 14:17:58

Hi!

Thanks for taking time to look into this.

[quote]
r_hartman wrote:
Sounds to me like they're already mounted, then. You wouldn't have the icons otherwise, unless I misread your statement.[/quote]

I tested, and they are not mounted. I did this: I booted the computer, and opened the "Computer" icon. There were icons for each of the USB drives (generic ones, like a little hard drive with the USB logo), however none of them was mounted under /media (they usually are mounted there). Then, I double-clicked one of the icons and then the drive was mounted under /media, the icon in "Computer" changed (I have a personalized icon for every drive, so I can recognize them just by looking at their icon on the desktop) and the icon for the drive appeared on the desktop with its personalized icon.

Regards,

Germán

skolnick
Posts: 209
Joined: 2007/11/24 16:05:26

Re: Automount external drives

Post by skolnick » 2011/07/20 14:39:17

Hello

Thanks for looking into this.

[quote]
pschaff wrote:

I'm not sure that the fact that the automount works with Ubuntu necessarily means is should work the same way with EL derivatives. The hotplug event seems to be required to trigger the mount.[/quote]

Maybe I am misunderstanding you (I'm not a native English-speaking person) but, are you saying that the problem might be with the hotplug event not triggering properly? or the problem is that Ubuntu does something that CentOS can't / won't? I would find any of that strange, because hotplug seems to trigger whenever I plug the drive *after* logging in (and the drive is automounted). I also installed the gnome-vfs2-ntfs package you suggested, no idea why my yum search didn't showed it up. I'll see if this makes any difference in the behavior.

Regards,

Germán

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Automount external drives

Post by pschaff » 2011/07/20 17:44:03

What I meant was that if the device is plugged in at boot time, then Gnome volume manager will not see an event to which to respond, and so will not mount the device. I have no idea why that would be different with Ubuntu, but have seen cases on CentOS where a device is not seen in the GUI until it is un-plugged/plugged.

Post Reply