Ubuntu This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-10-2007, 09:36 AM
|
#1
|
Member
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108
Rep:
|
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.
|
|
|
04-10-2007, 10:07 AM
|
#2
|
Member
Registered: Oct 2006
Location: As far away from my username as possible
Distribution: Gentoo
Posts: 259
Rep:
|
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.
If this doesn't help, feel free to ignore it.
|
|
|
04-10-2007, 02:33 PM
|
#3
|
Member
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108
Original Poster
Rep:
|
Thanks, but, yes-- I also tried quite a few variations on mount. Including your suggestion. Unfortunately, nothing changes :-(
|
|
|
04-10-2007, 02:41 PM
|
#4
|
Member
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108
Original Poster
Rep:
|
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?
|
|
|
04-26-2007, 02:22 AM
|
#5
|
LQ Newbie
Registered: Oct 2006
Posts: 12
Rep:
|
where is usb drive mounted
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.
|
|
|
04-26-2007, 02:38 PM
|
#6
|
Member
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108
Original Poster
Rep:
|
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...
|
|
|
04-26-2007, 05:59 PM
|
#7
|
Senior Member
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 -current
Posts: 2,300
Rep:
|
It's a dirty hack but you can put entries in fstab for sda1, sdb1, etc. with all needed permissions.
|
|
|
All times are GMT -5. The time now is 12:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|