LinuxQuestions.org
Review your favorite Linux distribution.
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 02-19-2008, 11:40 AM   #1
Mr. ameya sathe
Member
 
Registered: Jul 2007
Distribution: RedHat Enterprise 5 Server Edition; Ubuntu 8.04 ; RHCE Certificate number: 805008741034103
Posts: 78
Blog Entries: 7

Rep: Reputation: Disabled
Red face /home/ghar goes missing after it is mounted on a new partition.


My Distribution is RHEL5.

Initially, my root i.e. / was on the partion /dev/hdb1.
The user ghar had its home directory /home/ghar in /dev/hdb1.
I was able to perform read/write/execute actions under /home/ghar, when logged in as the user 'ghar' .

Due to space constraints; decided to create a new partion & mount /home under it.

Created an ext3 filesystem on /dev/hdb3.

Executed the command

Code:
e2label /dev/hdb3  /home
added a new line in /etc/fstab

Code:
LABEL=/home             /home                   ext3    defaults        1 2
After rebooting; the home directory of the user ghar has been lost.

Where did I go wrong?
 
Old 02-19-2008, 12:10 PM   #2
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
I think that you have created new /home directory wich deleted the old one.

Last edited by alan_ri; 02-19-2008 at 02:53 PM. Reason: bad grammar
 
Old 02-19-2008, 01:30 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
No, it wasn't deleted. It's still where it was originally. To prove my claim, unmount /dev/hdb3, then look at /home in your file browser.

This is where you went wrong.
You created the mount point - that's good.
You made the entry in /etc/fstab - that's good.
You never moved the /home directory from /dev/hdb1 to /dev/hdb3 - that's bad. /home is still in /dev/hdb1.

To fix this, edit /etc/fstab and comment out (not delete) the entry your made for /home on /dev/hdb3.
Reboot so that /home is where is should be, under / in /dev/hdb1.

Now make a mount point for /dev/hdb3: mkdir /mnt/hdb3
Mount it: mount /dev/hdb3 /mnt/hdb3.
Now 'cp -R /home /mnt/hdb3' to copy /home to /dev/hdb3. Then rename /home to something else. In case you make an error, you only need to rename it back to /home. If you 'mv /home /mnt/hdb3' and something goes wrong, you have lost /home unless you have a backup to restore. If all goes well, you still have to option of deleteing the renamed /home directory.

Now that you have copied /home to /dev/hdb3, go bacd to /etc/fstab and uncomment the line for /home on mount point /dev/hdb3.

Reboot. /home should now be on /dev/hdb3, and you should have more room on /dev/hdb1 for other files.

You may now delete the /mne/hdb3 folder. That was a temporary tool to make this work. You may also delete the renamed /home directory to make room on /dev/hdb1.

Last edited by bigrigdriver; 02-19-2008 at 01:38 PM.
 
Old 02-19-2008, 02:57 PM   #4
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
No,I think that now he only have /home in /dev/hdb3.
 
Old 02-19-2008, 03:08 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
Read his post carefully.
Quote:
Initially, my root i.e. / was on the partion /dev/hdb1.
The user ghar had its home directory /home/ghar in /dev/hdb1.
I was able to perform read/write/execute actions under /home/ghar, when logged in as the user 'ghar' .

Due to space constraints; decided to create a new partion & mount /home under it.

Created an ext3 filesystem on /dev/hdb3.

Executed the command

Code:
e2label /dev/hdb3 /home
added a new line in /etc/fstab

Code:
LABEL=/home /home ext3 defaults 1 2
After rebooting; the home directory of the user ghar has been lost.
He has created partition /dev/hdb3.
He has added a mount point in /etc/fstab for /home.
He has not moved the files from /home on /dev/hdb1.

When he boots up, /home on /dev/hdb3 (an empty directory) is an overlay on the /home directory on /dev/hdb1. Therefore he can't see the files on /dev/hdb1.

As soon as he unmount /dev/hdb3, the overlay is removed, and the files in /home on /dev/hdb1 become visible.

I should add that I am certain this is so, because I did it to myself 2 or 3 years ago.

Last edited by bigrigdriver; 02-19-2008 at 03:10 PM.
 
Old 02-19-2008, 03:31 PM   #6
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
If I understand you good,then every time he will boot his system he will first have to unmount his /home directory which really isn't his /home dir,so what's the purpose of /dev/hdb3 then?If I look at this with logic,then I must ask you could there be 2 /home dirs,with no matter if they were on two different partitions?
If new /home dir is just created then how it can be overlay of another /home directory.I still think what I said is true and can't wait to see what thread starter will post back.
And I forgot,where is ghar?

Last edited by alan_ri; 02-19-2008 at 03:56 PM. Reason: forgot something
 
Old 02-19-2008, 03:43 PM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
No, you don't understand me. He missed a vital step required to make the move of /home from /dev/hdb1 to /dev/hdb3.

All he has to do is go back to my first response to his post and follow the instructions after "To fix this".

He will then be able to do the one step he missed in his attempt to move /home to /dev/hdb3.

He will also have /etc/fstab in order so that /home is mounted on /dev/hdb3.

His files will be copied from /dev/hdb1 to /dev/hdb3 so that they are in the correct place.

He will have the original /home still on /dev/hdb1, but renamed so that he can easily from any error that might occur by simply naming it back to /home.
 
Old 02-19-2008, 03:54 PM   #8
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
But there isn't a /home directory of user ghar:

Quote:
Originally Posted by Mr. ameya sathe View Post

After rebooting; the home directory of the user ghar has been lost.
 
Old 02-19-2008, 04:08 PM   #9
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
No, It hassn't been lost. He created a new partition called /home on another partition. That partition is empty. The /home directory on /dev/hdb1 is still in place.

When he rebooted, the / (root) filesystem (with /home directory) is mounted, then /dev/hdb3 partition is mounted at /home, which puts an empty directory over the top of the full directory. Think of it as a man putting on a hat. If he has no hat, you can see his bald spot. When he puts on the hat, you can't see the bald spot. It's covered up.

In the same manner, his /home on /dev/hdb1 is still there, but he put a hat on over it; a hat called /dev/hdb3. The hat is empty and he can't see the files under it in /dev/hdb1.

All he has to do is unmount /dev/hdb3, and the files in /home on /dev/hdb1 will suddenly appear, as if by magic.
 
Old 02-19-2008, 04:30 PM   #10
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
I understand you,I never tried it before,so I was just thinking about how this and how that.I guess we just have to wait and see what will thread starter post here and I'm not saying that you can't be wright about this.But I wish that Mr.ameya sathe has been more specific.

Last edited by alan_ri; 02-19-2008 at 04:41 PM.
 
Old 02-19-2008, 04:47 PM   #11
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
My only hope is that the omission of copying /home to /dev/hdb3 was an omission in his stragegy, and not an omission is his post. If he did indeed move the files over (that step not mentioned in his post), then he may well have lost the files. But, on reading it again, I don't see how.
 
Old 02-20-2008, 08:45 AM   #12
Mr. ameya sathe
Member
 
Registered: Jul 2007
Distribution: RedHat Enterprise 5 Server Edition; Ubuntu 8.04 ; RHCE Certificate number: 805008741034103
Posts: 78
Blog Entries: 7

Original Poster
Rep: Reputation: Disabled
Lightbulb Solution successful with few more solutions & questions

1. I looked into the /home directory present in /dev/hdb3 partition. It contained only single empty sub directory called lost+found.

2.I did Carry out the steps mentioned by bigrigdriver albeit with few changes.
I did login as root to carry out the following steps.
Code:
mkdir /mnt/bckghar
cp -a /home/ghar /mnt/bckghar
Uncommented the /home entry in the /etc/fstab file & rebooted.

Code:
cp -a /mnt/bckghar/ghar /home/
rm -r /mnt/bckghar
Please note the option -a
3. On another tty1; I did login as the user ghar.
I was deposited into my home directory, along with all files present. Thank you for help . Thus; some disk space under root partition reduced somewhat.

4. I understood the reply containing 'hat' & 'bald man' concept. But, what will be its technical answer?

P.S. I ran du command on the directory /.

Found out that; /usr is occupying 93% of the space.
So, want to shift this /usr to a new partition. Is it possible?
 
Old 02-28-2008, 08:44 AM   #13
Mr. ameya sathe
Member
 
Registered: Jul 2007
Distribution: RedHat Enterprise 5 Server Edition; Ubuntu 8.04 ; RHCE Certificate number: 805008741034103
Posts: 78
Blog Entries: 7

Original Poster
Rep: Reputation: Disabled
Exclamation

If I copy the whole directory i.e. to a new partition /usr
& then, mount it during boot time.
then, is this a safe step?
 
Old 02-28-2008, 08:54 AM   #14
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
I don't see why it should not be.
 
  


Reply

Tags
directory, home, missing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't allow partion permissions for a vfat partition, mounted as my home folder DrD Linux - General 19 07-26-2006 01:26 PM
Mounted /home on its own partition, now I can't login to X ErrorBound Ubuntu 1 07-20-2006 06:50 PM
Gnome login problem with mounted /home partition steveybaby2 Slackware - Installation 8 01-06-2004 08:11 AM
Gnome login problem with mounted /home partition steveybaby2 Linux - Newbie 2 01-02-2004 10:41 AM
Windows partition is now mounted at /home!!!! jcksrobbins LinuxQuestions.org Member Success Stories 12 10-06-2003 05:53 PM


All times are GMT -5. The time now is 02:19 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration