Score:1

Problem with LVM

eg flag

So I recently subscribed to a VPS that has 2 x 2TB drives. I installed Ubuntu 20.04 and then I followed this guide (in french) to try to consolidate the space as 4TB (or a bit less ofc) but I am now getting an error.

This is the output of my vgdisplay -v command:

  WARNING: Couldn't find device with uuid A6wuiG-M85U-7RT2-GF2w-TYoi-kIOu-53ofCY.
  WARNING: VG mystorage is missing PV A6wuiG-M85U-7RT2-GF2w-TYoi-kIOu-53ofCY (last written to /dev/sda4).
  --- Volume group ---
  VG Name               mystorage
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                1
  VG Size               <3.59 TiB
  PE Size               4.00 MiB
  Total PE              940679
  Alloc PE / Size       940679 / <3.59 TiB
  Free  PE / Size       0 / 0   
  VG UUID               ImvQ22-0OPa-psI3-Y80o-UknX-86Zj-Ta3S3a
   
  --- Logical volume ---
  LV Path                /dev/mystorage/mylv
  LV Name                mylv
  VG Name                mystorage
  LV UUID                xnMVfF-elmu-WoLg-3Dfy-DQiI-hdD2-ftM13f
  LV Write Access        read/write
  LV Creation host, time ns385746, 2022-03-02 01:47:37 +0000
  LV Status              NOT available
  LV Size                <3.59 TiB
  Current LE             940679
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Physical volumes ---
  PV Name               [unknown]     
  PV UUID               A6wuiG-M85U-7RT2-GF2w-TYoi-kIOu-53ofCY
  PV Status             allocatable
  Total PE / Free PE    463747 / 0
   
  PV Name               /dev/sdb     
  PV UUID               11ENzP-bTbI-rx22-3zCY-KGAo-qT7h-Z9z78t
  PV Status             allocatable
  Total PE / Free PE    476932 / 0

And the output from pvdisplay

  WARNING: Couldn't find device with uuid A6wuiG-M85U-7RT2-GF2w-TYoi-kIOu-53ofCY.
  WARNING: VG mystorage is missing PV A6wuiG-M85U-7RT2-GF2w-TYoi-kIOu-53ofCY (last written to /dev/sda4).
  --- Physical volume ---
  PV Name               [unknown]
  VG Name               mystorage
  PV Size               <1.77 TiB / not usable <4.09 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              463747
  Free PE               0
  Allocated PE          463747
  PV UUID               A6wuiG-M85U-7RT2-GF2w-TYoi-kIOu-53ofCY
   
  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               mystorage
  PV Size               <1.82 TiB / not usable <1.09 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              476932
  Free PE               0
  Allocated PE          476932
  PV UUID               11ENzP-bTbI-rx22-3zCY-KGAo-qT7h-Z9z78t

Upon doing lvmdiskscan -l

  WARNING: only considering LVM devices
  /dev/sdb   [      <1.82 TiB] LVM physical volume
  1 LVM physical volume whole disk
  0 LVM physical volumes

I'm really new to this. How can I use my 2 x 2TB drive as 1 x 4TB ? Detailed replies are appreciated.

Edit: After running

pvcreate -vvv .... 

I noticed:

  Opened /dev/sda4 RO O_DIRECT
  /dev/sda4: size is 2 sectors
  Closed /dev/sda4
  /dev/sda4: Skipping: Too small to hold a PV
  filter caching bad /dev/sda4

So I ran

sudo cat /proc/partitions

And sda4 is showing as 1 block ?

major minor  #blocks  name

   7        0      63396 loop0
   7        1      63376 loop1
   7        2      68856 loop2
   7        3      69552 loop3
   7        4      44632 loop4
   8        0 1953514584 sda
   8        1    1048576 sda1
   8        2     524288 sda2
   8        3   52428800 sda3
   8        4          1 sda4
   8       16 1953514584 sdb
cocomac avatar
cn flag
This might not be an option... but why not get 1 4TB hard drive instead of 2x 2TB drives?
eg flag
It's not an option with that provider.
David avatar
cn flag
Have you asked the provider if their hardware and or configuration even allows this?
PonJar avatar
in flag
If you add up the 4 sda partitions you don’t get anywhere near the total number of blocks on the sda device. Therefore you probably have a lot of unallocated space on that device. Assuming this is the case you need to delete sda4 and make a new partition that uses all the unused space. Then setup your LVM from there, using the new partition
eg flag
@David yes I did. It allows it.
eg flag
@Ponjar exactly, that's because "sda4" was being shown as 1 block (which was my question).
PonJar avatar
in flag
I understand your question. It shows the sda device is the size you’d expect but the sda4 partition is tiny. There is missing space. So we have to find the missing space. It’s probably unallocated but you haven’t provided anything to confirm that. If there is any unallocated space delete sda4 and recreate it to using all the unallocated space. Then add it to your LVM group.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.