Link to home
Start Free TrialLog in
Avatar of ashonline
ashonline

asked on

fstab & users

Hi

I'm just getting back into Linux after a stint with Win2003 & I've forgotten a few things... :-(

I have the following line within my fstab file:

LABEL=/spare /spare ext3 defaults 1 2

I need to allow my user account (ashley) to have full read/write access to this partition.

Can someone please help?!

Thanks

Ashley
ASKER CERTIFIED SOLUTION
Avatar of Robson
Robson
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adityabvss
adityabvss

Assuming root is the owner & Group owner of the partition /spare,
You have two options

1.You can change the ownership of the /spare partition to "ashley" by running the command
a.Switch to root
b.chown ashley /spare
c.chmod u+rwx /spare, if they are not set

2.For somereason you want to retain the ownership to root, adding the user "ashley" to the root group will be a bad idea. So you can create a new group "spareshare" and add the user ashley to the group. Then change the group ownership of the /spare partition to "spareshare". You can do that by the following commands.

a.Switch to root
b./usr/sbin/groupadd spareshare
c.vi /etc/group
find the line which has the groupname spareshare, it will be the lastline, then add "ashley" at the end of the line. After the modification, the line looks like this,
spareshare:x:13037:ashley
d.chown :spareshare /spare
e.chmod g+rwx /spare, if they are not set

Regards,
Aditya
Hi,

Assuming that the file permissions on the dir is correct you can add "uid=1001" (or whatever ashley has...) in your fstab to allow ashley to mount/unmount the disk.

To test from command line do mount -o rw,uid=ashley LABEL=/spare /spare

This might not be exactly what you asked, but hey... :-)

//jonas
Avatar of ashonline

ASKER

Thanks for the tips guys.

All I ended up doing was a "chown ashley /spare" and it has been all good since.

I haven't had to alter fstab at all (not sure if that's good or bad).