1

Is it possible to reincarnate an existing ArchLinux installation (+all existing installed software) in another machine?

I have two terminal/kiosk machines, one of them crashed a few days ago. Actually hard drive was screwed up. I might install ArchLinux from scratch then find all other software, then configure and install them.

But is it possible to take an image of working machines current state and move it to another?

marmeladze
  • 111
  • 3
  • 2
    It would be a better use of time to use a configuration management system and write configs in that to build your machines. – EEAA May 01 '17 at 12:15
  • 1
    like this one? - https://github.com/CyberShadow/aconfmgr would you recommend any? – marmeladze May 01 '17 at 12:19
  • 1
    Maybe that would work. I'd be more apt to use one of the larger CM players, though, like ansible, salt, etc. – EEAA May 01 '17 at 12:21
  • 1
    Did you try the `dd` option? https://wiki.archlinux.org/index.php/disk_cloning & https://serverfault.com/a/268908/82440 – deppfx May 02 '17 at 05:28
  • You should restore from backups instead. – Jenny D May 06 '17 at 13:06

1 Answers1

2

I've done such things with rsync several times. First you should boot new machine with Arch Linux ISO and create a partition and format and mount it to /mnt. Then

rsync -aAXxv root@SOURCEMACHINE:/ /mnt

It excludes all mounted partitions on SOURCEMACHINE except /. You should rsync them if you have any. like:

rsync -aAXxv root@SOURCEMACHINE:/var /mnt/var

After that regenerate fstab and initramfs and install grub:

arch-chroot /mnt
grub-install --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
mkinitcpio -p linux
sparse
  • 71
  • 3