0

so some time ago I decided to make a clean set up of my Ubuntu (16.04 LTS) installtion using LVM. I have one Volume Group (ubuntu-vg), containing two Logical Volumes, root and swap. root consists of three partitions split on three physical Volumes. Now I would like to remove two of the drives (477 GB each), but unfortunately it seems like LVM isn't able to move the physical data stored on them anywhere else. df tells me though, that there is physical space left on them:

# df -h
 Filesystem                   Size  Used Avail Use% Mounted on
 udev                         9,8G     0  9,8G   0% /dev
 tmpfs                        2,0G   26M  2,0G   2% /run
 /dev/mapper/ubuntu--vg-root  1,2T  102G 1003G  10% /

on the other hand pvs tells me, that there isn't any space left on any of the drives:

# pvs -o+pv_used
  PV         VG        Fmt  Attr PSize   PFree Used   
  /dev/sda5  ubuntu-vg lvm2 a--  238,00g    0  238,00g
  /dev/sdc1  ubuntu-vg lvm2 a--  476,94g    0  476,94g
  /dev/sdd1  ubuntu-vg lvm2 a--  476,94g    0  476,94g

Which is quite odd in my opinion. I had the Ubuntu installation do the setup for LVM and later on added /dev/sdc and /dev/sdd to the logical volume. But now I can't seem to remove them safely.

Even using the GUI Version of LVM (system-config-lvm) didn't help solve the problem, it only tells me that there aren't enough extents available to move the data somewhere else.

# pvmove /dev/sdc1 /dev/sdd1
  No free extents on physical volume "/dev/sdd1".
  No specified PVs have space available.

Has anybody experienced this before? Thank you in advance.

0

Yes I am having this experience right now. I think it has something to do with lvm Pools. I think the pool needs to be shrunk. Apparently this is not a common problem. I am working with Xen.

Oh Im supposed to give an answer here. Shnap. Scholars say there is no way to shrink a... what ever. So, we cant shrink whatevers with whatever. So to solve the whatever, we must give it a negative charge by tazing it with electrons.

Basically, create a very large VG and delete it to create space. My problem in particular came because I installed too much software into a single VG and ran out of 'free space'.

Now that you have this large empty VG, you will notice that it is not taking up the space you designated and therefore you must create a huge faux-file.

Some people recommend using a command called fallocate. They say that is your best option for speed and accuracy. Fallocate, unlike other faux-file creators, actually allocates space.

But fallocate didnt work for me.

The next option is dd if=/dev/rand of=/notporn.img bs=4k iflag=fullblock,count_bytes count=2000G

If you use if=/dev/zero then you run the chance of the machine compressing the 2 terabyte file into 2 megabytes... or less.

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.