[SOLVED] EXT4 rw automount

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

[SOLVED] EXT4 rw automount

Postby lsas » Thu Apr 04, 2013 8:09 pm

Hi all guys.

I'm having this problem. I've several external usb hd with ext4 fs
I'm trying to automatic mount it using the udev rules

The problem is on the permission: need the rw for also for the normal users and not only for root.
Now, i've read many articles on the web, but still can not solve the problem.
First i've tried with umask, but then i understand that it doesnt work with ext fs

Then the only things that seems working around the web is to chown the mountpoint, but that means i've to run the chown command inside the rules, because everytime the usb is disconnected the directory is deleted:
$this->bbcode_second_pass_code('', '# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
')

Also the rw permission need to be active for the whole group of four users
There's any other method to do that?
Any idea
Last edited by lsas on Mon Apr 08, 2013 7:49 am, edited 1 time in total.
lsas
 
Posts: 13
Joined: Wed Dec 05, 2012 4:33 pm

Re: EXT4 rw automount

Postby hydro » Fri Apr 05, 2013 11:26 am

Mountpoint permissions are not relevant. You have to set permissions on files and directories on each disk while it is mounted using chown/chmod. These permissions are stored inside the ext file system and will remain after disk is unmounted. New files will be owned by the user, who creates them and his primary (or current) group¹, while default permissions depend on umask.

¹ or the group of the parent folder if that one has the sgid bit set
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: EXT4 rw automount

Postby lsas » Mon Apr 08, 2013 7:49 am

$this->bbcode_second_pass_quote('hydro', 'T')hese permissions are stored inside the ext file system and will remain after disk is unmounted


Great! I didint know about that.
Seems working, i've just add my user to the storage group and did:
$this->bbcode_second_pass_code('', '# chown -R root:storage /media/myexternaldisk
# chmod -R 775 /media/myexternaldisk')

Now seems working after restarting and after remounting.
Thanks a lot
lsas
 
Posts: 13
Joined: Wed Dec 05, 2012 4:33 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 17 guests