LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   mounting sdaX/sdbX with RW permissions (http://www.linuxquestions.org/questions/linux-hardware-18/mounting-sdax-sdbx-with-rw-permissions-573012/)

linuxpokernut 07-28-2007 02:41 PM

mounting sdaX/sdbX with RW permissions
 
Im using fedora 7 and using fluxbox for my desktop most of the time, and KDE the rest of the time. Im dual booting with windows 98. I did a search for my hard drives and sda1 is the windows partition, sdb1 is my usb drive, and sda5 is my linux hdd. i created directories for mount points within my home directory and have also tried using the default /media/.

so i tried to mount the windows partition like this:
#mkdir /mount/hdd
#mount -t vfat /dev/sda1 /media/hdd

it comes up with read write and execute wfor root and read and execute for user and other.

i tried to change the permissions with
#chmod 777 /media/hdd

i received no error message but it didnt set the default permissions.

i then loaded konqueror from root and tried to right click on the mounted hdd. when i opened up the properties dialog and selected permissions, i was able to change them. when i clicked ok it went thru the normal process, spawned no error message, and then when i opened the properties again nothing was changed, no write permission for users or group.

i googled chmod and it said it was set to rw by default but i could use the -o rw option so i tried

#mount -o rw /dev/sda1 /media/hdd

(this was after using umount). Still only rwx in root, no write in user or group.

when i tried chown it gave me a permission denied error.

when i am in KDE, almost everything automounts which is cool, but i want to be able to use fluxbox because my box has only 384M ram. I also notice when i am in KDE that the usb automounts with rw for user and group.

What am i doing wrong?

btw i realize i did not copy and paste from my konsole as i am not at my PC atm. i will be able to copy and paste in any future replies. thanks a lot.

rtspitz 07-28-2007 03:39 PM

As you know fat32 does not know about file permissions, so there is also no way for linux to store them there.
File permissions must be set at mount time.

e.g.: mount -t vfat /dev/sda1 /mnt/win98 -o rw,uid=0,gid=104,umask=002

uid = user id
gid = group id

file perms = 777 - umask

so rwx rwx r-x is 775 --> umask needs to be 002

linuxpokernut 07-28-2007 04:49 PM

thank you very much, it worked with only a little alteration.
[root@localhost jp]# mount -t vfat /dev/sda1 /media/hdd -o rw,uid=0,gid=104,umask=002
[root@localhost jp]# ls -l /media
total 22
dr-xr-xr-x 2 root root 2048 2007-07-27 22:43 cd
drwxr-xr-x 2 root root 4096 2007-07-14 19:12 dvd
drwxrwxr-x 10 root 104 4096 1969-12-31 19:00 hdd
drwxr-xr-x 2 root root 4096 2007-07-27 14:18 usb1


then i changed umask to 000 and viola:

[root@localhost jp]# mount -t vfat /dev/sda1 /media/hdd -o rw,uid=0,gid=104,umask=000
[root@localhost jp]# ls -l /media
total 22
dr-xr-xr-x 2 root root 2048 2007-07-27 22:43 cd
drwxr-xr-x 2 root root 4096 2007-07-14 19:12 dvd
drwxrwxrwx 10 root 104 4096 1969-12-31 19:00 hdd
drwxr-xr-x 2 root root 4096 2007-07-27 14:18 usb1


thanks a lot.


All times are GMT -5. The time now is 03:01 PM.