Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

fstab & users

Posted on 2005-03-21
4
Medium Priority
?
523 Views
Last Modified: 2010-04-20
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
0
Comment
Question by:ashonline
4 Comments
 
LVL 4

Accepted Solution

by:
Robson earned 1000 total points
ID: 13590354
In ext2 and ext3 filesystems user permisiions are asigned to file/directory, so just set /spare ownership to ashley (chown ashley /spare).

Regards

Robson.

0
 
LVL 1

Expert Comment

by:adityabvss
ID: 13590576
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
0
 
LVL 14

Expert Comment

by:cjl7
ID: 13599930
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
0
 

Author Comment

by:ashonline
ID: 13600544
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).
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question