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.
Linux (I'm using MEPIS 7) wouldn't let me rename a folder on one of my HDs. I looked at the permissions and saw that the owner was root. (I think an error changed it, because I copied something to this drive recently, and didn't have a permissions problem.) So I logged into the root account and, both in the GUI and then in a console, tried to chown not just the folder but the entire drive to my account. (I'm the only user.) When I tried this in the GUI, the drive just ignored my changes (I know that because after clicking OK, I checked the permissions again, and root was the owner again.) So I opened a console and went through this:
root@mepis1:~# chown users '/mnt/sdb1'
chown: `users': invalid user
root@mepis1:~# chown josh '/mnt/sdb1'
chown: changing ownership of `/mnt/sdb1': Operation not permitted
root@mepis1:~#
Not permitted? Why not?
In case it was because one can't chown an entire drive at once, I then tried to chown the three folders one at a time (although that's not good enough, because I don't want any future folders I make to be owned by root). That produced the same result. So why can't I change the permissions or ownership from the root account?
Now I have more information. I went back to my account, and unmounted and then mounted it. Now the owner is me. Why would that happen?
(Something possibly related to this is that after I bring it out of hibernation (I use Suspend to Disk often), the drives are unreadable and unwriteable. I can solve the problem by unmounting and mounting them.
You posted that while I was adding another post. But I performed that command. It says:
root@mepis1:~# ls -al '/mnt/sdb1'
total 68
drwxr-xr-x 5 josh users 16384 1969-12-31 17:00 .
drwxr-xr-x 8 root root 4096 2008-08-15 20:04 ..
drwxr-xr-x 16 josh users 16384 2008-08-15 20:34 data
drwxr-xr-x 2 josh users 16384 2000-02-10 17:49 My Documents
drwxr-xr-x 6 josh users 16384 2008-08-14 20:40 Program Files
root@mepis1:~#
However, that is after I unmounted and then mounted the drive, because I didn't wait for a response to my first post before posting more information (sorry!) I can't ls -al the folder when it claims the owner is root. (I should get a chance to, because this will probably happen again. This type of screwup has been happening a lot for me in MEPIS 7. I'm annoyed enough by it to change distros.)
Last edited by newbiesforever; 08-19-2008 at 12:20 AM.
My guess would be that the disk in question is formatted as Windows FAT32 or NTFS.
If that's the case (and seeing "My Documents" and "Program Files" there leads me to believe it is) then all you need to do is to change system' default behaviour.
FAT32 partitions are mounted by default under ownership root:root with 770 permission. Change /etc/fstab entry for the disk in question by adding (or changing) 'umask=0' then remount.
If anything still doesn't work just post here and I'm sure we'll work it out.
Last edited by klearview; 08-19-2008 at 04:41 AM.
Reason: Clarification
Thank you, Klearview. It's formatted to FAT32, yes, because I was sharing it between Windows and Linux until my Windows installation permanently stopped working recently. So I'll try that.
Your original problem was that fat32 simply doesn't accept the linux permissions/ownership scheme, in other words: it's *invulnerable* to chmod/chown. That's where umask gets into scene: it sets the default permissions for a fat32 fs via the correspondent driver, and not in the linux userland (where fat32 simply doesn't understand them).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.