First - will this even work?
It depends. Here I will discuss the issues with cloning a system partition (mountpoint /
) to a new disk.
BIOS to BIOS
If your old computer has an old legacy BIOS and MBR you will want your new NUC to boot in the legacy mode. You will also want to initialize the internal disk in the NUC with MBR and not GPT.
In these systems part of grub is written inside the MBR. When you clone the /
partition to the new disk, the MBR is not copied as it is not part of that partition. You will have to re-install grub in the new disk using a live USB. Otherwise the NUC won't boot.
UEFI to UEFI
If your old computer has UEFI and GPT, you will want to have the same in your NUC and initialize the internal disk in the NUC with GPT.
In these systems part of grub is written in a special partition called EFI System Partition (ESP). You will need to clone the ESP and the /
partitions to the new disk. Just cloning the /
partition will not work.
BIOS to UEFI
If your old computer has BIOS and the NUC's UEFI does not have a Legacy/CSM boot setting then cloning the /
won't work. It is possible to convert from BIOS/MBR setup to UEFI/GPT setup, but it is complicated and I won't recommend it.
It will be easier to freshly install Ubuntu in the NUC.
A Note on UUIDs and /etc/fstab
Partitions are identified by UUIDs for mounting in the file /etc/fstab
in Ubuntu. If the cloning process changes the UUID of the cloned partition then you will have to edit /etc/fstab
to reflect that change.
Many tutorials ask you to change the UUID while (or after) cloning a partition. This is because you shouldn't have two partitions (in different disks) with the same UUID in the same computer. You may not want to change the UUIDs in the new disk if you never (I mean never) reboot your old computer with both the new and the old disks connected.
Home partition or folder?
Is it better to put /home
back in the default location on /
or to
make a second partition on the same drive with /
and put it there?
The answer to this is purely opinion based. If you are happy with the current setup, you may have a separate partition for /home
. I don't see why you can't clone the existing /home
partition from the second disk of the old computer to the new disk of the NUC after cloning the /
and possibly the ESP partitions.
Since the partitions are identified by their respective UUIDs, it does not matter if the /home
partition is in the same physical disk or in a different physical disk. As long as the UUIDs in the partitions match their references in the /etc/fstab
Ubuntu should find the /home
in the separate partition and boot properly.
On the other hand if you want to keep /home
in the default location inside the /
partition, that is fine too.
Disclaimer
Many years ago I went through the same process of moving the OS and /home
partition from my old desktop to a NUC. In my case, it was "BIOS to UEFI" and my attempts to cloning the /home
partition failed. I ended up Installing Ubuntu and using rsync
to copy the contents of the /home
partition from the old disk to the new disk.
I have not tried the "BIOS to BIOS" and the "UEFI to UEFI" cloning. So, I may have missed something and they may not work as described above.
Hope this helps