0

On Linux, if I copy the root from linux machine #1 to a fresh install of linux on separate machine #2, will machine #2 contain the exact setup as #1?

Or do I -have- to create images of the drive and use software to duplicate the machine?

  • 1
    This question is too broad to answer definitively. There are cases when it is possible. If you have any of a number of caveats, for example but not inclusive, dm-crypt, lvm, mdraid, or even UUID-identified mounts, the answer is not without adjustments. In very simple cases, yes. You will still most likely need to reinstall your bootloader on the new disk. HTH. – Andrew Domaszek Sep 20 '13 at 17:40
  • @AndrewDomaszek, I think we can say definitely, that you shouldn't need to create images to duplicate the machine. Yes, it may require minor tweaks to the fstab/bootloader config depending on exactly what is going on. – Zoredache Sep 20 '13 at 17:50

1 Answers1

1

Assuming the source system only has a singe filesystem used for root, then copying / from the source to destination should be adequate.

You will need to manually re-setup your bootloader on the target system. Simply replicating the root filesystem will not re install grub/lilo into the MBR.

Depending on how you perform the copy, and what distribution you are using you might need to update the UUID on the entry for the root filesystem in /etc/fstab and other locations. Since creating a new filesystem on the target will generate a new unique ID for the new filesystem.

Zoredache
  • 130,897
  • 41
  • 276
  • 420