LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 07-28-2010, 01:11 AM   #1
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Rep: Reputation: 16
Mount 2nd HardDisk


Dear all,

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

Any help appreciated.

Thanks.

Last edited by yoachan; 07-28-2010 at 01:13 AM.
 
Old 07-28-2010, 02:22 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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".
 
Old 07-28-2010, 02:40 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
/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.
 
Old 07-28-2010, 03:52 AM   #4
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Thank you for the replies.

Like I said before, I've mount /dev/sdb1 to /backup
Code:
# mount /dev/sdb1 /backup
and as root, I can see it properly, and I can also see contents inside /backup too.
Code:
# ls -ld /backup
  drwxr-xr-x 25 root root 4096 Jul 27 14:53 /backup/
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?

thanks in advanced,

Yoachan

Last edited by yoachan; 07-28-2010 at 04:01 AM.
 
Old 07-28-2010, 04:04 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Please, post the output for "ls -ld /". Remember that to go inside a given directory a user needs both +r AND +x on that directory.
 
Old 07-28-2010, 07:35 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
1. Do I have to reboot my machine in order to let /etc/fstab to work?
No. You only need to issue this command in the terminal:

mount -a

(and it will reload the entries found in the fstab, it will show comments if something is wrong.)

Quote:
2. Is there any way to make my other user to see my /backup
Usually yes. Try edit your fstab entry for that particular volume as follows:

/dev/sdb1 /backup ext3 auto,users,rw 1 1

Try if it works. Take note that there is no space in the options entries.

Another possible way:

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.
 
Old 07-28-2010, 07:59 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by malekmustaq View Post
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.
 
Old 07-28-2010, 10:01 AM   #8
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Thanks for all your replies....

Quote:
Originally Posted by yoachan View Post
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...?
 
Old 07-28-2010, 10:26 AM   #9
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
could it be that your users are "chroot"ed?
 
Old 07-28-2010, 10:38 AM   #10
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by rn_ View Post
could it be that your users are "chroot"ed?
what is "chroot"ed?
 
Old 07-29-2010, 01:50 AM   #11
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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.
 
Old 07-29-2010, 02:22 AM   #12
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by i92guboj View Post
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?
 
Old 07-29-2010, 02:37 AM   #13
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by yoachan View Post
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.
 
Old 07-29-2010, 07:46 AM   #14
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
Quote:
Originally Posted by i92guboj View Post
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.
 
Old 07-29-2010, 09:52 AM   #15
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by rn_ View Post
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?
 
  


Reply



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
any ideas how to mount a harddisk/stick using mount via BUS METHOD? frenchn00b Linux - General 2 12-10-2009 01:22 PM
My 2nd harddisk doesn't work!! laffen47 General 1 05-27-2006 04:53 PM
fstab mounting 2nd harddisk dannyk1 Linux - General 3 11-24-2005 01:15 AM
install fedora core 2 on 2nd harddisk arthurf Linux - Software 1 07-18-2004 10:37 AM
Installing linux on 2nd Harddisk cyberzen Linux - General 11 06-15-2003 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:25 AM.

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
Open Source Consulting | Domain Registration