How to extend /home partition? Rocky Linux 8.10

I changed my 500GB NVMe to 2TB using rescuezilla.
And now I want to extend the home folder to use all the remaining free space on the NVMe without fresh install.
OS: Rocky Linux 8.10

lsblk -o name,type,fstype,size,mountpoint
NAME        TYPE FSTYPE        SIZE MOUNTPOINT
sda         disk               3.7T 
└─sda1      part ext4          3.7T 
sdb         disk               3.7T 
└─sdb1      part ext4          3.7T 
sdc         disk               3.7T 
├─sdc1      part                16M 
└─sdc2      part ntfs          3.7T 
sdd         disk               1.8T 
└─sdd1      part ext4          1.8T 
nvme0n1     disk               1.9T 
├─nvme0n1p1 part vfat          600M /boot/efi
├─nvme0n1p2 part xfs             1G /boot
└─nvme0n1p3 part LVM2_member 464.2G 
  ├─rl-root lvm  xfs            70G /
  ├─rl-swap lvm  swap         31.5G [SWAP]
  └─rl-home lvm  xfs         362.7G /home

(I don’t know much about commands, just using Rocky to use Davinci Resolve)

This should work:

dnf install cloud-utils-growpart
growpart /dev/nvme0n1 3

and yes there should be a space between the main device and the partition number (in this case nvmeon1p3). You will not be able to resize the earlier partitions on that disk which are allocated to /boot/efi and /boot. Only the last partition can be resized.

After that you may need to use:

pvresize /dev/nvme0n1p3
vgs

check to ensure there is available disk space to the vgs command for the volume group, and then you can use that space to resize your LVM partitions for the rl-root or rl-home partitions. This is done using the lvresize command.

If you want all that space to /home without adding anything to the rl-root partition, then this is how you would do it:

root@kvm:~# lvs
  LV   VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root rl_kvm -wi-ao---- <4.09t                                                    
  swap rl_kvm -wi-ao----  4.00g                                                    

root@kvm:~# lvresize rl_kvm/root -l +100%FREE -r
  New size (1071783 extents) matches existing size (1071783 extents).
  File system xfs found on rl_kvm/root mounted at /.
  Size of logical volume rl_kvm/root unchanged from <4.09 TiB (1071783 extents).
  Extending file system xfs to <4.09 TiB (4495383724032 bytes) on rl_kvm/root...
xfs_growfs /dev/rl_kvm/root
meta-data=/dev/mapper/rl_kvm-root isize=512    agcount=3350, agsize=327616 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=0
data     =                       bsize=4096   blocks=1097505792, imaxpct=25
         =                       sunit=64     swidth=320 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=512   sunit=64 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
xfs_growfs done
  Extended file system xfs on rl_kvm/root.
  Logical volume rl_kvm/root successfully resized.

use the example above to do similar on your system. Mine obviously didn’t resize, because it already had the space allocated. Yours will be done for /home, and not root like in my example.

1 Like

thank you so much for your help.
Do you think I should allocate some space to root?

70Gb is good for root.

I’d think twice before extending /home, unless you have hundreds of users that need home directories. The alternative is to use the free space as “whatever”, e.g. create a /data partition where it’s contents are shared by all users. People get annoyed when /home extends to the end of the disk and ask how to shrink it.

Thank you for your response!
I see, I am the only user using the PC so I guess it’s fine to increase the home folder :thinking:

If it’s a desktop PC, then /home is enough to allocate. Your / partition has 70GB, so I doubt very much you will use all of this anyway, unless you start filling up /var or /opt when installing apps or other things. But for everyday desktop use it’s fine.

The main reason to be 100% sure if you want to allocate it all to /home is because XFS partitions cannot be shrunk. Therefore in the future if you decide you need space somewhere else, then it will be difficult without reinstalling the computer and restoring your data.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.