1.4 KiB
I want to install a system flake on the same disk as always
Well if the parititions have the same properties like UUID and Label
as specified in the configuration.nix
I want to install a system flake in a different disk
Imagine we order a new disk or just want to prepare one to be compatible with our flake configurations, we need to make sure the disk is ready
Firstly lets say you plug it into the machine and its named /dev/sdc, but it can be named and located anywhere else
Lets prepare the disk but what if i dont want to wipe the entire disk?
Lets make sure we have two partitions, if not create them:
- NIXBOOT (/dev/sdc1, FS; EXT4 UUID:
fdea0ef2-fa72-11ed-8a6f-e39e300c6f30
Label: NIXBOOT) - NIXROOT (/dev/sdc2, FS: FAT32 UUID:
D393-D3D1
Label: NIROOT)
...
What if they already exist but the UUID are not equal?
If the partitions already exist but the UUID is not the same, it can be changed by doing:
- First a fsck check with
e2fsck -f /dev/sdc1
- Then change the uuid with
tune2fs /dev/sdc1 -U fdea0ef2-fa72-11ed-8a6f-e39e300c6f30
Do the same process but for the other partition with its respective UUID
What if i forgot or don't know how disks work?
Well there is a great well paced video to follow here https://www.youtube.com/watch?v=2Z6ouBYfZr8
Also a good reference for changing UUIDs and so on https://linuxconfig.org/how-to-retrieve-and-change-partitions-universally-unique-identifier-uuid-on-linux