Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automounted USB drive is owned by root and not writable
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Fri Mar 09, 2012 12:09 pm    Post subject: Automounted USB drive is owned by root and not writable Reply with quote

Hi,

I've created an ext3 parition on a USB flash drive using:

Code:
mkfs.ext3 /dev/sdc1


I then plug the drive in and it gets mounted to /media automatically but for some reason has the following privileges so I can't write to it as a normal user:

Code:
drwxr-xr-x 3 root root 4096 Mar  9 10:18 CZILLA_IMAGES


Does anyone know how to get it to mount so that I can write to it as a normal user?

Thanks.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23071

PostPosted: Fri Mar 09, 2012 11:46 pm    Post subject: Reply with quote

chown my-user /media/CZILLA_IMAGES?
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat Mar 10, 2012 6:32 am    Post subject: Reply with quote

if youre talking in general about getting usb drives to mount so that theyre writeable by an ordinary user, id look to fstab or udev (depending on if you want it automounting or not)

'man mount' and a bit of trawling through udev rule examples should get you started
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Sat Mar 10, 2012 8:42 am    Post subject: Reply with quote

Hu wrote:
chown my-user /media/CZILLA_IMAGES?


You read my mind. Since EXT is *nix filesystem the permissions should be retained in any case (automounted or not)
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sat Mar 10, 2012 3:38 pm    Post subject: Reply with quote

Unless I'm reading the initial post wrong, it's a different problem:
'/media/<whatever>' (where <whatever> is usually the label) is created upon automount.

However, the OP should mention their desktop env or at least the program used for automount.
If it's again consolekit case, 'ls -l /dev/sdc1' and 'getfacl /dev/sdc1' is of interest, probably the output of 'udisks --mount /dev/sdc1' (while still unmounted, obviously) too.

On a semi-related note: is ext3 a good idea for a flash drive ?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23071

PostPosted: Sat Mar 10, 2012 6:39 pm    Post subject: Reply with quote

Even if the directory is only present when the drive is attached, the ownership and permission of the mountpoint are determined by the ownership and permission of the root directory in the mounted filesystem. Thus, it is correct for the directory to be root:root when nothing is mounted, but there is no value in having write permission there if the stick is not mounted. If the stick is mounted, then it will use the data from the mounted filesystem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum