1

I have a 16GB msata but my rootfs is only 4GB. I need to increase the size of a volume group /dev/mapper/vg-var/ for my embedded system to full capacity.

$ lsblk
NAME           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda              8:0    0 14.9G  0 disk
|-sda1           8:1    0 39.2M  0 part
`-sda2           8:2    0  3.7G  0 part
  |-vg-system1 254:0    0  800M  0 lvm  /
  |-vg-system2 254:1    0  800M  0 lvm
  `-vg-var     254:2    0  2.1G  0 lvm  /var


$ df -Th
Filesystem           Type            Size      Used Available Use% Mounted on
tmpfs                tmpfs         890.7M    104.0K    890.6M   0% /tmp
tmpfs                tmpfs         890.7M    484.0K    890.2M   0% /run
devtmpfs             devtmpfs      888.1M         0    888.1M   0% /dev
/dev/mapper/vg-system1
                     ext3          771.4M    549.6M    181.8M  75% /
tmpfs                tmpfs         890.7M         0    890.7M   0% /dev/shm
/dev/mapper/vg-var   ext3            2.0G      3.5M      1.9G   0% /var


$ sudo vgs
  VG #PV #LV #SN Attr   VSize VFree
  vg   1   3   0 wz--n- 3.68g    0

How should i proceed ? Do i Need to extend /dev/sda2 first with fdisk ?

1 Answer 1

0
  1. Resize the /dev/sda2 partition with fdisk or parted
  2. Resize the PV format on /dev/sda2 with pvresize /dev/sda2
  3. Resize the logical volumes you want to resize with lvresize -L+<size> --resizefs /dev/vg/var (to resize your /var) or lvresize --resizefs -L+<size> /dev/vg/system1 (to resize your /). <size> can be either 100%FREE to use all free space available or something 1G to add 1 GB. So to resize your / to use all available free space you'd use lvresize --resizefs -L+100%FREE /dev/vg/system1

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.