How is an USB drive mounted, and how can I change the permissions
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How is an USB drive mounted, and how can I change the permissions
I am running Ubuntu 5.10, with a 2.6.12 kernel. When I connect a USB disk with a VFAT file system, it turns up as /media/My\ Book, with owner root.root and permissions rwx------ .
So far, so good, but I cannot chown or chmod this. These commands, run as root, simply do nothing. I have also tried to remount in various ways, to no avail. Typically the commands just return silently and nothing has changed.
I want to share this device with others, via Samba, so I should like to set something like rwxrwxrwx (we will discuss security later ;-) so where do I start?
I have also looked in /etc/udev.rules, but found nothing directly relevant.
Try looking through the man files for mount.
Try remounting it with mount -wo exec nosuid
(I think...)
Which will give it read/write acess with executable binaries allowed and ignoring user IDs.
Uh yes, and I also found that remounting with various options does change at least something: when I give 'mount' the /dev/sda1 shows up with all "new" options appended. Currently it is something like user=root,....,uid=1001,... . The drive still works, and is still accessible, as long as you are root. And /media/My\ Book still has root.root drwx------ .
BTW, does anyone know exactly where a USB disk is mounted? I have been looking in the /etc/udev rules, but I do not see anything related to my problem. Should I try /etc/hotplug, or something else? Or is it in the kernel?
hi,
if not specified at run time ( boot up ) via /etc/fstab then plug and pray should take care of it:
>
cat /etc/mtab
should see something similar to:
>
cat /etc/mtab
/dev/hdb2 / ext3 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
/dev/hdb1 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0
>
usbdevfs is the one
>
normally i do not create an /etc/fstab as i like to hot swap between machines.
So i just do following
fdisk -l
validate the drive is being seen then
mount /dev/sda1 /<mount point> eg usb1
>
hope that makes sense, cheers.
I could place a line specifying /dev/sda1 in /etc/fstab, of course, and I guess that would also set the permissions right. But unfortunately, sometimes it is /dev/sdb1 after it has been plugged in ... even though I have no other (SCSI or USB) devices on this machine.
That is why I am still looking for udev rules of some kind...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.