I know there's more than one way of doing this, but I'm asking for advice on how you think it should be done.
OK so I have my own laptop, and I have my own user account in Linux. My username is "toe" and my group is "grp_toe". I log into my Xfce desktop with my "toe" username. I have "automatic mounting" turned off in Xfce, meaning I have to manually mount my own devices.
My "/mnt" folder belongs to "root:root". Here are its permissions:
Code:
drwxr-xr-x 10 root 4096 2009-02-07 13:26 mnt
Within my "/mnt" folder, I have a folder called "sdb1", which is where I mount my USB stick drive. Most of the time, the USB sticks I mount will have the FAT32 filesystem (which doesn't have Linux permissions). Here's the permissions:
Code:
drwxrwxrwx 2 root root 4096 2008-12-01 23:02 sdb1
My fstab file only contains two entries: one for "proc", and the other for my Linux partition. As follows:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda3 / ext3 relatime,errors=remount-ro 0 1
Presently, I mount my FAT32 USB stick drive with:
Code:
sudo mount /dev/sdb1 /mnt/sdb1
(If I try it without "sudo", then I get "mount: only root can do that").
After I do this, I can read from my USB stick but I can't write to it. (I don't know why, because the "sdb1" folder has full write permissions for all users). Anyway when I navigate into the sdb1 folder, I see that all the contents belong to "root:root".
Of course, if I do:
Code:
su
(Then enter my password)
, then I'm logged in as root and I can write to the USB stick.
I'd like people's advice on how I should go about doing this properly.
Here's my questions:
1) What should the permissions of the "/mnt" folder be?
2) What should the permissions of the "/mnt/sdb1" folder be?
3) What should I put in my fstab file (note that I don't want to specify a filesystem in my fstab file because sometimes the USB stick will be FAT32, and other times it might be ext3).
4) How should I mount my USB stick (should I use "sudo"?)
Thanks for listening.