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

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

Amos Shapira amos.shapira at gmail.com
Mon Feb 20 09:07:37 IST 2012


On 20 February 2012 07:06, Tzafrir Cohen <tzafrir at cohens.org.il> wrote:

> 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.
>

s/make/may/, I guess.

You'll HAVE to, especially /boot, before chroot'ing do:

# for i in proc dev sys boot; do mount -o bind /$i /chroot/$i; done

--Amos

-- 
 [image: View my profile on LinkedIn]
<http://www.linkedin.com/in/gliderflyer>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20120220/d8692366/attachment.html>


More information about the Linux-il mailing list