Boot from m.2
Jump to navigation
Jump to search
disk imagesTo boot from M.2. requires some changes. transfer boot image to m.2. which can be done by restoring the boot image directly
# dd if=bootimg of=/dev/nvme0 bs=10M status=progress
However, this does not allow you to easily change the partition tables, and thus.. use fdisk to create the partition table, and mount it up as you want eg.
Create the following partitions / 100G /boot 1G /var 100G /home 100G swap 16G using fdisk. format each partition using mkfs.ext4 for non-swap partitions format each swap partition using mkswap mount up the structure in the way you want. # mkdir -p /mnt/sysimage/ /mnt/sysimage/boot /mnt/sysimage/var /mnt/sysimage/home mount partitions under /mnt/sysimage mount disk image - using losetup # mkdir -p /mnt/sys1/ /mnt/sys1/boot mount partitions under /mnt/sys1 Transfer files. # (cd /mnt/sys1; tar cvf - * ) | (cd /mnt/sysimage ; tar xf -)
having transferred all of the data to the new drive we need to reset the partitions to mount them, this involved setting the uuid on the devices, and mount them using uuid.