4

I am using an external USB hard drive for a long time in Ubuntu 10.04, both at work and at home. Now I've installed 12.04 at home. Today I used the USB drive for the first time. I can read the disk but can't change the permissions of a file I wanted.

Output of "mount"

/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)

I try

sudo chmod u+w bsst-hdf_to_bsst-h5

and I get

-rw-r--r-- 1 paco paco  2956 dic 19 10:27 bsst-hdf_to_bsst-h5

Any ideas would be appreciated. Thanks in advance.


Hi again and sorry for the delay in answering. 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 pluging 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.

Thanks again

1
  • HI, I tried sudo, no message. It seems it has run fine but ls -lrt just shows the same permissions than before
    – pacomet
    May 18, 2012 at 12:28

2 Answers 2

7
sudo chown -R $USER:$USER /media/FREECOM
3
  • 2
    You can use the $USER variable for both user and group ;)
    – Rinzwind
    May 18, 2012 at 11:46
  • yes ofcourse ;) May 18, 2012 at 11:47
  • Hi, group and user are the right ones
    – pacomet
    May 18, 2012 at 12:26
3

I see that your disk is vfat, which unfortunately does not support file permissions win the current revision, unless you want to reformt it in UMDOS, which has been disconntinued and requires an older kernel. However, this may help get you

Ubuntu, and Linux in general, unfortunately have spotty permissios under other filesystems, especially on external disks, even without VFAT.

You may try these two other answers(In order of preference):

How do I set executable permissions on a removable drive?

https://superuser.com/questions/134438/how-to-set-default-permissions-for-automounted-fat-drives-in-ubuntu-9-10

7
  • The first solution does not work for me. I think I have to edit /etc/fstab. Maybe I wait until monday and look at the options at work on 10.04 and check for any differences at home.
    – pacomet
    May 18, 2012 at 14:21
  • @pacomet you can try changing the 0022 code to suit your needs in the first answer--It will only act on ALL drives unless you set up some sort of filtering--same caveat with the second.
    – nanofarad
    May 18, 2012 at 15:50
  • Hi, I'm not so experienced in linux to completely understand how to fix it. Do I only need to change the option "mode=0022"? Can you point me the right options or a place to read about them? Thanks
    – pacomet
    May 19, 2012 at 7:16
  • @pacomet You may want to see this useful page with a nice code calculator. Also, sorry for bad info, but it should only be 3 digits(The link will give you just the right code in the 3 digits in the boxes)
    – nanofarad
    May 20, 2012 at 21:17
  • Sorry, I saw that your drive is already 777. You cannot change the permissions, unless you want to set them for only your system when reading that drive(The changes will not propagate to other systems). This makes the permissions system-wide and acting on the entire drive. Also, why do you want permissions in the first place? Anyone with physical access to the drive can just get pas the permissions.
    – nanofarad
    May 20, 2012 at 21:20

Not the answer you're looking for? Browse other questions tagged .