2

LVM

Hey. First of all I want to say excuse me for my bad English. I a problem after installing CentOS 7 with LVM. Some space lost after problem with LVM configuration.

I tried to add some logical volume and to map it to folder /vdi. It had some error and I skipped, to do it after installation.

Now I have Logical Volume without LV Path and I have no idea what to do with it. The computer has 2 same disks, 250 GB.

PVDisplay :


 --- Physical volume ---

  PV Name               /dev/sda2
  VG Name               centos
  PV Size               136.48 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              34939
  Free PE               0
  Allocated PE          34939
  PV UUID               vsobHT-PuGe-0rvc-yvum-t9nz-LvIm-5dEHP8

  --- Physical volume ---

  PV Name               /dev/sdb1
  VG Name               centos
  PV Size               138.44 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              35439
  Free PE               0
  Allocated PE          35439
  PV UUID               8Wh85T-4JLh-Mx4n-d4u3-xZ9s-H4wn-9rI1OT

VGDisplay


  --- Volume group ---

  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  16
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                7
  Open LV               5
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               274.91 GiB
  PE Size               4.00 MiB
  Total PE              70378
  Alloc PE / Size       70378 / 274.91 GiB
  Free  PE / Size       0 / 0
  VG UUID               NVtlTj-8tx1-0rph-g8VA-TXXH-lFV2-k0zfdO

LVDisplay


  --- Logical volume ---

  LV Name                vdi
  VG Name                centos
  LV UUID                mwPyhU-r32l-J5Mj-EAIY-fLjL-dfXU-1vf1jc
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2015-12-18 19:41:58 +0200
  LV Pool metadata       vdi_tmeta
  LV Pool data           vdi_tdata
  LV Status              available
  # open                 5
  LV Size                251.46 GiB
  Allocated pool data    4.14%
  Allocated metadata     2.43%
  Current LE             64373
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3

df

Filesystem              Type      Size  Used Avail Use% Mounted on
/dev/mapper/centos-root ext4       55G   76M   52G   1% /
devtmpfs                devtmpfs  3.8G     0  3.8G   0% /dev
tmpfs                   tmpfs     3.8G     0  3.8G   0% /dev/shm
tmpfs                   tmpfs     3.8G  8.6M  3.8G   1% /run
tmpfs                   tmpfs     3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/centos-usr  ext4       92G  1.3G   86G   2% /usr
/dev/sda1               ext4      1.9G  147M  1.7G   9% /boot
/dev/mapper/centos-home ext4       92G  4.1G   83G   5% /home
/dev/mapper/centos-var  ext4      9.1G  136M  8.5G   2% /var
tmpfs                   tmpfs     773M     0  773M   0% /run/user/0}

I hope this information gives you an overview of the problem and somebody knows the solution. Thanks in advance.

migrated from serverfault.com Dec 28 '15 at 8:18

This question came from our site for system and network administrators.

  • 1
    Do you mean that you forgot to create a filesystem called /vdi using your volume group "centos"? If so, that is just lvcreate --name vdi --size nG centos n being the size in GB. Then format /dev/mapper/centos-vdi, create a mount point and mount it. After you verify it is good, add to /etc/fstab. – Aaron Dec 22 '15 at 21:12
  • 1
    Perhaps pvs, vgs, and lvs would be more informative in this case to point out what do you consider missing space. – chexum Dec 22 '15 at 21:20
  • Please run fdisk -l and show the output – Alaa Chatti Dec 23 '15 at 9:35
  • Your info does not seem consistent. I see two ~138 GiB disks, sda and sdb, for a total of ~275 GiB on VG "centos", but I also see a LV called vdi with ~250 Gib and a df with ~275 GiB with no mention of the LV vdi. Please provide the output of pvs, vgs, lvs, you will probably find those easier to read. – Law29 Dec 23 '15 at 9:35
  • 1
    Jeka, you were correct to create an Answer with your solution. Please undelete that and remove your answer from this question. You can then accept your answer so we know the problem has been solved. – roaima Dec 29 '15 at 23:16
0

Because you already have your vdi logical partition created (or seems to), you should mount it and give format (I added the steps).

But your information doesn't look consistent and there is something wrong. You cannot have an vdi of 250GB inside a VG (centos) of 270GB and also 4 other more Logical Volumes inside of centos of 55 + 92 + 92 + 9.1 = 248.1GB. Your vdi could be as much as 30GB. But, this should be the theorical steps.

Firstly, give format to it:

sudo mkfs.ext4 /dev/centos/vdi

Then, mount it:

sudo mkdir /mnt/vdi
sudo mount /dev/centos/vdi /mnt/vdi

If you want it permanently after booting, modify /etc/fstab

echo '/dev/centos/vdi /mnt/vdi ext4 defaults 0 0' >> sudo tee -a /etc/fstab

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.