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 01-29-2013, 03:22 AM   #1
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Rep: Reputation: 0
Exclamation /home users disappeared


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$
 
Old 01-29-2013, 03:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right.... so you've renamed the directory... what's the problem here? Obviously if you move /home to somewhere else, /home won't exist anymore
 
Old 01-29-2013, 03:50 AM   #3
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
right.... so you've renamed the directory... what's the problem here? Obviously if you move /home to somewhere else, /home won't exist anymore
While performing the steps I did not backup my /home dir to /home.save
 
Old 01-29-2013, 04:52 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by abhinav4 View Post
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.
 
Old 01-29-2013, 05:04 AM   #5
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by shivaa View Post
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.

Last edited by abhinav4; 01-29-2013 at 05:07 AM.
 
Old 01-29-2013, 05:07 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
oh right, sorry

yes, so you've just mounted the nfs share over the top. unmount it and the local files will still be there.
 
Old 01-29-2013, 05:21 AM   #7
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
oh right, sorry

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$
 
Old 01-29-2013, 05:25 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Did you unmount the NFS share? Just shutting down the NFS server can cause all kinds of unwanted and weird behavior.
 
Old 01-29-2013, 05:39 AM   #9
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TobiSGD View Post
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 )
 
Old 01-29-2013, 05:47 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
why is going to init 0 "just"? It's MUCH easier to just unmount the thing...
 
Old 01-29-2013, 05:49 AM   #11
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
why is going to init 0 "just"? It's MUCH easier to just unmount the thing...
Well I realized that later on that, I should have just unmounted the share
 
Old 01-29-2013, 11:11 PM   #12
abhinav4
Member
 
Registered: Jun 2010
Location: India
Distribution: Fedora/Cent OS
Posts: 123

Original Poster
Rep: Reputation: 0
Lightbulb

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
 
  


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
Disk space lost in home on ext3 (roughly 66% disappeared) abdullin Linux - Newbie 8 07-28-2011 12:36 PM
[SOLVED] vsftpd chrooting users that have been jailed into /home/jail/home/$username. amonamarth Linux - Server 4 07-09-2011 06:29 PM
[SOLVED] Lost users after upgrade keeping old /home. Can't re-create users... JZL240I-U Linux - Software 7 05-02-2011 03:43 AM
GDM: users disappeared from login box gumb Linux - Software 4 01-15-2011 06:41 PM
NT users login choices disappeared on Mandrake with winbind activated smiler Mandriva 1 06-24-2004 01:26 PM

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

All times are GMT -5. The time now is 06:25 PM.

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