0

I've seen that /dev/mapper/VGP4--CHK-LVP4--CHK is running out of space. I would like to increase this.

Filesystem                           Size  Used Avail Use% Mounted on
udev                                  32G     0   32G   0% /dev
tmpfs                                6.4G  178M  6.3G   3% /run
/dev/mapper/VGroot-LVroot            100G   11G   89G  11% /
tmpfs                                 32G     0   32G   0% /dev/shm
tmpfs                                5.0M     0  5.0M   0% /run/lock
tmpfs                                 32G     0   32G   0% /sys/fs/cgroup
/dev/mapper/VGP4--meta-LVP4--meta    1.0T  240G  785G  24% /perforce/database
/dev/mapper/VGP4--JNL-LVP4--JNL      200G  2.1G  198G   2% /perforce/journal
/dev/mapper/VGvar-LVvar              150G  5.9G  145G   4% /var
/dev/mapper/VGP4--depot-LVP4--depot  3.9T  2.0T  2.0T  50% /perforce/depot
/dev/mapper/VGP4--CHK-LVP4--CHK      100G   97G  3.8G  97% /perforce/checkpoints
tmpfs                                100K     0  100K   0% /run/lxcfs/controllers
tmpfs                                6.4G     0  6.4G   0% /run/user/0
//ukfs03/p4usersynclog               8.2T  7.5T  784G  91% /mnt/p4usersynclog

I wanted to see if I could extend the VG buy "borrowing" space from the other VG. I ran pvs:

PV         VG         Fmt  Attr PSize    PFree
  /dev/sda1  VGroot     lvm2 a--   100.00g       0
  /dev/sdb1  VGvar      lvm2 a--   150.00g       0
  /dev/sdc1  VGP4-depot lvm2 a--     2.00t       0
  /dev/sdd1  VGP4-depot lvm2 a--     2.00t  102.39g
  /dev/sde1  VGP4-CHK   lvm2 a--    50.00g       0
  /dev/sdf1  VGP4-meta  lvm2 a--  1024.00g       0
  /dev/sdg1  VGP4-JNL   lvm2 a--   200.00g       0
  /dev/sdh1  VGswap     lvm2 a--    65.00g       0
  /dev/sdi1  VGP4-CHK   lvm2 a--    51.00g 1020.00m

How do I take the 100GB from /dev/sdd1 VGP4-depot to increase my other VG which is at 97% and running out of space?

 --- Logical volume ---
  LV Path                /dev/VGroot/LVroot
  LV Name                LVroot
  VG Name                VGroot
  LV UUID                P3gps4-MRZl-026G-v2ww-TWIj-0QdQ-0jRPBH
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:54:08 +0000
  LV Status              available
  # open                 1
  LV Size                100.00 GiB
  Current LE             25599
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/VGP4-depot/LVP4-depot
  LV Name                LVP4-depot
  VG Name                VGP4-depot
  LV UUID                elm7rT-CFgn-6N5i-igpb-fnzt-Ph4E-61tzxQ
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:55:27 +0000
  LV Status              available
  # open                 1
  LV Size                3.90 TiB
  Current LE             1022362
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

  --- Logical volume ---
  LV Path                /dev/VGvar/LVvar
  LV Name                LVvar
  VG Name                VGvar
  LV UUID                6RPFfR-M8yT-qTi5-V0pZ-hr8w-PyXQ-1jm0wf
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:54:44 +0000
  LV Status              available
  # open                 1
  LV Size                150.00 GiB
  Current LE             38399
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:5

 --- Logical volume ---
  LV Path                /dev/VGP4-meta/LVP4-meta
  LV Name                LVP4-meta
  VG Name                VGP4-meta
  LV UUID                qHvesl-P4qB-TzII-ofVc-7VIx-SdSF-3gf7BN
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:57:51 +0000
  LV Status              available
  # open                 1
  LV Size                1024.00 GiB
  Current LE             262143
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:3

  --- Logical volume ---
  LV Path                /dev/VGswap/LVswap
  LV Name                LVswap
  VG Name                VGswap
  LV UUID                CoQy7M-EgAu-2FL0-7Aw2-2g0S-ifey-72rogX
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:59:24 +0000
  LV Status              available
  # open                 2
  LV Size                65.00 GiB
  Current LE             16639
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Logical volume ---
  LV Path                /dev/VGP4-JNL/LVP4-JNL
  LV Name                LVP4-JNL
  VG Name                VGP4-JNL
  LV UUID                H6ijtQ-PuGa-FH9V-yCuW-uQyD-7DMD-TfleRU
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:58:39 +0000
  LV Status              available
  # open                 1
  LV Size                200.00 GiB
  Current LE             51199
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:6

--- Logical volume ---
  LV Path                /dev/VGP4-CHK/LVP4-CHK
  LV Name                LVP4-CHK
  VG Name                VGP4-CHK
  LV UUID                K2920y-BifO-AwFJ-zLLa-YyIX-ao8h-1RlPai
  LV Write Access        read/write
  LV Creation host, time negan, 2016-11-14 10:56:59 +0000
  LV Status              available
  # open                 1
  LV Size                100.00 GiB
  Current LE             25599
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:4

Also, is this the correct thing to do when VGs are running out of storage - should I take from other VGs?

  • Your terminology is confused. "LVM" refers to the entire scheme. – Ignacio Vazquez-Abrams Nov 8 '17 at 10:54
  • Also, why does the system have so many VGs? – Ignacio Vazquez-Abrams Nov 8 '17 at 10:56
  • I'm new to LVM's and its terminology. I do not know why they're so many VGs. – Marc Nov 8 '17 at 10:57
  • This is a production server used for perforce. It's a VM and I was given the warning about storage space through VMware. – Marc Nov 8 '17 at 11:32
  • Please post your lvs output – Jaroslav Kucera Nov 8 '17 at 14:23
2

How do I take the 100GB from /dev/sdd1 VGP4-depot to increase my other VG which is at 97% and running out of space?

Well... the problem is that a PV/partition can only be owned by a single VG. So you can't actually take a fragment of a PV (ex. 100GB from /dev/sdd1) and dedicate it to another another VG (ex. VGP4-CHK). In other words, VGs own their PEs entirely.

Fundamentally, to increase the storage of an LV (ex. VGP4--CHK-LVP4--CHK) you need to:

  1. Allocate the space necessary in the LV's VG.
  2. Extend the LV to encompass the additional space.
  3. Resize the filesystem on the LV, so it may take advantage of the additional space.

Here's the general process, but first a warning:

Study the man pages for the commands shown above and ensure you understand how they work, before doing this on a production server. Practice on another system, if possible. Cause you don't want to be that guy who screwed up the server.

  1. Move all the LVs out of the PV you want to use with: pvmove /dev/sdd1. Since /dev/sdc1 is the other PV in the same VG, it must have enough space to hold everything that's in /dev/sdd1.
  2. At this point, you can actually break up /dev/sdd1 be deleting the partition and creating two in it's place. But for simplicity's sake, I'll assume you'll dedicate the entire PV. To add PV /dev/sdd1 to VGP4-CHK, run vgextend VGP4-CHK /dev/sdd1.
  3. Finally, resize LVP4--CHK and it's filesystem with lvextend -r -L +100G VGP4-CHK/LVP4--CHK

Alternative steps

You can also replace steps 1 and 2 with: vgsplit VGP4-depot VGP4-CHK /dev/sdd1.

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.