Migrating a Linux (Debian Squeeze) system from one HD to another HD
Omer Zak
w1 at zak.co.il
Sun Feb 19 15:47:32 IST 2012
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.
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
I created files which set
RESUME=/path/to/swap/volume
ROOT=/path/to/root/volume
However even after doing so, the boot loader doesn't find them.
So I must have been doing something wrong.
Any other suggestions?
--- Omer
On Sun, 2012-02-19 at 23:23 +1100, Amos Shapira wrote:
>
> On Feb 19, 2012 4:37 PM, "Daniel Shahaf" <d.s at daniel.shahaf.name>
> wrote:
> >
> > Omer Zak wrote on Sun, Feb 19, 2012 at 04:03:05 +0200:
> > > My PC has a 500GB hard disk, and I want to migrate it to a 2TB
> hard
> > > disk.
> > > The new hard disk has been formatted to have two physical
> partitions,
> > > one serves as /boot and the other is an encrypted LVM volume,
> which has
> > > its own division into logical partitions.
> > >
> > > I rsync'ed the old hard disk's contents into the new one
> (excluding
> > ...
> > > 2. Is there any guide about migrating a Debian Squeeze system
> inside an
> > > encrypted LVM partition from one hard disk to another hard disk?
> >
> > One thing that jumps to mind: given that the old disk uses LVM too,
> you
> > could transition the LV's from the old disk to the new one by using
> LVM
> > tools.
> >
> > I don't recall the exact commands, but I suppose it's along the
> lines of
> > "convert the LV to a mirror (with one PV on the small disk and one
> PV on
> > the new one), then tell LVM to retire the old disk's PV's."
>
> No need for that. Vgmove then remove the old PV from the VG before
> disconnecting it.
>
> >
> > HTH. I'm not sure how this interacts with the boot parts of the
> > equation or with encrypted partitions.
--
Jara Cimrman - one of the unsung geniuses of the world - scientist, engineer,
inventor and literary critic.
My own blog is at http://www.zak.co.il/tddpirate/
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html
More information about the Linux-il
mailing list