Basic fstab question -- cant' set groups or use as user.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Basic fstab question -- cant' set groups or use as user.
I'm surprised that I didn't see any questions like this on a quick search of the site, but maybe I just didn't use the right terms?
Anyway, I just installed a 60GB HD into my web server. (FC2 with updates.) I want to be able to move my website onto this drive, preserving ownerships and groups for all files. This should allow me to edit the website as myself without having to be root. (Correct?)
The current entry in the /etc/fstab is: /dev/hde1 /60GB_drive vfat auto,nouser,noatime,rw 1 2
When I then do a cp -rp /var/www /60GB_drive/., I get errors like this: cp: failed to preserve ownership for `/60GB_drive/www/./html/index.html.bak': Operation not permitted
When I do a simple cp -r /var/www /60GB_drive/., the files transfer over fine. But, then I still can't chgrp on the files: [root@server 60GB_drive]# chgrp webmaster /60GB_drive/www/
chgrp: changing group of `/60GB_drive/www/': Operation not permitted
If you check the permissions on the directories you are trying to write to, you will probably find that root privilege is required, which you don't have as user.
ok so this is what an ls -l would pring up for a certain directory.
not that exciting granted but this should help you out in what you need. if you know all this already then fair enough but itys surprising how many people get by not know about basic file permissions
the first bit in the drwx--S--- says that this is a directory. the next 3 are read , write and execute for the owner of the file ie pat. the next three are the same except they are for the group ie ugrad. the execute bit in the group permissions in this example is set to the S which is the 'sticky bit', not entirely sure i understand it well enough to explain so just ignore that. and the final 3 bits are for everyone else who is neither the owner or in the files group.
it should be quite obvious what is wrong once you can see the permissions and understand them.
You should both read "man chmod" for explanations.
pats, the "S" in your example actually means "s" but not "x" (setGID, but not executable/searchable).
The sticky bit, if I'm not mistaken, is represented by a "t" (not an "s") and appears as the last character
(in the place of the "x" for "everyone else").
Simply said, for files, the sticky bit means that the file remains in memory after execution. This can be handy if you don't want to call a large executable many times without having to reload it into memory each time. However, nowadays, in most systems, the hard disk caching takes over this task.
In any case, pats, your "ls -l" suggestion was a good idea to start with.
What you are trying to do is not possible because a FAT32 filesystem does not have permissions like a linux filesystem. Neither chgrp nor chmod will work. If you want your regular user to own the files then add the option uid=<youruseruid> to the fstab file. See man mount for additional details. Is there any reason why this filesystem needs to be FAT32?
bigrigdriver, pats, and timmeke, I was trying to do these routines as su to enable regular users to use the drive. I think Michaelk is on to the crux of my problem. I think that I formatted the drive as fat32 to make the drive visible whether I am in Windows98 mode or FC2 mode. It sounds like I should reformat it as ext3, as the odds of me actually wanting to reboot the server into Windows mode is very remote. ;0)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.