LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-21-2005, 10:40 PM   #1
jcubed
LQ Newbie
 
Registered: Apr 2004
Location: Minneapolis, MN
Posts: 18

Rep: Reputation: 0
Unhappy 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


What am I doing wrong?
 
Old 12-21-2005, 11:47 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
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.

Su to root, then try the commands again.
 
Old 12-22-2005, 05:27 AM   #3
pats
Member
 
Registered: Jul 2005
Distribution: Debian Sarge/Etch, (K)Ubuntu, FC6, AIX5.3, VMWare ESXServer
Posts: 159

Rep: Reputation: 30
drwx--S--- 3 pat ugrad 512 Dec 8 17:18 workspace


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.
 
Old 12-22-2005, 06:46 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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.
 
Old 12-22-2005, 07:36 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
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?

Last edited by michaelk; 12-22-2005 at 07:38 AM.
 
Old 12-22-2005, 06:43 PM   #6
jcubed
LQ Newbie
 
Registered: Apr 2004
Location: Minneapolis, MN
Posts: 18

Original Poster
Rep: Reputation: 0
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)

Thanks!
 
Old 12-22-2005, 06:47 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Adding the option umask=000 in the fstab file will allow all users to read/write to a FAT32 partition.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic question about groups celejar Linux - General 2 07-07-2005 10:25 AM
user groups technochef Linux - General 2 10-31-2004 05:00 PM
Basic user:group question BroX Slackware 9 01-30-2004 07:15 AM
su root command returns 'cannot set groups...' golgotha Linux - Newbie 2 04-08-2003 10:47 PM
Can You Set Up Custom Logins Using Groups? ybbob Linux - Newbie 3 05-28-2002 04:32 AM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration