Wikipedia:Reference desk/Archives/Computing/2017 July 19

Computing desk
< July 18 << Jun | July | Aug >> July 20 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 19 edit

copy over the entire /home partition from the old computer to the new computer edit

I have a computer with Ubuntu 16.04.02 LTS that I've been using for a year now. It has a separate /home and / partition.

I just now installed Ubuntu 16.04.02 LTS on a new computer, and would like to copy over the entire /home partition from the old computer to the new computer. What's the best way to do this? I'm familiar with scp, but am not sure whether it's "safe" to copy over an entire partition like this. I wouldn't want risk having a corrupted copy if the transfer was interrupted for whatever reason. Covfefe beans (talk) 23:22, 19 July 2017 (UTC)[reply]

Perhaps you can make a live CD and boot off that, copy the partition to a USB drive, and then boot the live CD on the new computer, and copy in. Graeme Bartlett (talk) 01:43, 20 July 2017 (UTC)[reply]
If you want to do a LAN copy, I suggest rsync, though you have to understand its options to make it copy everything unchanged (otherwise it will modify metadata). There are probably some graphical frontends if you're more comfortable with a GUI; I just go with command line myself. Can you physically move the drive(s) from the old computer into the new one? If so, that will be faster; you can use dd or something like Clonezilla to copy the partition locally. As long as you're copying, there's no risk of data loss. If something gets screwed up, you just redo the copy. (Protip: If you do things on the command line, triple-check everything before you hit enter. You will always absentmindedly transpose arguments when you least want to.) --47.138.161.183 (talk) 05:51, 20 July 2017 (UTC)[reply]
I'd consider scp safe if it completes its processing without an error message. You will want to carefully check the options to preserve all possible information, such as -p for modification times. However, on a /home filesystem there may be files owned by different users: at least there may be some owned by root as well as by you. It will probably be safer to create a tar archive of /home (as root), copy that to the destination machine, and unpack it there (as root). However, there is a risk to this approach too: the numerical user IDs have to be the same as on the first machine. If they aren't, you may have to chown a lot of files. --76.71.5.114 (talk) 07:56, 20 July 2017 (UTC)[reply]