Score:1

Stuck in initramfs after logical volume resize volume group not found

us flag

Hoping someone can help me recover my ubuntu server instance. Ran out of space on a VM and decided to extend the virtual disk.

lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
  Size of logical volume ubuntu-vg/ubuntu-lv changed from 37.00 GiB (9472 extents) to <74.00 GiB (18943 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.

This I noticed worked but only to 75GB so realised I still needed to increase the partiiton size which I did like below:

sudo growpart /dev/xvda 3
CHANGED: partition=3 start=2101248 old: size=155183104 end=157284352 new: size=417329119 end=419430367

I then thought I could go back and run the original command again as lsblk returned below which looked good to me:

lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0                       7:0    0 55.5M  1 loop /snap/core18/2246
loop1                       7:1    0 55.5M  1 loop /snap/core18/2253
loop2                       7:2    0 61.9M  1 loop /snap/core20/1242
loop3                       7:3    0 61.9M  1 loop /snap/core20/1270
loop4                       7:4    0 67.2M  1 loop /snap/lxd/21803
loop5                       7:5    0 67.2M  1 loop /snap/lxd/21835
loop6                       7:6    0 42.2M  1 loop /snap/snapd/14066
loop7                       7:7    0 43.3M  1 loop /snap/snapd/14295
sr0                        11:0    1 1024M  0 rom
xvda                      202:0    0  200G  0 disk
├─xvda1                   202:1    0    1M  0 part
├─xvda2                   202:2    0    1G  0 part /boot
└─xvda3                   202:3    0  199G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0   74G  0 lvm  /
xvdb                      202:16   0  5.4T  0 disk
└─xvdb1                   202:17   0  5.4T  0 part /mnt/media

So executed lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv again however ran into this error:

user@server:~$ sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
  Volume group "ubuntu-vg" not found
  Cannot process volume group ubuntu-vg

I gave up in the end as all was working and I had increased my space to get by enough for a while but thought I would come back later...I didn't before a reboot and now i'm stuck in initramfs getting errors like this on boot similar to the ones I had experienced when tryning to extend the volume:

Volume group "ubuntu-vg" not found
Cannot process volume group ubuntu-vg
...
    ALERT!  /dev/mapper/ubuntu--vg-ubuntu--lv does not exist. Dropping to a shell!

Other notes

Looking back over what I did i'm worried this may have been an issue:

sudo fdisk -u /dev/mapper/ubuntu--vg-ubuntu--lv

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The old ext4 signature will be removed by a write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xaae0d62a.

Command (m for help): p
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 73.102 GiB, 79452700672 bytes, 155181056 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xaae0d62a

Command (m for help): w
The partition table has been altered.
Syncing disks.

Just kind of thought that warning above meant something needed updated so just haphazardly did that to both that disk and the one below:

sudo fdisk /dev/xvda3

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The old LVM2_member signature will be removed by a write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfc8b2324.

Command (m for help): p
Disk /dev/xvda3: 73.102 GiB, 79453749248 bytes, 155183104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfc8b2324

Command (m for help): w
The partition table has been altered.
Syncing disks.

And here I am stuck in this initramfs shell hoping someone can help men fix this without rebuilding the whole thing... I may have missed some issues and bits but tried to explain as well as i possibly can what may have gone wrong just hoping it may be something simple to undo?

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.