@khokha SInce your home directory is a LVM , you can extend the /home using "lvextend" command.
lvextend -L +2G /dev/mapper/rhel-home -r
-r specifies that the filesystem on the logical volume should be resized after the logical volume has been extended.
Refer man lvextend : https://man7.org/linux/man-pages/man8/lvextend.8.html
I think the VG has no space : check with "vgs" command and if no space is there then you need to add space in the VG and then do the lvextend.
To add space to VG you need to create a partition --> then make it PV and then extend the VG using vgextend.
Once the VG has enough space then you can extend the LV.
Hello @khokha !
Thanks for reaching out !
Please share the output of fstab file and df -hT and lsblk command.
@khokha SInce your home directory is a LVM , you can extend the /home using "lvextend" command.
lvextend -L +2G /dev/mapper/rhel-home -r
-r specifies that the filesystem on the logical volume should be resized after the logical volume has been extended.
Refer man lvextend : https://man7.org/linux/man-pages/man8/lvextend.8.html
Thanks for your reply,
I tried lvresize -r -L +2G but gives error and i tried +1G too
i've another machine with the following output:
lsblk
df -hT
/etc/fstab
can i resize the /home directory the same way?
Thanks
@khokha !
Here in this case you dont have a separate /home mounted as LVM so you need to do differently :
1. Take a backup of the /home
2. Create a new partition of sufficient size as a LVM with formatted filesystem.
3. Temporarily mount this new disk to a new mount point eg. /mnt
4. rsync the contents from /home to this new mount point
5. verify the data
6. remove the contents from /home manually
7. mount the new disk to /home permanently using fstab.
having the /home separately as lvm or a separate partition is useful.
Otherwise one can use parted or gparted to create/ resize partitions.
For the first machine i tried the command I tried lvresize -r -L +2G but gives error and i tried +1G too
I think the VG has no space : check with "vgs" command and if no space is there then you need to add space in the VG and then do the lvextend.
To add space to VG you need to create a partition --> then make it PV and then extend the VG using vgextend.
Once the VG has enough space then you can extend the LV.
Thanks @Chetan_Tiwary_
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.