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 was implementing NIS server and NIS client using the following tutorial http://www.linuxhomenetworking.com/w...S#.UQdopPJAjGM
While performing the steps I did not backup my /home dir to /home.save and continued the steps, resulting the local users are lost now.
Code:
login as: nagios
nagios@172.22.0.41's password:
Last login: Tue Jan 29 14:34:06 2013 from 172.22.0.48
Could not chdir to home directory /home/nagios: No such file or directory
-bash-3.2$
While performing the steps I did not backup my /home dir to /home.save
So where's old home directory? According to this doc, you would have to move /home to /home.save and then create a new /home and mount it.
Have you removed old /home dir? If yes, then you've only one alternative, i.e. create new home directories for all local users inside /home (i.e. new /home) and change each home directory's owner/group permissions to their corresponding owners.
So where's old home directory? According to this doc, you would have to move /home to /home.save and then create a new /home and mount it.
Have you removed old /home dir? If yes, then you've only one alternative, i.e. create new home directories for all local users inside /home (i.e. new /home) and change each home directory's owner/group permissions to their corresponding owners.
No I have not moved the /home directory, I forgot to move the /home dir, so the existing local users should be there in the /home directory, but it does not shows the local users there.
yes, so you've just mounted the nfs share over the top. unmount it and the local files will still be there.
Hmm, well I have shutdown the nfs share server and still the problem exists. I completely init 0 the system which was having the nfs share, after which I restarted the client machine and still the problem exists.
Code:
[root@redhat ~]# ls -l /home/
total 0
[root@redhat ~]#
[root@redhat ~]# su - nagios
su: warning: cannot change directory to /home/nagios: No such file or directory
-bash-3.2$
Did you unmount the NFS share? Just shutting down the NFS server can cause all kinds of unwanted and weird behavior.
Nope I did not unmount the nfs share. I just init 0 to both server and client and then started client only. I understand the risks but these are just the test machines, so risk could be taken (I actually want some error to come so troubleshooting could be done )
Ok, I did some troubleshooting and got the issue fixed.
Maybe this would be helpful to others in similar situation.
There were no files in the home directoryas you can see
Code:
[root@redhat ~]# ls -l /home/
total 0
I was neither able to create any files under /home even though I was a root
Code:
[root@redhat ~]# mkdir /home/sah
mkdir: cannot create directory `/home/sah': No such file or directory
I checked what all the partitions were mounted
Code:
[root@redhat ~]# mount -l
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw) [/boot]
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
The above output made me suspicious about nfs, but my nfs server was already halted, anyways I proceeded with stopping the below services.
Code:
[root@redhat ~]# service portmap stop
Stopping portmap: [ OK ]
[root@redhat ~]# service nfslock stop
Stopping NFS statd: [ OK ]
[root@redhat ~]# service netfs stop
Commented the entry made in the automounter
Code:
[root@redhat ~]# vi /etc/auto.master
Stopped the automounter service
Code:
[root@redhat ~]# service autofs stop
Stopping automount:
Crossed my fingers and did ls -l, after seeing the output it gave me some relief. I was able to see my directories.
Code:
[root@redhat ~]# ls -l /home/
total 20
drwx------ 4 nagios nagios 4096 Dec 26 12:21 nagios
drwx------ 3 sah sah 4096 Nov 8 17:34 sah
drwx------ 3 user1 user1 4096 Dec 4 12:18 user1
drwx------ 3 user2 user2 4096 Dec 4 12:18 user2
Thanks to everyone who gave suggestions to reach me till this point
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.