Operating System - HP-UX
1833043 Members
2417 Online
110049 Solutions
New Discussion

Re: A filesystem for /root?

 
Hooi Siew Hoong_1
Frequent Advisor

A filesystem for /root?


I have created a directory /root for the root users. What would be the implications if I create a filesystem for this directory ?

11 REPLIES 11
Wodisch
Honored Contributor

Re: A filesystem for /root?

Hello,

beware!

Lots of problems ahead - including a system that cannot boot any longer!

Remember that "root" needs his/her home-directory and shell for trouble-shooting in single-user mode...

Just my $0.02,
Wodisch
Michael Tully
Honored Contributor

Re: A filesystem for /root?

Hi,

The only user who should have access to
/root is root itself. If you created
another file system under this there is
a possibility that root cannot login.

Any other user such as system administrators
that have access to the root account
should have there own home directory anyway
usually e.g. /home/michael or /users/michael

HTH
-Michael

Anyone for a Mutiny ?
Wilfred Chau_1
Respected Contributor

Re: A filesystem for /root?

Don't see any problem as long as it is not in vg00. Otherwise someone may accidentally fill it up and crash the server.
Steven Sim Kok Leong
Honored Contributor

Re: A filesystem for /root?

Hi,

I agree with Wodisch.

In single-user mode, only some system filesystems are mounted. If you create a separate filesystem for the root user, it will not be mounted in single-user mode. If you change the login shell for root from /sbin/sh to /usr/bin/ksh or /usr/bin/sh for that matter, you will not be able to a login shell in single-user mode properly because /usr is not mounted in single-user mode.

This is the reason why root's login shell is /sbin/sh and home directory is /.

Hope this helps. Regards.

Steven Sim Kok Leong
Shahul
Esteemed Contributor

Re: A filesystem for /root?

hi

I will not suggest this. Root users home directory should be / only. Otherwise U may end up in problem. U can seen, some times LVM may not comes up because of some reason. That time / will be mounted as /dev/root. If U create another file system for root users, In crucial situations U may not be able to that particular FS. Better to leave as it is.


Best of luck
Shahul
Michael Tully
Honored Contributor

Re: A filesystem for /root?

Hi,

The home directory for root *must* be
part of the '/' filesystem. You can have
it in any directory you like, but it
*must* be under the '/' mount-point.

-Michael
Anyone for a Mutiny ?
Ruediger Noack
Valued Contributor

Re: A filesystem for /root?

Hi all

I don't see really a problem with separate /root filesystem. And I don't see a problem during boot in single user mode. Without mounted /root filesystem there is an empty /root directory or even with this files you need in this time.
I don't use a separate /root filesystem but in my imagine it may be helpful.

Only my idea
Ruediger
Tim D Fulford
Honored Contributor

Re: A filesystem for /root?

You need to have /root on / as you will not be able to boot. it needs the .profile for root

However.....
If you make a /root directory within /, with your basic .profile & then have a /root mounted ontop (masking the .profile) I think this should work.

But why? if your "root" users are inadvertently filling up / then they need their ar*e kicking. If core files are being dumped there, create a directory called core & change the perms to 000, then the core's will no longer be dumped! I can't think of any other reasons why you need a seperate f/s for root home?

Tim
-
Craig Rants
Honored Contributor

Re: A filesystem for /root?

I agree that the /root userdir should remain part of /. Too many possibilities for things to go wrong otherwise. It is needed in single user mode, boot time etc...

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Patrick Wallek
Honored Contributor

Re: A filesystem for /root?

I just did a test on my 11i B132L workstation.

I created a new LV and mounted it as /root. I modified /etc/passwd so that root's home dir is now /root.

I copied all . files from / to /root and only left .profile .shrc and my .env (personal stuff) in /.

I rebooted the machine and let it come up in multi-user mode. No problems that I could see. CDE came up. Networking was up. Everything appears to be good.

I then rebooted again, but interupted the boot process and came up in single user mode. It came up fine here too. Everything you would expect is still there.

When coming up this way, /root is there, but since it is not mounted there are none of the . files that you would expect. This doesn't appear to cause a problem for me at this point.

Now I am not saying that you won't have any problems. I am just saying that I haven't observed any so far.

MY OPINION is that it works and you shouldn't have any problems. There are no guarantees or warranties on this though. Use at your own risk!
Eric Ladner
Trusted Contributor

Re: A filesystem for /root?

Personally, I think it's a really good idea to have root's home directory not at / but at a lower level (i.e. /root). (See http://people.hp.se/stevesk/bastion11.html item number 11 for somebody else that agrees with me)

Having /root on a different file system from / shouldn't cause any problems that I can think of.

Consider this:

1. /root (the directory) must exist on the / file system for it to even be mounted, so /root will always exist, wether in single user mode or not.

2. Having a profile is just a convienence feature for us shell bound folks that like to type (but not too much) rather than point/click. If you don't have a profile, you will still get a shell, but with no PATH, TERM, etc. set up. You will have to bang all that stuff in yourself at the keyboard.

Somebody mentioned above (can't see the name at the moment, sorry) of copying a skeleton .profile into /root before the file system is mounted over it so a .profile will exist as a convenience when /root isn't mounted. That's a pretty good idea.