Re: Clone root partition



On Sat, 30 Dec 2006 20:26:00 +0000, Timothy Murphy staggered into the
Black Sun and said:
* Tong * wrote:
I'm trying to compile a comprehensive document on cloning root
partitions. My immediate goal is to clone my current working Linux
to [an] external USB HD, so that I can use it wherever I go.

This requires an x86 that can boot from USB devices in a sane and
reproducible manner. Not every x86 machine can do this, but it's more
common than it used to be.

By comprehensive I mean it should not be as simple minded as
dd if=/dev/hda2 of=/dev/sda2
cp -a / /mnt/point
tar -p -m cf - / | (cd /mnt/point; tar xf - )

I know they work, but so many things have been left out. By
comprehensive, I mean I want to know all relevant things that need to
be considered.

cp -a all directories that aren't /proc, /sys, or /dev (if using
udev/devfs), edit /etc/fstab to reflect new position of drive, reinstall
bootloader. 3 steps--which one are you having trouble with?

For example for dd

dd is not a backup method. Forget it.

modern Linux that uses udev, the /dev and /sys don't need to be
copied either. Anything else (besides distro specifics like
/var/cache/apt/archives)?

Copy the directories that contain actual data. This excludes /proc,
/sys, /dev if you're using udev/devfs, and any removable media and
network filesystems under /mnt or /media .

the clone partition should be made bootable, by grub or lilo.

No, really? Are you having trouble with this step? Explain the trouble
you're having. I'd say it's a better idea to use GRUB here, since
booting from things that aren't IDE can cause weird rearrangements in
BIOS boot order depending on the x86 you're using. (Boot from IDE
CD-R*, SATA disk is (hd2). Boot from SATA disk, SATA disk is (hd0).
BTDT.) GRUB gives you a shell you can use to try to recover. LILO
doesn't.

I'm not an expert in this area, but I would have thought it was
advisable not to clone / while it is mounted

Why not? If you're super-paranoid, take it down to single-user and
remount / ro, but if the machine's a single-user orkstation, there
should be no problem.

--
Love is a laser.
DO NOT LOOK INTO LASER WITH REMAINING HEART.
--Tori and Greg Andrews
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.



Relevant Pages

  • Re: Can I clone a SCSI disk to an SATA disk?
    ... >> If your cloning utility recognises the SATA disk and if your ... >> machine can boot from a SATA diisk then you should have ... when using it on a SATA disk. ...
    (microsoft.public.win2000.hardware)
  • Re: Trouble copying partition in Windows XP
    ... my primary boot partition to a much larger hard drive. ... Using the Disk Clone tool I get a perfect copy except for ... When I boot on the cloned drive, ... remove the "parent" before the FIRST bootup of the clone. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Cloning your entire source drive
    ... I used ATI to make the clone to a SATA ... just boot up the clone *w/o the other internal boot drive connected* ... connectivity), it simply does not matter whether or not that initial boot ... made to the destination HDD with the source HDD disconnected. ...
    (microsoft.public.windowsxp.general)
  • Re: Trouble copying partition in Windows XP
    ... original drive/system and make the clone. ... >> before the first boot up of the clone. ... Is the parent system the hardware the ... If the clone will not be the only partition ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: help me understand boot.ini
    ... I previously did a clone with Ghost, ... You have to understand the boot process. ... the Primary partition that has its "active" flag set. ... you boot the clone OS for the FIRST TIME, hide the "parent" OS ...
    (microsoft.public.windowsxp.general)