LinuxQuestions.org
Visit Jeremy's Blog.
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 11-22-2010, 10:21 AM   #1
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Rep: Reputation: 30
move /home to another computer


I have just put together a new computer using an Intel i3-550 64 bit processor, and installed Windows (first), then Ubunutu 10.04. A separate /home partition was created. The linux partitions in this computer are formatted ext4.

Now I want to move my /home partition from my old 8.04 computer (32 bit, formatted ext3) which also has a separate /home partition.

Both are connected to a lan, but so far I have not been able to connect from one to the other.

I have done lots of googling on this and am astonished at the apparent complexity involved. There seem to be issues involving whether or not files in the /home partition in the old computer is in use at the time of copy or creating a tarball, user permissions, and I don't know what all else.

Assuming that neither the ext3 on the old and ext4 on the new, nor the 32 bit on the old and the 64 bit on the new are not issues, how do I go about moving the /home from the old to the new? If possible, I would like to use a GUI rather than the command line, but if it is necessary to use the command line, please specify where one needs to be located in the file hierarchy in order to give the designated commands. I am not very knowledgeable about using the terminal.

Also, I am a noob (probably apparent) so step-by-step instructions will be very helpful.

Thanks in advance.
 
Old 11-22-2010, 10:30 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by Odyssey1942 View Post
I have just put together a new computer using an Intel i3-550 64 bit processor, and installed Windows (first), then Ubunutu 10.04. A separate /home partition was created. The linux partitions in this computer are formatted ext4.

Now I want to move my /home partition from my old 8.04 computer (32 bit, formatted ext3) which also has a separate /home partition.
I need to ask a few question before I can give you a definite response, because there's a number of ways to interpret what you said, and also a number of ways to implement a solution.

So, just to clear the issue: do you want to
  • just move files from one computer to another at any given time?
  • create some kind of "shared folder" so users from two computers have a place to deploy and share stuff?
  • truly store the /home partition in the remote computer?

Quote:
Both are connected to a lan, but so far I have not been able to connect from one to the other.
Well, regardless of the answer above, this is the first thing you need to sort out. For this you first need to make sure that the computers have a working network interface, the connection is ok, and that computers in your lan can ping each other, preferably via IP AND via host name.

Quote:
I have done lots of googling on this and am astonished at the apparent complexity involved. There seem to be issues involving whether or not files in the /home partition in the old computer is in use at the time of copy or creating a tarball, user permissions, and I don't know what all else.
This depends on the "how".

Quote:
Assuming that neither the ext3 on the old and ext4 on the new, nor the 32 bit on the old and the 64 bit on the new are not issues, how do I go about moving the /home from the old to the new? If possible, I would like to use a GUI rather than the command line, but if it is necessary to use the command line, please specify where one needs to be located in the file hierarchy in order to give the designated commands. I am not very knowledgeable about using the terminal.

Also, I am a noob (probably apparent) so step-by-step instructions will be very helpful.

Thanks in advance.
Bitness and fs are a non-issue, generally speaking, since you will be using the remote fs via cifs, nfs or anything else, remotely. But we need to know more details.
 
Old 11-22-2010, 02:26 PM   #3
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
Thanks for yours.

Quote:
So, just to clear the issue: do you want to
just move files from one computer to another at any given time?
create some kind of "shared folder" so users from two computers have a place to deploy and share stuff?
truly store the /home partition in the remote computer?
This will be a permanent move of /home. In past, the 8.04 computer has been my main workstation, but will be replaced by the new computer.


Quote:
...this is the first thing you need to sort out. For this you first need to make sure that the computers have a working network interface, the connection is ok, and that computers in your lan can ping each other, preferably via IP AND via host name.
They can ping each other by IP #. Not sure how to find computer name of the older computer?
 
Old 11-22-2010, 02:48 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Quote:
Originally Posted by Odyssey1942 View Post
Not sure how to find computer name of the older computer?
Code:
cat /etc/hostname
on the older computer.
 
Old 11-22-2010, 05:20 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by Odyssey1942 View Post
This will be a permanent move of /home. In past, the 8.04 computer has been my main workstation, but will be replaced by the new computer.
So all you need is a way to transfer the files from the old system to the new system, then the old one will be discarded. Is that correct?

If so, then you could proceed in a number of ways. What I'd do would be to launch sshd in your old box. Then, from the new box you can do something like:

Code:
scp -r root@a.b.c.d:/home/<whatever>/* $HOME/
Where "a.b.c.d" is the IP of the old computer (usually 192.168.something.something) and <whatever> is your home directory in the new machine. Ssh should ask for the password unless you have set up key pair authentication.

You could also use rsync, or nfs. I am just more comfortable with ssh.

If this is not what you want, please, give more details.

Last edited by i92guboj; 11-22-2010 at 05:22 PM.
 
Old 11-22-2010, 05:28 PM   #6
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
New computer successfully pings old computer by name.

New computer successfully pings itself by name.

Old computer not successful in pinging new computer by name. Gives message:

Quote:
ping: unknown host Intel-i3-550
Old computer not successful in pinging itself by name. (same message with it's own name)
 
Old 11-22-2010, 05:32 PM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
You can still operate using IP's, assuming that the network is correctly configured. This could be a firewall issue as well, or more probably a misconfigured /etc/hosts file.
 
Old 11-22-2010, 05:37 PM   #8
at2marty
LQ Newbie
 
Registered: Aug 2005
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by Odyssey1942 View Post
New computer successfully pings old computer by name.

New computer successfully pings itself by name.

Old computer not successful in pinging new computer by name. Gives message:



Old computer not successful in pinging itself by name. (same message with it's own name)
You actually have a couple of issues that need to be sorted out, the first one being your networking issue. It sounds like you have no entries in you hosts file (/etc/hosts) on your old computer.

What distro are you using? Although doing things on the command line may seem a bit tedious, it also in many ways is easier and you learn how your computer operates.
 
Old 11-22-2010, 10:02 PM   #9
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
Ubuntu 9.04 on the old computer, and 10.04 on the new.
 
Old 11-22-2010, 10:49 PM   #10
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
If I might make a suggestion...

The concern of not having files open generally isn't a concern for a regular user--you know when you have files open and are modifying them. That said, I'll give you some instructions that avoid logging into your account, making sure no files are open/changing.

I avoid the networking thing because it sounds to me like the only reason for the network is to copy the files. If that's the case, it's the tail wagging the dog. Once the data is copied, then you can mess with the networking if and when you want to.

I assume you installed 10.04 with a boot CD or you have a live CD Ubuntu CD at your disposal.

1. Boot the old computer with the Ubuntu boot CD

2. Do NOT install, but select the "try Ubuntu" option

3. After Ubuntu boots to the desktop, open a file manager window

4. You should see entries on the left pane representing the partitions of your old hard drive

5. Left click on each one until you find the partition that stores your old /home directory

6. Once you locate your home directory, right-click the directory with your username

7. In the pop-up menu, select "Compress"

8. You'll have a new window giving you some options. Pick whatever suits your needs:
a) .tar.gz file is "standard"
b) .tar.bz2 generally gives a little better compression in my experience
c) .rar can be used to split the archive (if your home directory is massive) into manageable chunks (say 650 MB, 4.7 GB, or the size of a USB thumbdrive/external drive)

9. Choose the compression you want and where to save it. Save the archive in any directory of your old system's partitions EXCEPT for anywhere in your home directory (to avoid a archiving the archive). It should go without saying that you DO NOT want to save the archive in any of the in-memory live-CD filesystem directories.

10. Once the archive is complete, you can transfer it by burning it onto CD(s), DVD(s), USB drives, etc. and walking them over to the new machine. Do this step by any method you're comfortable with--using the live CD or booting into the old system's normal desktop.

11. On the new computer, extract the archive into a temporary location--DO NOT just dump the archive on top of your existing home directory.

12. Either leave the files there, or start pulling the individual files out and merge them into your new home directory.

13. Be careful with any dot files (e.g. .gconf, .mozilla, .ssh, etc.). DO NOT bulk copy them into your home directory. That could cause problems from minor warning messages to login failures. I would suggest you generally leave the dot files alone unless you are very, very familiar with them and know what you're doing.

Last edited by Dark_Helmet; 11-22-2010 at 10:53 PM.
 
Old 11-23-2010, 08:31 AM   #11
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
i92guboj, I somehow missed yours yesterday (probably when I was typing up a reply).

Sounds simple enough for me to pull it off, but just to make sure I understand this:

on the old computer, go into terminal and type "sshd" (maybe sudo "ssd"?) (which I believe will cause the old computer to start listening for commands over the lan) (BTW, does this also cause the old computer to start listening for commands from over the internet, and if so, should I go offline from the I/N before issuing sshd?)

Then from the new computer, I will go into terminal and issue the command:

scp -r root@192.168.0.108:/home/Intel-i3-550/* $HOME/
(where 192.168.0.108 is the ip # of the new computer, and Intel-i3-550 is the name of the new computer)

or, should it be:

scp -r root@192.168.0.101:/home//Ubuntu/* $HOME/
(where 192.168.0.101 is the ip # of the old computer, and Ubuntu is the name of the old computer?

Reason for asking is that I don't understand how the new computer finds the old /home partition and folder.

Whichever it is, the authentication that will be requested presumably is for access to the /home folder on the old computer, and therefore should be the pw for the old computer?

Thanks,
 
Old 11-23-2010, 08:42 AM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Use the second one and the password from your old computer.

To get the sshd running you first have to install it.
Code:
sudo apt-get install ssh
It should be started automatically. If you only use it for this purpose and maybe remove it after copying the folder I see no need to disconnect from the internet.
 
Old 11-23-2010, 08:53 AM   #13
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by Odyssey1942 View Post
i92guboj, I somehow missed yours yesterday (probably when I was typing up a reply).

Sounds simple enough for me to pull it off, but just to make sure I understand this:

on the old computer, go into terminal and type "sshd" (maybe sudo "ssd"?) (which I believe will cause the old computer to start listening for commands over the lan) (BTW, does this also cause the old computer to start listening for commands from over the internet, and if so, should I go offline from the I/N before issuing sshd?)
Complex question. What will sshd attend to depends on its config, usually under /etc/ssh/sshd_config. The firewall (iptables) is also an issue.

For max security, though, you should disable any external access while you are doing administrative stuff. That's always a good thing unless you are doing the administrative stuff from the outer side.

This also will ensure that no one else is logged in remotely operating concurrently over the same files you are operating. Concurrency is always a problem.

When you run sshd, it will surely tell you what config file it is using and some other info. It will also tell you if the daemon started correctly. That's the first step. Until that succeed you can't use ssh or scp from the other machines.

Quote:
Then from the new computer, I will go into terminal and issue the command:

scp -r root@192.168.0.108:/home/Intel-i3-550/* $HOME/
(where 192.168.0.108 is the ip # of the new computer, and Intel-i3-550 is the name of the new computer)
You don't use the name of the new computer there, "root@192.168.0.108:/home/Intel-i3-550/*" is the path to your source files. The home directory where the files reside in your OLD computer.

Assuming you use the same user name than you are using here, it would rather be like this:

Code:
scp -r root@192.168.0.108:/home/Odyssey1942/* $HOME/
It's the typical cp syntax,

Code:
scp <source> <destination>
Quote:
Reason for asking is that I don't understand how the new computer finds the old /home partition and folder.
I think this should be now clear. Ask again if you need more clarification.

Quote:
Whichever it is, the authentication that will be requested presumably is for access to the /home folder on the old computer, and therefore should be the pw for the old computer?

Thanks,
It's your login info. As we are using "root@192.168.0.108" then that would be the password for root. You don't strictly need root permissions, so you could very well just use "your_user_name@192.168.0.108", and use your password instead of the root one.
 
Old 11-23-2010, 07:40 PM   #14
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
Dark Helmet, Guess I missed yours while I was typing my earlier. Thank you sincerely for such complete and easy to follow instructions. I do have a couple of questions, and:

to answer yours, the new machine will boot into 10.04 (dual boot with Windoze) and I do have a live CD.

The questions are:

Quote:
11. On the new computer, extract the archive into a temporary location--DO NOT just dump the archive on top of your existing home directory.
By "temporary location", I think we are talking about the new drive? The new drive has another partition which is at present unused and is EXT4. Can I use that, or is it better to use some existing folder within /, and if so, any that I should not use?

Once uncompressed, how are they best transferred to the new /home directory?

12/13. This is a bit worrying because I would have hoped to just move the whole kit and kaboodle over without needing to know that certain files and folders should not be moved. I would not know where to begin with the "nots", so can I just not copy anything that begins with a " . "? Is that going to create other issues?

----------------------

Also i92guboj, between my previous, yours and TobiSGB's, I am comfortable that I understand it.

----------------------

As you all can see, I am undecided about which route to go, and of course may wind up trying both of necessity.

Last edited by Odyssey1942; 11-23-2010 at 07:44 PM.
 
Old 11-23-2010, 08:11 PM   #15
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by Odyssey1942
By "temporary location", I think we are talking about the new drive? The new drive has another partition which is at present unused and is EXT4. Can I use that, or is it better to use some existing folder within /, and if so, any that I should not use?

Once uncompressed, how are they best transferred to the new /home directory?
Yes, a temporary location on your new drive/computer. What I mean by "temporary location" is just somewhere that you have enough space to hold the extracted archive and is part of the filesystem (i.e. it is mounted somewhere, like /data). So yes, you can extract it to the unused partition as long as it's mounted. If that partition is mounted at /data, then you might do something as simple as make a new directory named /data/old_home and extract the archive into that directory.

Then you copy files like normal. Open up a GUI file manager and drag-drop or open a command line and "cp /data/old_home/<somefile> /home/username/<somefile>"

Quote:
Originally Posted by Odyssey1942
12/13. This is a bit worrying because I would have hoped to just move the whole kit and kaboodle over without needing to know that certain files and folders should not be moved. I would not know where to begin with the "nots", so can I just not copy anything that begins with a " . "? Is that going to create other issues?
In general, you'll be safe by copying over everything other than dot files. The only cause for concern with the dot files is that they're config files, and you just upgraded your software. The newer software may not recognize the older config files anymore. That is where the problems come in--when version 2 software tries to read version 1 config. Sometimes it will work, sometimes... not so much.

Dot files are hidden by default in the GUI file manager. So, you can "go to town" if you're copying files that way. There should be no problems. You have to manually update a setting to show hidden/dot files.
 
  


Reply


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
move /home from remote? bioe007 Slackware 4 11-19-2007 12:24 AM
How to move open office doc from Linux computer to Windows computer Phoenixink Linux - Software 6 02-15-2007 08:09 AM
Can I move /home ? MikeyDIUP Linux - Newbie 3 09-11-2005 02:36 AM
I want to move home fannymites Linux - General 1 12-04-2004 06:45 AM
How do i move /home to a new partition? glenn69 Linux - General 8 06-25-2004 12:38 PM


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