Page 1 of 1

[SOLVED] Volume group not found on boot after rename

PostPosted: May 14th, '24, 18:24
by nickdegraeve
Ok, I messed up my system by renaming my main LVM volume group and logical volumes. When I boot I get
Volume group "fedora" not found.
Cannot process volume group fedora


How did I get here?
When I got my new pc I installed Fedora ( :oops: ) and I created a volume group and 3 logical volumes with the default values.
I think my layout was like this:
- Volume group: fedora
    - Logical volume: 00 (=swap)
    - Logical volume: 01 (= /, BTRFS)
    - Logical volume: 02 (= /home, BTRFS)
I have a EXT4 /boot partition outside the LVM, and some Windows partitions.
I didn't like Fedora after all and I installed Mageia 9, keeping the disk layout, only formatting the Linux partitions.
After several months of being very happy with Mageia I wanted to rename the VG and LVs to something more logical.
I used the LVM tooling to rename the VG to "linux" and the LVs to "swap", "root" and "home" respectively, thus ending up with
    - /dev/linux/swap
    - /dev/linux/root
    - /dev/linux/home
I edited /etc/fstab and /boot/grub2.cfg to reflect the changes and, in MCC I went through the Boot wizard that I thought would update/regenerate everything necessary.

Alas, it was not meant to be.
After a reboot I was greeted with the stated error. After some time I got dropped to the dracut prompt, as you can see in the attached screenshot.
Also attached is the report generated by dracut.

So, how can I can get out of this mess?

Re: Volume group not found on boot after rename

PostPosted: May 14th, '24, 19:04
by doktor5000
nickdegraeve wrote:I used the LVM tooling to rename the VG to "linux" and the LVs to "swap", "root" and "home" respectively, thus ending up with

That means what commands in particular, and in what order? And did you do that from the booted Mageia system ?
In the end you would have at least needed to run
Code: Select all
dracut -f --regenerate-all
as root to update all initrds.

Currently you'd need at at least any running system, e.g. boot from DVD then chroot to your Mageia box
Then the output as root of
Code: Select all
pvs
lvs
vgs


----
edit doktor5000: Sorry didn't notice the rdsosreport, that already contains the information. The VG seems to have been renamed to "linux"
Maybe it's already sufficient if you boot from DVD then chroot to your Mageia box. Then afterwards:

Code: Select all
pvscan --cache -aay

Then the output from the above commands.

Re: Volume group not found on boot after rename

PostPosted: May 14th, '24, 21:19
by nickdegraeve
Ok, I couldn't get the Live iso to run, I always got a kernel panic, even with editing the boot params as per the Errata.
But the Rescue Mode works.
I don't know how to use chroot, though. So you'll have guide me some more, I'm afraid.

I did try the "Mount your partitions under /mnt" option:
20240514_203901.jpg
Mounting
20240514_203901.jpg (254.33 KiB) Viewed 8557 times

And then I ran your command, from the rescue console:
20240514_204257.jpg
Rescue console
20240514_204257.jpg (177.03 KiB) Viewed 8557 times

Re: Volume group not found on boot after rename

PostPosted: May 15th, '24, 11:01
by morgano
For answers to your questions: not my cup of tea so i leave it to others... but meanwhile:

nickdegraeve wrote:Ok, I couldn't get the Live iso to run

What is the symptom?
Maybe Live boots if your system drive is not attached, then attach it later?

But the Rescue Mode works.

The rescue mode on your installed system or on Live?

Re: Volume group not found on boot after rename

PostPosted: May 15th, '24, 11:44
by nickdegraeve
morgano wrote:
nickdegraeve wrote:Ok, I couldn't get the Live iso to run

What is the symptom?
Maybe Live boots if your system drive is not attached, then attach it later?

I get a kernel panic each and everytime, even when I edit the boot params or use the non-free NVIDIA version as suggested by the Errata.
The system just freezes and I have to power off/on the pc.
20240514_193408.jpg
Kernel panic
20240514_193408.jpg (372.33 KiB) Viewed 8507 times

morgano wrote:
But the Rescue Mode works.

The rescue mode on your installed system or on Live?

That of the normal install image or the network install. The Live one doesn't seem to have a rescue mode.

Re: Volume group not found on boot after rename

PostPosted: May 15th, '24, 15:26
by morgano
The SQUASHFS error is probably as it say: data probably corrupt. (The system on Live)
You should verify the Live ISO image you used to create the stick.
If ISO file is OK but still problem booting the USB stick, then the stick, connector or other part is probably bad, so try another stick and/or port.

One way to repair it instead of download the whole again is to start downloading as bittorrent, stop it, replace the partly downloaded file with the full but damaged you have, and restart the download, it will then check, and replace only parts.

Re: Volume group not found on boot after rename

PostPosted: May 15th, '24, 17:02
by doktor5000
nickdegraeve wrote:But the Rescue Mode works.
I don't know how to use chroot, though. So you'll have guide me some more, I'm afraid.

I did try the "Mount your partitions under /mnt" option:

That looks fine, you got your filesystems mounted it seems. You only need to mount some pseudo-filesystems from the "outside" system for the chroot to work.

Code: Select all
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev

After that you can chroot into the system mounted unter /mnt
Code: Select all
chroot /mnt

Then do as I suggested previously. Although the system is working at that point it might be sufficient if you simply regenerate all initrds via dracut.
Then logout from the chroot and unmount everything under /mnt
Code: Select all
umount /mnt/{proc,sys,dev}
umount /mnt

and reboot

Re: Volume group not found on boot after rename

PostPosted: May 16th, '24, 15:46
by nickdegraeve
Ok, not there but
1. the Live distribution works. It was a corrupt download.
2. I haven't got my system back yet. It still drops down to dracut.
I must be doing something wrong, that's why I created a typescript of what I've done. I also included an updated rdsosreport from the latest boot attempt.

Re: Volume group not found on boot after rename

PostPosted: May 16th, '24, 17:27
by doktor5000
The typescript is fine, although the outputs mentioned previously from pvs/lvs/vgs would still be required from the installed system.

Re: Volume group not found on boot after rename

PostPosted: May 16th, '24, 19:22
by nickdegraeve
Ok, here they are:
Code: Select all
  pvscan[2425] PV /dev/nvme0n1p5 online, VG linux is complete.
  pvscan[2425] VG linux run autoactivation.
  3 logical volume(s) in volume group "linux" now active

Code: Select all
  VG    #PV #LV #SN Attr   VSize   VFree
  linux   1   3   0 wz--n- 728.64g    0

Code: Select all
  PV             VG    Fmt  Attr PSize   PFree
  /dev/nvme0n1p5 linux lvm2 a--  728.64g    0

Code: Select all
  LV   VG    Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home linux -wi-ao---- 565.84g                                                   
  root linux -wi-ao---- 150.00g                                                   
  swap linux -wi-a-----  12.80g                                                   

Re: Volume group not found on boot after rename

PostPosted: May 17th, '24, 00:54
by doktor5000
That looks about right. Can you post your /etc/fstab from the rescue system in the chroot ?
By default the fstab entries contain the VG name, which you also need to change. Afterwards run
Code: Select all
dracut -f --regenerate-all
again, that should do it.

Re: Volume group not found on boot after rename

PostPosted: May 17th, '24, 06:44
by nickdegraeve
I did edit /etc/fstab from the start so I thought this was ok:
Code: Select all
/dev/linux/root / btrfs noatime 1 1
# Entry for /dev/nvme0n1p6 :
UUID=92b3bed2-587e-45cd-b726-b0eb638b96b4 /boot ext4 defaults 1 2
# Entry for /dev/nvme0n1p1 :
UUID=12C2-B179 /boot/EFI vfat iocharset=utf8,umask=000 0 0
/dev/linux/home /home btrfs noatime 1 2
# Entry for /dev/nvme0n1p3 :
UUID=383EC3B83EC36E06 /media/windows ntfs-3g defaults,nofail,umask=000 0 0
192.168.1.2:/volume1/backups /mnt/ds/backups nfs _netdev,nosuid,wsize=8192,rsize=8192,soft,vers=4.0 0 0
192.168.1.2:/volume1/homes /mnt/ds/homes nfs _netdev,rsize=8192,nosuid,wsize=8192,soft,vers=4.0 0 0
192.168.1.2:/volume1/music /mnt/ds/music nfs _netdev,nosuid,wsize=8192,rsize=8192,soft,vers=4.0 0 0
192.168.1.2:/volume1/photo /mnt/ds/photo nfs _netdev,rsize=8192,nosuid,wsize=8192,soft,vers=4.0 0 0
192.168.1.2:/volume1/public /mnt/ds/public nfs _netdev,nosuid,rsize=8192,wsize=8192,soft,vers=4.0 0 0
192.168.1.2:/volume1/scans /mnt/ds/scans nfs _netdev,nosuid,wsize=8192,rsize=8192,soft,vers=4.0 0 0
192.168.1.2:/volume1/video /mnt/ds/video nfs _netdev,rsize=8192,nosuid,wsize=8192,soft,vers=4.0 0 0
none /proc proc defaults 0 0
/dev/linux/swap swap swap defaults 0 0

But obviously I must be missing something...

Re: Volume group not found on boot after rename

PostPosted: May 17th, '24, 15:34
by doktor5000
That looks fine for the VG.

Can you show your /boot/grub2/grub.cfg and /etc/dracut.conf.d/51-mageia-resume.conf from the installed system ?
Also from the installed system run the following and post the output here, although you manually need to mount /dev/nvme0n1p6 to /mnt/boot before you run chroot as you have a separate /boot partition
Code: Select all
lsinitrd /boot/initrd.img --unpack etc/cmdline.d/*
cat etc/cmdline.d/90lvm.conf
cat etc/cmdline.d/95root-dev.conf

Re: Volume group not found on boot after rename

PostPosted: May 17th, '24, 18:19
by nickdegraeve
ah, finally. Success!

51-mageia-resume.conf contained
Code: Select all
add_device+=" /dev/fedora/00 "

After I changed it to
Code: Select all
add_device+=" /dev/linux/root "

and ran
Code: Select all
dracut -f --regenerate-all

again, rebooted and tadaa!

Thanks for your patience.

Re: [SOLVED] Volume group not found on boot after rename

PostPosted: May 17th, '24, 18:56
by morgano
Good work both of you :)

Re: Volume group not found on boot after rename

PostPosted: May 17th, '24, 19:00
by doktor5000
nickdegraeve wrote:ah, finally. Success!

51-mageia-resume.conf contained
Code: Select all
add_device+=" /dev/fedora/00 "



Yeah, that always contains the swap device by default.

Re: [SOLVED] Volume group not found on boot after rename

PostPosted: May 17th, '24, 19:34
by nickdegraeve
doktor5000 wrote:Yeah, that always contains the swap device by default.

Then I made a mistake: I have put my root there. I'd forgotten "00" used to be "swap".
Fixed it already, though. And I didn't try to hibernate yet, so everything should be okay.