There is a great Live ISO called Boot-Repair-Disk.
It has Gparted and other useful tools precompiled, so you can manage your disks and partitions. The Boot-Repar tool will help you to rebuild the boot record and the /boot. It supports EFI too.
- A. (in case of Physical PC) Make a Boot-Repair Live USB media with
dd in Linux or Rufus in Windows;
- B. (in case of Virtual machine) just attach the Boot-Repair-Disk ISO to your VM;
- boot with Boot-Repair Live USB (or Boot-Repair-Disk ISO for VM); ignore the Boot-Repair tool wizard at this step, you might need it later;
- use Gparted to resize the partitions (and create new ones /home, /var, ...);
- mount your current root partition and the partitions you've created to e.g.:
mkdir /tmp/myroot
mkdir /tmp/mynewhome
mkdir /tmp/mynewYYY
mount /dev/nvme0n1p2 /tmp/myroot
mount /dev/nvme0n1p3 /tmp/mynewhome
mount /dev/nvme0n1pX /tmp/mynewYYY
- use
blkid
to find out the UUIDs of the partitions you've created (/home, /var ...);
- modify the /tmp/myroot/etc/fstab: use the UUIDs from the Step 4 to create the necessary records;
- move the files;
mv /tmp/myroot/home/* /tmp/mynewhome/
mv /tmp/myroot/YYY/* /tmp/mynewYYY/
- reboot and see if your main OS boots properly, your data is accessible, the programs work fine.
If the OS boots properly, but you data is invisible, or programs can't access their databases, make sure that fstab is properly configured and all the new partitions are mounted (start with lsblk
).
If the OS doesn't boot (if you've messed with /boot), start the PC with the Boot-Repair-Disk once again and use Boot-Repair tool wizard (How To) to rebuild /boot (and MBR boot record if necessary).