Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking at a strategy for cloning Linux (root) partitions without having to use a Live CD. Literature suggests rightly that the source and target partitions must be umounted to be able to get a clean clone. This assumes that you need to use a LiveCD. I was wondering if instead of requiring a LiveCD, if using a 3rd partition that would emulate the LiveCD functionality, if we can't achieve the same functionality. In other words, at a high level a system with 3 partitions (all bootable):

  • Rescue Partition (LiveCD emulation)
  • Running Partition (Source)
  • Backup Partition (Destination)

All 3 partitions are LVMS.

When it's time to clone the source partition to the backup (destination) partition, we would boot to the rescue partition, unmount the other 2 partitions (is it required?), run disk check on the source, copy to the destination (dd or simple copy to avoid replicating the defragmentation from the source), run disk check on the destination partition, update Grub menu list to force boot from either partition, and reboot into that partition.

My question, is it an approach that you'd recommend? MBR in all this? Any gotchas or extra checks required?

Thanks,

  • D.

PS. On recommendation from members, posting here instead of stackoverflow.com.

share|improve this question
add comment

1 Answer

Yes, you can easily copy a partition safely as long as it's not mounted -- it has nothing to do with being within a Live CD or not. It's very easy. Many Linux distributions (e.g. Ubuntu) will search your harddrives for any other bootable systems and automatically include them in the Grub menu whenever you update the kernel.

Any bootable Linux system will do. It'd be just as easy to install a basic copy of a regular distribution, I think. You can also clone the partitions into files in an existing filesystem - it doesn't need to be partition to partition. There are various tools to help - e.g. partimage.

share|improve this answer
    
Thanks for the reply. Any gotchas with regard to MBR/chainloading? I plan to use Suse for this exercise. –  Djurdjura Aug 28 '12 at 16:32
    
The MBR boot loader should have no trouble booting another bootloader. You have to install the bootloader on the new installation on its root partition. I do this all the time - I have Windows and one or more copies of Linux across different disks, all with their bootloaders on their own partitions. –  teppic Aug 28 '12 at 16:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.