Problem Mounting External USB Drive in Ubuntu 12.04

12.04external-hddmount

This question started as Changing file permissions on USB external hard drive but as I can find a solution I ask again.

The problem comes when I move a USB drive I have been using in Ubuntu 10.04 to a lapto with 12.04. I want to change permissions of some scripts as they appear only with rw but I can't.

Now I have tried to copy the device line from fstab from 10.04 to the laptop with 12.04 but still get an error message.

Error mounting: mount exited with exit code 1: helper failed with:
mount: only root can mount /dev/sdb1 on /media/FREECOM HDD

The line I add to fstab to try to mount the usb drive is

/dev/sdb1 /media/FREECOM\040HDD vfat rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush 0 0

When restoring original fstab and plugging the usb drive the output of mount is

/dev/sdb1 on /media/FREECOM HDD type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)

What should I add in fstab to get the drive fully working? I wanted to change permissions on files in the usb drive.

Output of sudo fdisk -l

Device     Start      End      Blocks  Id  System
/dev/sdd1              63  1953520064   976760001    c  W95 FAT32 (LBA)

Thanks again

Best Answer

I've successfully used /etc/fstab to auto mount a usb device located at sdb1 using the following:

/dev/sdb1 /media/Test ntfs-3g defaults,user,exec,uid=1000,gid=100,umask=000 0 0

With this configuration, I've mounted the device having all privileges over its files.

  • Replace /dev/sdb1 with your device

  • Replace /media/Test with your target directory

  • Replace ntfs-3g with your USB drive file system

Related reading: Fstab - Community Ubuntu Documentation


My goal was more or less the same as yours, to have an USB drive with an executable file that performs some updates, either on my home PC or my work PC.

Related Question