LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   will this command mount my old "/home" for a new distro installed? (https://www.linuxquestions.org/questions/linux-newbie-8/will-this-command-mount-my-old-home-for-a-new-distro-installed-562533/)

mhg 06-17-2007 08:53 PM

will this command mount my old "/home" for a new distro installed?
 
I was looking through these instructions, seeing if I understand them.

http://www.linuxmint.com/wiki/index....that_partition

I already have a separate home directory that I created when installing my first Linux distro. What I would like to accomplish is use that same partition as my home for the new installation.

Will these instructions work for that, or is there a better way?

There is not enough data in the home directory of the new install to care about, but I would want to preserve what I have in the other home directory.

Thanks for any help.

morphodone 06-17-2007 09:45 PM

If you already have a separate partition for home then
all that should not be necessary.

All you need to do is mount that other partition on /home.

Code:

mount -t ext3 /dev/sda3 /home
substitute your own filesystem and disk device

that would mount the device as your /home partition temporarily

an edit to /etc/fstab would make it permanent

Junior Hacker 06-18-2007 04:15 AM

This is how I did it:
Code:

1: #mkdir /mnt/newhome
2: #fdisk -l  <----to find device name of /home partition
3: #mount -t ext3 /dev/sdb3 /mnt/newhome  <-----change /dev/sdb3 to match your /home partition from the old installation, also change file system type from ext3 to the type the partition has if applicable.
4: #cd /home
5: #cp -ax * /mnt/newhome  <----this copies everything in old home to new home partition including links. Make sure not to have same user name as existing names in the home partition
6: #cd /
7: #rm -fr /home
8: #umount /mnt/newhome
9: #mv /mnt/newhome /home
10: #vim /etc/fstab  <---this uses vim editor, use the editor you are comfortable with and substitute it with the word vim
11: /dev/hdb3 /home ext3 defaults 1 2  <----this is the line to put in /etc/fstab, change /dev/hdb3 same as above
12: re-boot

Which is basically the same except a couple things are opposite but end up the same.

mhg 06-30-2007 07:38 PM

hosed most of my LinuxMint installation
 
Nothing ventured nothing gained.

Managed to hose most of my data trying to follow instructions above.

I got to step 7. When I used the command, I got the message:
can not remove directory, device or resource busy.

From that point on I was out of luck. By that time I could not use anything in LinuxMint except the one terminal I had open. I tried mounting my partition, a few thing like that, but all to no avail.

I wondered about starting up in safe mode, and continuing command from there. I could not even turn the PC off, I had to unplug it. Then started up LM again, only to find that I had lost all my application data. LM started up with my user name and password, and I still have my directory with Ubuntu and SOME of LM data, but all mail, all preferences of any sort were gone.

Nothing critical, but it will take some time to get back where I was again.

I will eventually have to try this again. Well, I guess I should try it first, before I do anything else, before I have anything to lose again.

Any suggestions from here? Maybe I should make a new post to try over again?

Thanks

mhg 07-01-2007 02:00 PM

Well.

After another crash will trying to mount ny old /home, I tried a third time. Remember I got part way through the instructions from junior hacker the time before last.

This time I used morphodone's command to mount, then used gedit to mount as junior hacker described. Everything is back! I am extremely happy.

So I guess I got everything copied properly thanks to jh, then somehow when I mounted all came out well.

I'm too new to understand it all, but I am back in business without having to reinstall and set up software.

I guess sometimes with enough help here I can get lucky:)

Thanks for the help.


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