You are not logged in.

#1 2005-11-07 12:22:27

tlilja
Member
From: Turku, Finland
Registered: 2005-06-29
Posts: 48

Moving installation from one HD to another

I just got a new faster and bigger HD and would like to move my Arch installation from the old one to the new. What would be the simplest way to do this? We're talking about two IDE drives, no SATA, no nothing.

My HD layout is as follow:
/dev/hda1 is /boot
/dev/hda2 is swap
/dev/hda3 is /

I found some advice using Google but it seems to be quite a hassle. Surely there's an easier way to do this? Although making a clean install wouldn't be a bad thing, I'd much rather keep my old installation.

http://en.tldp.org/HOWTO/Hard-Disk-Upgrade/index.html


Just your basic anime otaku some might even call nijikon.

Offline

#2 2005-11-07 13:21:29

Kern
Member
From: UK
Registered: 2005-02-09
Posts: 464

Re: Moving installation from one HD to another

you could use dd to transfer the image across, but this will leave spare capacity on the new drive as its bigger. you would then have to maybe make new partitions outside your transferred image.

Offline

#3 2005-11-07 13:29:19

clarence
Member
From: fremantle.au
Registered: 2005-10-12
Posts: 294

Re: Moving installation from one HD to another

First I make sure that I don't make my current install unbootable...

Then carefully set-up partitions using fdisk or qparted.

Next I use

cp -a

to copy everything from hda over to hdb.

I then edit the copied fstab on hdb drive to ensure that the new installation will be reading from the hdb disk when it first boots. (Of course if you want to keep hda1 as your boot then leave it as hda1.)

I then add a new entry to grub pointing to the new install on hdb. Then reboot and cross fingers.


fck art, lets dance.

Offline

#4 2005-11-07 16:44:59

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Moving installation from one HD to another

the most consistent way to do this is using a regular tarball with preserved permissions for one fs each. in your case:

tar cfpl /     | tar xfvp - -C /your/new/
tar cfpl /boot | tar xfvp - -C /your/new/boot

then bind all necessary pseudo-filesystems to the new root and chroot to install grub/lilo. that should be it.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#5 2005-11-07 17:35:27

tlilja
Member
From: Turku, Finland
Registered: 2005-06-29
Posts: 48

Re: Moving installation from one HD to another

Done, I copied all files from the old drive to the new, edited fstab, booted with boot CD and re-installed grub. That's it, works nice.

Thanks!


Just your basic anime otaku some might even call nijikon.

Offline

#6 2005-11-08 08:50:12

Dr.U
Member
From: Ettlingen, Germany
Registered: 2005-03-03
Posts: 68

Re: Moving installation from one HD to another

Congratulations! I've been wanting to do a similar move so tell me: did you follow the method proposed by clarence or the one by kth5? I don't understand what kth5 means by pseudo-file systems  :oops:

I originally installed Arch in a rather small partition as an experiment (I play around with lots of different distros looking for "the keeper" among those out there). Arch has turned out to be so good that I think my search is over! 8)  I plan now on moving the current installation to a different hard disk and giving it more space.

Regards,
  -- Dr.U
----------------------------------------------------------------------
"You can observe a lot just by watching." -- Yogi Berra

Offline

#7 2005-11-08 09:34:44

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Moving installation from one HD to another

Dr.U wrote:

Congratulations! I've been wanting to do a similar move so tell me: did you follow the method proposed by clarence or the one by kth5? I don't understand what kth5 means by pseudo-file systems  :oops:

pseudo-filesystems are for example devfs, proc and sysfs. by binding them to a new root i mean doing something like this:

mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys

this is necessary to install grub or lilo from within a chrooted environment. they both need to read /proc/partitions to figure out how to match the setup with the physical layout of the disks. the above method does work with every directory by the way.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#8 2005-11-08 12:07:04

Dr.U
Member
From: Ettlingen, Germany
Registered: 2005-03-03
Posts: 68

Re: Moving installation from one HD to another

Thanks for the explanation, kth5!

Am I correct that, if I perform the move to another hard disk or a larger partition on the same disk, but already have grub installed in yet another location, then I can skip the chroot-stuff (i.e. binding the pseudo-filesystems) and just correct the grub menu.lst file's information for the Arch entry?

Regards,
  -- Dr.U
-----------------------------------------------------------------------------
"I'm taking viagra and drinking prune juice --
I don't know if I'm coming or going." -- Rodney Dangerfield

Offline

#9 2005-11-08 13:05:33

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Moving installation from one HD to another

Dr.U wrote:

Am I correct that, if I perform the move to another hard disk or a larger partition on the same disk, but already have grub installed in yet another location, then I can skip the chroot-stuff (i.e. binding the pseudo-filesystems) and just correct the grub menu.lst file's information for the Arch entry?

it depends on wether you leave the hdd with the original grub setup in the machine or not. even if you do, this can complicate things a bit as your menu.lst is still being read from the old location instead out of the new rootfs (if you copied /boot too). in my opinion it would be easier to just switch the order of the discs (hda <=> hdb) after copying and rerun grub-install so that it installs itself onto the new system disc.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#10 2005-11-08 14:49:14

Dr.U
Member
From: Ettlingen, Germany
Registered: 2005-03-03
Posts: 68

Re: Moving installation from one HD to another

OK, kth5, thanks for the help and quick answers!

Arch is not only the best, it also has the best support for old farts like me. tongue

Regards,
-- Dr.U
-------------------------------------------------------------------------------
"A man's only as old as the woman he feels." -- Groucho Marx

Offline

Board footer

Powered by FluxBB