0

I am using Opensuse Tumbleweed and set up the root partition as btrfs and home partition as ext4. I used lvm during installation.When installed, the root partition had 40GB and home partition had 25 GB space allocated. Approximately 300GB was not allocated. Now, as I'm running out of space in /home, I resized my Linux LVM partition from 75GB to 187.9GB. I also extended the lvm partition using lvextend -L+20GB /dev/system/home which I thought would add an extra 20GB to my home partition. The output from fdisk -l shows that the partition was resized as follows:

Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: Micron_1100_MTFD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 04174A0E-F3C6-459F-A2AB-93E3BED5D4D7

Device      Start       End   Sectors   Size Type
/dev/sda1  411648 394334207 393922560 187.9G Linux LVM
/dev/sda4    2048    411647    409600   200M BIOS boot

Partition table entries are not in disk order.


Disk /dev/mapper/system-root: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/system-swap: 7.7 GiB, 8246001664 bytes, 16105472 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/system-home: 45 GiB, 48318382080 bytes, 94371840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes/
I/O size (minimum/optimal): 512 bytes / 512 bytes

The df -h output shows that the /home directory remained at the same size as follows:

Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 3.9G     0  3.9G   0% /dev
tmpfs                    3.9G   57M  3.8G   2% /dev/shm
tmpfs                    3.9G  1.7M  3.9G   1% /run
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/system-root   40G   14G   27G  34% /
/dev/mapper/system-root   40G   14G   27G  34% /boot/grub2/i386-pc
/dev/mapper/system-root   40G   14G   27G  34% /.snapshots
/dev/mapper/system-root   40G   14G   27G  34% /boot/grub2/x86_64-efi
/dev/mapper/system-root   40G   14G   27G  34% /srv
/dev/mapper/system-root   40G   14G   27G  34% /var
/dev/mapper/system-root   40G   14G   27G  34% /tmp
/dev/mapper/system-root   40G   14G   27G  34% /usr/local
/dev/mapper/system-root   40G   14G   27G  34% /opt
/dev/mapper/system-home   25G   22G  1.7G  94% /home
tmpfs                    786M   16K  786M   1% /run/user/1000

What steps did I miss while resizing the partition? Why is the changed size not affecting the /home directory?

Thanks

EDIT

As requested, the output of lsblk -f /dev/mapper/system-home:

NAME        FSTYPE LABEL UUID                                 FSAVAIL 

FSUSE% MOUNTPOINT
system-home ext4         9315a4b3-2dde-41ad-8937-20c492304639    1.6G    88% /home

  • Resizing the partition is a necessary step, however you then need to tell the underlying filesystem to use that extra space. The commands to do this depend on what filesystem is on the home partition. Could you edit in the output of lsblk -f /dev/mapper/system-home? – steeling Jan 10 at 11:55
  • @steeling Added lsblk output as requested – Abrar Hossain Jan 10 at 12:04
  • 1
    since /home is ext4, you need to tell filesystem to take new space into account, try resize2fs /dev/mapper/system-home – Archemar Jan 10 at 13:00
1

To extend the filesystem after extend LV you should exec command

resize2fs /dev/mapper/system-home 

Usually this can be done on the fly (w/o need to unmount the filesystem)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.