You are not logged in.

#1 2008-11-05 23:58:30

jamtat
Member
Registered: 2008-03-13
Posts: 224

plan for migrating to new HD: input?

I've got an Arch install on a HD that's going bad. I want to preserve the Arch install, but move it over to a new HD. I've hatched a plan for accomplishing this and I'd like to ask for feedback and alternate suggestions.

First, I need to point out that the new HD is larger than the one Arch is currently installed to. This precludes the simplest way of doing this sort of migration (that way being to put both drives in the same machine, boot from a suitable Linux CD, and issue something like

dd if=/dev/archinstall of=/dev/newdrive

from the command line).

I've decided on the following plan of action. First, I'll put the new drive in a machine by itself, boot from the Arch live CD in that machine, and do a minimal Arch install on the drive. That will make it bootable. The next step is to put the drive with the Arch install I want to preserve into that machine along with the new drive and boot the machine from a capable Linux CD. Once that's done, I would mount the two HDs--say, one at /mnt/oldarch and the other at /mnt/newarch. Then, I tar up the entire content of the Arch install I want to preserve and stick the tar file in the root of the new drive. Something like

cd /mnt/oldarch
tar  -cvvf /mnt/newarch/oldarch.tar *

Once the tarball is made and placed at /mnt/newarch, just cd to there and untar it, letting it add (and overwrite where relevant) all those files/directories to the fresh install on the new HD.

Sound like a plan? Alternative suggestions?

Thanks,
James

Offline

#2 2008-11-06 00:23:43

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: plan for migrating to new HD: input?

I'd suggest using the Clonezilla LiveCD. Worked perfectly for moving from my old-old laptop to my old-laptop.

Another alternative to for the tar|

cd /mnt/oldarch
tar cvf - * | (cd /mnt/newarch ; tar xf -)

tar and untars at the same time, and saves having to create an intermediate archive.

But I'd still recomment using the Clonezilla LiveCD over tar.

Offline

#3 2008-11-06 00:37:37

jamtat
Member
Registered: 2008-03-13
Posts: 224

Re: plan for migrating to new HD: input?

Thanks for the pointers. As you can see, I'm sort of a bash neanderthal. Your tar solution is a lot more elegant and efficient. Guess I should done some web searching on cloning drives--hadn't heard of clonezilla. It really does look like just the ticket.

Thanks,
James

Offline

#4 2008-11-06 02:28:23

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: plan for migrating to new HD: input?

No stress - just a perfect example of how there's more than 1 way to fsck a cat /dev/sda in Linux tongue

Offline

#5 2008-11-06 06:17:14

Leigh
Member
From: USA
Registered: 2004-06-25
Posts: 533

Re: plan for migrating to new HD: input?

I recently did this when I decided to move my arch install on my desktop to my laptop. Minus the things I needed to change due to hardware differences, I just plugged in a usb HD. The system sees it as sdb. My arch install is on primary sda. after patitioning the usb drive they way I wanted it, I booteda live cd and mounted both sda and sdb and just copied everything recursively and in verbos mode so I can watch .. example... 

cp -a -v /location-of-hd/sda3/* /location-of-hd/sdb3

Same for sda1 to sdb1 and so on. It's pretty simple if your partition scheme is the same on both drives. Of course after recopying to my laptop from the usb. I needed to do some configuration tweaking which was quite a bit due to the differences in hardware, but I was up and running in much less time than if I had just reinstalled arch on the laptop from scratch.

That might be a very old fashioned way, but it worked really well for me. Anyway, I thought it was worth mentioning.


-- archlinux 是一个极好的 linux

Offline

#6 2008-11-07 16:11:11

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: plan for migrating to new HD: input?

Leigh wrote:

That might be a very old fashioned way, but it worked really well for me.

Not at all, this is a quick and most simple solution for his situation. Mount the new disk. Copy everything except /proc (but you create the dir on the new disk) while preserving permissions/ownership/timestamps... (-a). You can then mount /proc and /dev (bind) on the new disk (if boot loader needs to be (re)installed), chroot there, edit fstab, edit lilo.conf and reinstall lilo, reboot.


You need to install an RTFM interface.

Offline

Board footer

Powered by FluxBB