[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Clone root partition

T wrote:
I'm trying to compile a comprehensive document on cloning root partitions.
My immediate goal is to clone my current working Linux to external USB HD,
so that I can use it wherever I go.

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 there are so many things have been left out. By
comprehensive, I mean I want to know all relevant things that need to be

For example for dd, let alone its rigid limitation, if you use it, at least
the 'conv=sync,noerror bs=4k' options should be used: sync,noerror just
means continue and zero fill any error blocks, bs=4k just writes 4k at a
time which will speed things up a lot. For cp, at least 'cp -ax' should be

But there are still much more to it.
First, directories that don't need to copy over, like /tmp, /proc. With
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)?

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

Anything else? Like the concerns of /etc/fstab...

Last, with all the above concerns, how to achieve them with various tools?

Keywords: tar rsync find cpio dd


PS. If you come across this message late, be it a week or even a month
late, please do comment, I hope this thread can be a one stop place for
people looking for concerns over cloning root partitions.

Pcopy works well. See http://newbiedoc.berlios.de/wiki/Cloning_a_hard_disc


Reply to: