OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: zi99y on February 22, 2007, 12:50:45 pm

Title: Mounting Sd With Non-root Access?
Post by: zi99y on February 22, 2007, 12:50:45 pm
I just bought 2x 2Gb sandisk SD cards - pretty pleased at £10 a pop (including postage).

Problem I'm having is that no matter how the filesystem gets mounted, the /mnt/card directory only grants execute permissions to root (drwxr--r--).

The mount point has full permissions when unmounted (chmod 777 /mnt/card)

Also I have a line in /etc/fstab for the mount at /dev/mmcda1 which I have added various options such as rw,user,noauto - I don't think this has any effect at all

I have a 4Gb CF card that is also FAT32 but this mounts with full (777) permissions.

Any ideas on this would be much appreciated - I'm using beta3 btw
Title: Mounting Sd With Non-root Access?
Post by: InSearchOf on February 22, 2007, 01:34:12 pm
SD control mounts that device before fstab gets a chance to...

I took my Z out of my bag last night and forgot to replace it before I left for work this morning, so I can't reference to that. It is in the /etc dir... but I remember of the top of my head where...

do a
Code: [Select]
# find /etc/ -name sdcontrol and you will find it
Late
Title: Mounting Sd With Non-root Access?
Post by: zi99y on February 22, 2007, 02:07:25 pm
Thanks for that, I edited /etc/sdcontrol and uncommented the following line:
Code: [Select]
FATOPTS="-o noatime,quiet,umask=000,iocharset=utf8"an now it gets mounted with full permissions

Not sure what all of those options are but I'll leave it like that unless someone recommends not to.

thanks again.
Title: Mounting Sd With Non-root Access?
Post by: speculatrix on February 22, 2007, 03:22:51 pm
Quote
Thanks for that, I edited /etc/sdcontrol and uncommented the following line:
Code: [Select]
FATOPTS="-o noatime,quiet,umask=000,iocharset=utf8"an now it gets mounted with full permissions

Not sure what all of those options are but I'll leave it like that unless someone recommends not to.

thanks again.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155003\"][{POST_SNAPBACK}][/a][/div]

er, you really REALLY want the "noatime", otherwise every "ls" and every file access updates the last accessed time on that dir or file, this will slow things down and wear your card out faster

quiet says to not complain about "chmod" or "chown" failures, this is particularly useful for fat/fat32 drives which don't understand particular protection flags, nor ownership

umask=000 says to not touch protections of the file system

and utf8 allows extended characters in file names
Title: Mounting Sd With Non-root Access?
Post by: zi99y on February 22, 2007, 05:16:00 pm
Thanks for that info - interesting about the noatime flag, so it looks that leaving all these options set is the best setup, wonder why the line was commented out by default?
Title: Mounting Sd With Non-root Access?
Post by: speculatrix on February 23, 2007, 06:38:13 am
I don't know why it would be commented out.

you can also fix the ownership of files using "uid=xxx,gid=xxx", so you could make all files owned by zaurus (get the uid/userid from /etc/passwd and the gid from /etc/group).

this is particularly useful when, say, mounting a windows share on a linux box. here's one of my fstab entries
Code: [Select]
//192.168.1.2/download /mnt/mypc/download      smbfs   noauto,users,username=paul,uid=1000,gid=users  0       0
the username option tells smb to login with that username, otherwise it would try to use root.