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've just plug a 2nd storage, and mount it at /backup. And for user 'root' everything works fine.
But even though I've put a 777 permission, still my other users (but root) can't see it.
So I add this line at my /etc/fstab
Code:
/dev/sdb1 /backup ext3 defaults 1 2
but still my other users are NOT able to see my /backup.
I have two questions:
1. Do I have to reboot my machine in order to let /etc/fstab to work?
2. Is there any way to make my other user to see my /backup
fstab is intended to be a list of drives and mount points. It can be used at init to mount a default set of disks, but some tools like mount also look into fstab sometimes to get some hints on what to do when the user doesn't provide a complete mount line directly.
You don't need to reboot for your OS to be aware of the changes to fstab, but some lines in fstab might only make sense for the init phase.
*When* did you chmod /backup? You need to chmod it *after* it's mounted. You really shouldn't need any more setup. If it still doesn't work, then make sure /backup is mounted and then show us the output from "ls -ld /backup".
/etc/fstab is used by the system to decided how to mount the partition. For a vfat or ntfs partition, it could determine the permissions and ownership of the mounted partition. For a native Linux filesystem, such as ext3, the permissions and ownership of the filesystem are determined by the filesystem itself. As i92guboj said, the filesystem needs to be mounted before running the chmod and chown commands. After mounting, you will see the ownership and permissions of the directory change to that of the filesystem itself. So either you must have either edited /etc/fstab and didn't mount it. Or you ran chmod and chown before mounting the filesystem.
If you added a new group, and added uses to the group, you may need to reboot for the group information to make it into the kernel. This could effect whether users can enter or write your /backup directory.
You also didn't say that you created a filesystem on /dev/sdb1. Maybe you just left this info out.
But when I logged in as reguler user (e.g. yoachan), this is what I get
Code:
# ls -ld /backup
/bin/ls: /backup: No such file or directory
I've chmod before and after mounting.
But I've just realize something,
If as a root I create another directory at / -- let's just call it "/mybackup",
my other users can't see that directory even though i've set it's permission to 755 and even 777.
Even if I change directory's owner to that specific user, still the directory is not seen.
So I think it's not about mounting problem, but somehow other users can't see any directory created by root at /
FWIW, in my root directory, I found this directory "checkvirtfs" which I assume related to virtfs.
Does this thing happens to be related with virtfs? And if it's virtfs that causing it, is there any solution upon this directory sharing?
Usually yes. Try edit your fstab entry for that particular volume as follows:
/dev/sdb1 /backup ext3 auto,users,rw 1 1
"users" doesn't probably relate to this topic. It just means that *any* user can mount AND umount the volume, which might be what he wants or not. "users" is not related to whom might access the volume or not, only permissions control that. In ntfs and fat volumes it is indicated as a mount option with the umask parameter only because those fs's do not have a proper support for POSIX attributes, so all the permissions are emulated at mount time.
"auto" and "rw" are implicit in "defaults".
Quote:
If dbus complains or blocks viewing the volume try to edit your user privileges by adding it membership to the group 'messagebus'.
Hope this helps. Good luck.
This shouldn't have anything to do with fstab and mount though.
Thank you for the replies.
But I've just realize something,
If as a root I create another directory at / -- let's just call it "/mybackup",
my other users can't see that directory even though i've set it's permission to 755 and even 777.
Even if I change directory's owner to that specific user, still the directory is not seen.
So I think it's not about mounting problem, but somehow other users can't see any directory created by root at /
FWIW, in my root directory, I found this directory "checkvirtfs" which I assume related to virtfs.
Does this thing happens to be related with virtfs? And if it's virtfs that causing it, is there any solution upon this directory sharing?
Just like i92guboj said, I don't think that it's related to mount or fstab though....
Should I create separate thread and close this one...?
I know not about "virtfs". For the look of it, it shouldn't have anything to do with your problem, but I can't be sure.
"chroot" is a tool that changes the root of a given fs dynamically. You can, for example, have partition with another Linux OS mounted at /mnt/gentoo and change the root from your actual / to /mnt/gentoo by doing something like:
Code:
cd /mnt/gentoo
mount -obind /proc /mnt/gentoo/proc
mount -obind /sys /mnt/gentoo/sys
mount -obind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
Now /mnt/gentoo becomes /, and you will be using the OS in /mnt/gentoo instead of the previous one (except for the kernel which will remain the same, of course).
Some servers do this when login remote users. This is done for security reasons. That way, each user has his/her own /, and s/he can't see the real / of the server.
But I don't know why rn_ asked about chroots. I am not sure how they could be an issue here. Chrooted or not, you should be able to see the files at /. The only difference would be that they would be from an alternate or a real root fs.
I know not about "virtfs". For the look of it, it shouldn't have anything to do with your problem, but I can't be sure.
"chroot" is a tool that changes the root of a given fs dynamically. You can, for example, have partition with another Linux OS mounted at /mnt/gentoo and change the root from your actual / to /mnt/gentoo by doing something like:
Code:
cd /mnt/gentoo
mount -obind /proc /mnt/gentoo/proc
mount -obind /sys /mnt/gentoo/sys
mount -obind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
Now /mnt/gentoo becomes /, and you will be using the OS in /mnt/gentoo instead of the previous one (except for the kernel which will remain the same, of course).
Some servers do this when login remote users. This is done for security reasons. That way, each user has his/her own /, and s/he can't see the real / of the server.
But I don't know why rn_ asked about chroots. I am not sure how they could be an issue here. Chrooted or not, you should be able to see the files at /. The only difference would be that they would be from an alternate or a real root fs.
As separato topic, will chroot last after system is rebooted?
As separato topic, will chroot last after system is rebooted?
No, but init or login scripts could be chrooting the user at login time. This is the technique that some servers use to automatically chroot the user(s).
This can be done via many methods, but assuming the admin is smart enough s/he will surely use chroot jails at the authentication layer (usually pam). Shell rc files are not strong enough and can be circumvented in a number of creative ways.
But I don't know why rn_ asked about chroots. I am not sure how they could be an issue here.
The reason I asked is if the new fs is mounted on the real root /, but the users are being 'chroot'ed to say /mnt/gentoo as you suggested, then they won't be able to see the new fs. If chroot is being used then the new fs needs to be mounted under /mnt/gentoo for the users to see.
The reason I asked is if the new fs is mounted on the real root /, but the users are being 'chroot'ed to say /mnt/gentoo as you suggested, then they won't be able to see the new fs. If chroot is being used then the new fs needs to be mounted under /mnt/gentoo for the users to see.
How can I see whether a user is 'chroot'ed or not? If it is than how can I get my /backup for that user?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.