LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-10-2007, 09:36 AM   #1
jjge
Member
 
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108

Rep: Reputation: 16
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.
 
Old 04-10-2007, 10:07 AM   #2
hacker supreme
Member
 
Registered: Oct 2006
Location: As far away from my username as possible
Distribution: Gentoo
Posts: 259
Blog Entries: 1

Rep: Reputation: 31
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.
 
Old 04-10-2007, 02:33 PM   #3
jjge
Member
 
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108

Original Poster
Rep: Reputation: 16
Thanks, but, yes-- I also tried quite a few variations on mount. Including your suggestion. Unfortunately, nothing changes :-(
 
Old 04-10-2007, 02:41 PM   #4
jjge
Member
 
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108

Original Poster
Rep: Reputation: 16
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?
 
Old 04-26-2007, 02:22 AM   #5
powen
LQ Newbie
 
Registered: Oct 2006
Posts: 12

Rep: Reputation: 0
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.
 
Old 04-26-2007, 02:38 PM   #6
jjge
Member
 
Registered: Jun 2003
Location: Kalkar, Germany
Distribution: Slackware
Posts: 108

Original Poster
Rep: Reputation: 16
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...
 
Old 04-26-2007, 05:59 PM   #7
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 -current
Posts: 2,300

Rep: Reputation: 90
It's a dirty hack but you can put entries in fstab for sda1, sdb1, etc. with all needed permissions.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant change permissions of files on a mounted fat16 attockonian Slackware 6 08-01-2006 12:52 PM
Can't change permissions on mounted partition OlRoy Linux - General 2 09-24-2004 02:22 AM
How to change permissions of a mounted partition seran Linux - General 2 08-13-2004 01:43 AM
How to change permissions for Mounted Filesystem leroy27336 Linux - General 3 11-15-2003 03:08 AM
cant change permissions on a mounted windows partition groovin Linux - Newbie 10 11-02-2002 07:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration