I have to clone a suse 12.2 system (installed with grub2-efi) to other PCs. They only have slightly different hardware.
With newest acronis for linux and clonezilla i did not even get a system that tries to boot. I used at least five guides to repair grub/efi afterwards that did not help.
So I tried a more radical approach:
I reinstalled suse 12.2 with same partitions and bootloader (grub2-efi) settings on the target machine.
When reinstalling I told the installer to use devicenames instead of by-id to be better portable. (I verified that the device names of the reinstalled system exactly match the order on the template system)
I booted the reinstalled system to be sure everything works fine (worked perfectly)
then I booted with a rescue system and mounted /dev/sda3
then wrote back the files of the root partition of the template PC to /dev/sda3 while omitting /etc/fstab, /boot and /etc/sysconfig/boot* .
The system now boots but systemd lands into emergency mode failing all services with result ‘dependency’
You can’t omit those files they are not automatically recreated.
In your case I think i’d install fresh using labels for each partition. This should make it cloneable. The fstab file and the rest then will be set by label and that will be constant across just about any clone situation. Down side is that you need to be sure that any labels are unique and you are in charge of the process not some automated service.
In the installer go to expert mode and label partitions
Thanks gogalthorp for the label hint! I will do this for future clones. Will it work to adjust the template or do I really have to fresh reinstall a new template? I’m asking because it was a lot of work to create the template system.
Nevertheless it should work with the devicenames in this particular situation as they stayed constant between template and the new installed system.
When I say I omitted fstab and /boot I meant not that they are missing now, I meant that I kept these files from the new installed system and did not overwrite these with the backup from the template. Do you think it would have worked, if I had the label thing on the template too and also overwrite those files on the new system?
Arvidjaar you are right with the patches, though I have not checked whether there was an update of the package containing the kernel. I did not online-update the new system after installing, because I thought I do this install anyway just because to have the grub2-efi installed and the partitions created (in particular the vfat /dev/sda1 that is later mounted to /boot/efi). When I later overwrite almost anything on / partition with the files from the template (omitting boot and fstab) the modules, libraries and kernel will anyway all be from the template and fit together? Or have I missed something here?
When reading my own post I just realized that the kernel is in /boot, so of course it matters if there are old version files in it. Thanks for the hint with the wrong kernel. I will check that first thing on monday.
I think I will also do a fresh install with labels as you are probably right that not everything may be updated. Thanks.