How can I resize the root partition in archlinux?

6,047

It is possible. The easiest way would probably still be to copy the filesystem to external disk or similar, rebuild the partition table as desired (while preserving uuids, labels and similar things to keep things like your fstab functioning) and copy the files back.

Assuming that's not possible/convenient, there are partitioning tools capable of growing, shrinking and moving partitions without disturbing their contents. For example there's gparted which is capable of doing exactly that on ext4 (see https://gparted.org/features.php). If you'll choose this tool, you'll need to use the offline version. That means creating live cd or usb stick with the tool, booting into it and using it while the target filesystem is not in use.

Share:
6,047
Jorge Romeu
Author by

Jorge Romeu

Updated on September 18, 2022

Comments

  • Jorge Romeu
    Jorge Romeu over 1 year

    I recently installed archlinux on my laptop with the following configuration:

    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 
    nvme0n1     259:0    0   477G  0 disk
    ├─nvme0n1p1 259:1    0   512M  0 part
    ├─nvme0n1p2 259:2    0    10G  0 part /
    └─nvme0n1p3 259:3    0 466.4G  0 part /home
    

    I chose 10Gb for the root partition which turned out to be too small, I am wondering if there is any good way to shrink the nvme0n1p3 (home) partition and then expand the nvme0n1p2 (root) partition into the new free space. Both partitions are currently formatted as ext4 filesystems.

    Thanks in advance :)

    • Sysadmin
      Sysadmin almost 4 years
      show me results of commands: pvs, vgs, lvs.