[nmglug] change permissions on USB drive

Nick Frost nickf at nickorama.com
Fri Oct 12 12:37:43 PDT 2007


brianokeefe wrote:

> I changed the permissions as per Nick but I would, of course, like them 
> to be permanent so I checked out Andres method.
> Here's what I now have pre-Andres:
> debian:/media# ls -l
> total 12
> lrwxrwxrwx 1 root root    6 2007-10-03 07:56 cdrom -> cdrom0
> drwxr-xr-x 2 root root 4096 2007-10-03 07:56 cdrom0
> drwxrwxrwx 3 root root 4096 2007-10-12 12:31 disk
> lrwxrwxrwx 1 root root    7 2007-10-03 07:57 floppy -> floppy0
> drwxr-xr-x 2 root root 4096 2007-10-03 07:57 floppy0
> 
> I can see /media/sda3, the USB drive, in a file manager but not as 
> above. when I try Andres commands with "disk" I get:

I was not very helpful, in that there are more parts to this equation (I 
think) to get the behavior you want. Gary is correct, the perms of the 
unmounted directory will be inherited (or should be) when mounted, and 
not vice versa (or so I think that's how it should behave).  But, you 
need an /etc/fstab entry.

here's what I have which allows my user nickf to mount a USB stick 
(instead of ROOT).

# allow USB flash drive mounting for anyone.
/dev/sdd1   /mnt/usb      vfat  auto,nosuid,user,exec 0 0

It's the "user" argument in /etc/fstab that is important.

But, if I mount /dev/sdd1 as ROOT, the user cannot unmount it, the 
mount/unmount has to be done by the relevant user (if that makes sense?)?

You can also emerge, apt-get, or yum sudo for your distro and then edit 
/etc/sudoers with visudo to allow mounting of a USB drive if you have 
problems, though a correct /etc/fstab entry for the relevant /dev/sd<x> 
device ought to do it.

-Nick


-- 
           _      __   ____
    ____  (_)____/ /__/ __/
   / __ \/ / ___/ //_/ /_
  / / / / / /__/ ,< / __/
/_/ /_/_/\___/_/|_/_/
Nicholas S. Frost
nickf at nickorama.com





More information about the nmglug mailing list