I have installed a cable that connects from the CPU's SATA motherboard connection to a removable drives' ESATA connection.

I would like to be able to swap drives on the ESATA connection and have all users be able to read and write to these drives.

I have created the directory /archive/ where I would like the drive(s) to mount.

The drives are all formatted Fat 32 - but in the future I may use HFS for formatting.

When I used the command (as root):

mount /dev/sdc1 /archive

the drive was mounted (but read only)

What can I use in my /etc/fstab file that will allow drives to be mounted and unmounted by all users on the system? (both reading and writing)

Also, will I be able to mount and unmount these drives without shutting down? or will I need to reboot every time I want to change drives?

  • If you don't want to manually edit anything, there are utilities that can be installed using either Ubuntu's built-in software centre or the package manager that will allow you to configure drives to automount and set the permissions for read/write and mount/unmount. I can't look up any disk managers for you atm 'cause I don't have an Ubuntu box handy so I won't post this as an answer.
    – Tog
    Jan 4, 2011 at 19:58
  • please, inform us of which distro you are using.
    – Jasen
    Jan 4, 2011 at 20:09
  • This is a RedHat system. "cat /etc/redhat-release Red Hat Enterprise Linux WS release 4 (Nahant Update 3)" Jan 5, 2011 at 21:11

2 Answers 2


What can I use in my /etc/fstab file that will allow drives to be mounted and unmounted by all users on the system? (both reading and writing)

If it's a personal computer, it would be best to use something like udisks (which GNOME uses for (auto-)mounting devices), as in udisks --mount /dev/sdc1.

Another alternative is pmount.

But if you require it to work with the mount utility, and if you can guarantee that the device node will never change, this should work:

/dev/sdc1  /archive  auto  users,uid=0,gid=0,fmask=0111,dmask=0,file_umask=0111,dir_umask=0,utf8  0  0

fmask/dmask are for msdos/vfat filesystems, file_umask/dir_umask are for hfs. In both cases, all files have permissions 0666 and directories 0777.

Edit: This could help. Run through sudo.

#!/usr/bin/env bash
# You can also use "uid=$SUDO_UID,gid=$SUDO_GID"
# sets TYPE to the detected type; also UUID, LABEL where supported by filesys.
. <(blkid -c /dev/null -o export "$device")
case $TYPE in
vfat) options="$options,fmask=0111,dmask=0" ;;
hfs)  options="$options,file_umask=0111,dir_umask=0" ;;
mount -t "$TYPE" -o "$options" "$device" "$mountpoint"
  • 1
    This is extraordinarily helpful thank you! I used the line you gave, and I am getting an odd error message. when I then 'mount -a' I'm told that "mount: you must specify the filesystem type" I don't know if this matters - but this is a Red Hat system, and not running GNOME. Jan 5, 2011 at 20:47
  • 1
    @evilblender: Try replacing auto in the third field with vfat or hfs, depending on what you are using. (I suggest using something more reliable than that, however. Both ext4 and ntfs-3g have journalling and even support chown+chmod.)
    – user1686
    Jan 5, 2011 at 20:52
  • Unfortunately the archive drives have previously been formatted both vfat as well as hfs. Does this kind of screw me? Thanks again. Jeff Jan 5, 2011 at 21:06
  • 1
    @evilblender: Take a look at udisks and pmount, then? (sudo can be useful too, possibly with a script that detects the filesystem with blkid before giving it to mount - without a fstab entry.)
    – user1686
    Jan 6, 2011 at 17:17
  • 1
    @grawity thank you very much, I will look at them ASAP Jan 6, 2011 at 23:00

https://help.ubuntu.com/community/AutomaticallyMountPartitions please try google first next time. and just so you know, no user can log in as root. the su command is necessary for any and all super user operations.

  • 2
    1. An answer that just links elsewhere is not a real answer. 2. The "no user can log in as root" statement is a) not related to the question, b) only true for standard Ubuntu Linux setups and not to any other distribution. 3. Regarding "the su command is necessary" - if you cannot login as root, you cannot su to root either. (You can sudo -s on Ubuntu, however.)
    – user1686
    Jan 4, 2011 at 19:53
  • Actually, the inability to log in from the welcome screen as root can be bypassed and you most certainly can su to root when logged in as a user after once using a fairly simple command. Other than that, I have to say point one is valid, "be nice". Let's not hijack the OP's question
    – Tog
    Jan 4, 2011 at 20:11
  • @Tog alright. i shall remove my comments.
    – Jasen
    Jan 4, 2011 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.