Migrating a Linux (Debian Squeeze) system from one HD to another HD

Migrating a Linux (Debian Squeeze) system from one HD to another HD

Tzafrir Cohen tzafrir at cohens.org.il
Sun Feb 19 22:06:02 IST 2012


On Sun, Feb 19, 2012 at 09:22:37PM +0200, Omer Zak wrote:
> Hello Tzafrir,
> Thanks for your war story.
> 
> On Sun, 2012-02-19 at 18:34 +0000, Tzafrir Cohen wrote:
> > update-initramfs -u
> 
> The twist is that I need to boot some kernel to run it.
> What I did was:
> 1. Leave both disks connected to the PC.
> 2. Boot from the old (500GB) disk.
> 3. Mount the partitions of the new (2TB) disk on a directory tree
> originating in /tmp/new_2T, so that the to-be-root partition is mounted
> on it and other partitions are mounted on subdirectories of the
> to-be-root.
> 4. chroot /tmp/new_2T/ update-initramfs -u -k all -v

You make need to bind-mount /dev and mount /proc and/or /sys inside the
chroot.

> 5. Reboot - this time into the new (2TB) disk.
> 6. Get stuck because it doesn't find the root and swap partitions.
> 
> How did you boot your PC to run update-initramfs?

Rescue system. I could use both old and new.

-- 
Tzafrir Cohen         | tzafrir at jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir at cohens.org.il |                    |  best
tzafrir at debian.org    |                    | friend



More information about the Linux-il mailing list