I have dual booted windows and rocky linux. /dev/nvme0n1p3 is the windows partition and /dev/nvme0n1p5 is the rocky linux partition. How do I shrink some of the space in rocky and add it to windows ? Please explain in simple terms.
If it’s an xfs logical volume, it might no be possible, you can get a more concise view by using
lsblk -o NAME,MAJ:MIN,FSTYPE,SIZE,LABEL,TYPE,MOUNTPOINT
That partition has LVM “physical volume” (PV). Rocky installation creates that by default and places three LVM logical volumes (LV) into it: for /, /home, and swap.
It is also default to put XFS filesystem on the / and /home LVs, just like image shows for the /boot volume.
It is not possible to shrink an existing XFS volume. One would have to make a backup dump of data, remove the LV, create smaller LV with filesystem, and finally restore content from backup.
Since there are (probably) three LV on the PV, one could remove some of them, ensure that the remaining LV are in the beginning of the PV, and then shrink the PV and partition. However, while that makes a block of the drive free, that bloack is between nvme0n1p5 and nvme0n1p6 – does not allow extension of the nvme0n1p3 partition.
The “simplest” procedure is probably:
- make a backup of everything
- remove partitions nvme0n1p4 and nvme0n1p5
- increase size of nvme0n1p3
- reinstall Rocky to the remaining space
- restore data for Rocky from backup
As others have mentioned, make sure your data is backed up to either the cloud or an external disk.
Please provide output of the following commands:
- lsblk
- pvs
- vgs
For reference, I used this guide for resizing my partitions. Your process is somewhat reverse and you need to do Steps 3->2->1. Before you do anything though, please send the output of those commands.
