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.
I wanted to have write permissions for the the drives that listed as C: D: E: F: under windows. I mounted these on C D E F directories respectively under /mnt.
I created a group called "mygroup", added my account to it; and I tried to change the group it belonged to "mygroup" and set read, write and execute permissions for that group. It worked for folder C, but not for D E and F. Also what's up with the date of creation of D E and F?! I was not even born then... and there are some differences in the other dates too.. some 2006, some 2002. I installed Slackware a few days back..
Code:
root@foo:/mnt# chgrp mygroup C D E F
chgrp: changing group of `D': Operation not permitted
chgrp: changing group of `E': Operation not permitted
chgrp: changing group of `F': Operation not permitted
root@foo:/mnt# chmod 775 C D E F
root@foo:/mnt# ls -l
total 84
drwxrwxr-x 1 root mygroup 4096 2008-05-26 15:18 C
drwxr-xr-x 9 root root 16384 1970-01-01 05:30 D
drwxr-xr-x 9 root root 16384 1970-01-01 05:30 E
drwxr-xr-x 4 root root 8192 1970-01-01 05:30 F
-rw-r--r-- 1 root root 376 2006-09-26 08:39 README
drwxr-xr-x 2 root root 4096 2006-09-26 06:32 cdrecorder
drwxr-xr-x 2 root root 4096 2002-03-16 13:04 cdrom
drwxr-xr-x 2 root root 4096 2006-09-26 06:32 dvd
drwxr-xr-x 2 root root 4096 2008-05-24 14:22 flash
drwxr-xr-x 2 root root 4096 2002-03-16 13:04 floppy
drwxr-xr-x 2 root root 4096 2002-03-16 13:04 hd
drwxr-xr-x 2 root root 4096 2006-09-26 06:32 memory
drwxr-xr-x 2 root root 4096 2006-09-26 06:33 tmp
drwxr-xr-x 2 root root 4096 2006-09-26 06:32 zip
root@foo:/mnt#
Drive C is certainly a hard disk, so changing permissions and ownership makes sense and is possible.
Drive D is most likely a CD/DVD drive - an empty CD/DVD drive doesn't have ownership, and with each inserted media contents and ownership will be different.
I assume that E and F are also some external removable devices. You can not change ownership of device, only of it's current contents, if any.
Since you access them under windows I'm assuming there are fat32 or ntfs file systems on those partitions. Non-linux file systems don't support the same permissions as linux file systems. Have a look at man mount and search for vfat and ntfs. You can use options like umask, uid and gid to specifiy permissions and ownership.
seraphim172 - They're ntfs and vfat drives.
eggixyz - I'm still getting the same errors.
gilead, Your method works. I set gid to be that of my group and the umask to be 002. Could you tell me why my date of creation is in 1970? If I'm not mistaken isn't that the beginning of the epoch which Slackware uses?
Are D E and F mounted with the filesystem type specified in the mount command? I've seen this before if you choose default and/or don't specify vfat or ntfs. I've also seen this happen on mounted filesystems when a Linux distro doesn't fully support ntfs.
When I first installed Slackware, I specified the mount types for D, E and F as auto. But I didn't like the boot messages as it mentioned something along the lines of filesystem not mentioned, trying vfat.. Later on I replaced auto with vfat. Is this a bug?
I wondering that myself. Check this link from another thread. It basically says that since vfat doesn't have a c_time stamp, so the date on the filesystem get's set to 1/1/1970, which, depending on what time zone you're in can sometimes also be 12/31/69, which (in most cases) means that Linux can't figure out the time (that makes sense though if vfat doesn't carry a c_time (inode creation time) for the OS to read.
It's related to the time zone alright. I live in India which is 5 and a half hours ahead of GMT and that's the file creation time. I know that c_time is a structure in C but that's it. Sorry if I sound noobish.. but can't Linux read timestamps other than c_time? The contents inside the fat partitions have correct timestamps.. why does the problem exist only with the mounted directory? With reference to your previous post, does putting auto instead of 'vfat' make a difference?
i think the problem is more simpler than that, it is related to the account u use to access the system.
in other words, you logged to the system like a normal user and then you do su without - option on that way you will use the current user profile rather than full root user profile.
I'm positive you get complete root privileges when you use su. I logged in as root too. I faced the same problem, but now that's fixed. Now I'm just interested in the date of creation issue I'm facing.
gets you in as root, BUT you retain the original user's env.
su -
gets you in as root WITH root's env settings.
HTH
Incidentally,
"Three fields in the inode structure contain the last access, change, and modification times: atime, ctime, and mtime. The atime field is updated each time the pointer to the file's data blocks is followed and the file's data is read. The mtime field is updated each time the file's data changes. The ctime field is updated each time the file's inode changes. The ctime is not creation time; there is no way under standard Unix to find a file's creation time."
My mistake - ctime does refer to the inode "change" time and not inode "creation" time. The point I was trying to make originally was that vfat doesn't have that, which is what can cause the incorrect timestamp on mounted vfat resources.
Apologies for any confusion I created. The other discussion I linked to addresses why the vfat problem exists.
Also, I think there's a bit of confusion between privilege and environment. Su'ing to root, with or without sourcing the profile, does give the user root privilege, but they keep the original user's environment settings, for the most part.
Is the issue still just that the timestamps are not correct? As far as I know and have been able to research, it may be impossible to mount a vfat partition and fake the date easily, but, as long as the mount works I would say "problem solved"
I could be missing something. I've obviously missed a few back-and-forths here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.