Migrating a Linux (Debian Squeeze) system from one HD to another HD
Tzafrir Cohen
tzafrir at cohens.org.il
Sun Feb 19 20:34:49 IST 2012
On Sun, Feb 19, 2012 at 03:47:32PM +0200, Omer Zak wrote:
> Thanks, Daniel and Amos, for your suggestions.
> However they address the wrong part of my problem.
> All my regular files were already copied to the new hard disk and it was
> properly set up.
> The only problem is to boot from it.
>
> I successfully set up grub2 to boot from the new disk's boot partition
> (a physical partition, not under LVM control). For this purpose, I
> modified grub.cfg.
> I need to rebuild initrd.img files for all kernels that I have.
update-initramfs -u
>
> Yedidiah, you questioned my finding that logical volume paths are
> hardwired in the initrd images. They are.
> The relevant files are:
> /scripts/local-top/cryptroot and /conf/param.conf
> in the initrd image.
>
> According to man mkinitramfs, the file which configures the above
> is /etc/initramfs-tools/initramfs.conf and in practice I see files also
> in /etc/initramfs-tools/conf.d
If things don't work, chances are that lookingg there is not the right
place. Debian's defalt initrd is a bit largish, but tends to "Just
Works[tm]".
I recently needed to do a similar migration (also moving the LVM to
reside on top of a RAID-1) in a Debian Squeeze system. It turned out that:
* I left out some room for a physical /boot partition. It turned out
there was no need for it.
* It took me a while to figure out why the system won't boot even though
I regenerated the initramfs. After much digging in the scripts, in the
extracted initrd (gunzip it and extract the cpio with cpio -id), I
realized that if I really want to boot from a RAID I better install
mdadm (and regenerate initramfs).
* Still one of those two disks crashed this morning :-( .
--
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