Cannot find root or swap o

I have been searching all day but have not found a solution for this.

My laptops power cord got chewed up by my dog and while I was waiting for a new one to arrive I had to access some files from my laptop drive.

I removed the drive and plugged it into my desktop, however since I was also running Fedora on the Desktop I had to run a series of commands to mount the appropriate drive and access the desired files. I do not recall the specific sequence of commands and one of them was mklabel

Upon receiving the new power cable and booting my laptop I now get

Warning: /dev/fedora/root does not exist 
Warning /dev/fedora/swap does not exist 
Warning : /dev/mapper/fedora-root does not exist

How do I fix this issue? I have tried booting a live disk and running
dracut --regenerate-all -f && grub2-mkconfig -o /boot/grub2/grub.cfg

but it has not helped.

Any advice would be greatly appreciated!!

1 Like

Check the output:

sudo vgs; sudo pvs; sudo lvs; lsblk -o +FSTYPE,UUID

OK - what am I looking for with regard to this?

The one thing that jumps out at me is that the swap partition has FSTYPE of swsuspend

[liveuser@localhost-live ~]$ sudo lvm lvscan

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

  ACTIVE            '/dev/fedora_laptop/swap' [5.87 GiB] inherit
  ACTIVE            '/dev/fedora_laptop/home' [<420.07 GiB] inherit
  ACTIVE            '/dev/fedora_laptop/root' [50.00 GiB] inherit
[liveuser@localhost-live ~]$ sudo vgs
  VG            #PV #LV #SN Attr   VSize    VFree
  fedora_laptop   1   3   0 wz--n- <475.94g    0 
[liveuser@localhost-live ~]$ sudo pvs
  PV         VG            Fmt  Attr PSize    PFree
  /dev/sda2  fedora_laptop lvm2 a--  <475.94g    0 
[liveuser@localhost-live ~]$ sudo lvs
  LV   VG            Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home fedora_laptop -wi-a----- <420.07g                                                    
  root fedora_laptop -wi-a-----   50.00g                                                    
  swap fedora_laptop -wi-a-----    5.87g                                                    
[liveuser@localhost-live ~]$ lsblk -o +FSTYPE,UUID
NAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT          FSTYPE      UUID
loop0                    7:0    0   1.7G  1 loop                     squashfs    
loop1                    7:1    0   7.5G  1 loop                     ext4        85f7fe5c-e901-4eda-b778-07e5c56483b7
├─live-rw              253:3    0   7.5G  0 dm   /                   ext4        85f7fe5c-e901-4eda-b778-07e5c56483b7
└─live-base            253:4    0   7.5G  1 dm                       ext4        85f7fe5c-e901-4eda-b778-07e5c56483b7
loop2                    7:2    0    32G  0 loop                                 
└─live-rw              253:3    0   7.5G  0 dm   /                   ext4        85f7fe5c-e901-4eda-b778-07e5c56483b7
sda                      8:0    0   477G  0 disk                                 
├─sda1                   8:1    0     1G  0 part                     ext4        24004c64-662a-49bb-a645-fda240ccddaf
└─sda2                   8:2    0   476G  0 part                     LVM2_member e8HSZy-FtvS-q8i0-X7DP-WZdL-TODT-bj85b9
  ├─fedora_laptop-swap 253:0    0   5.9G  0 lvm                      swsuspend   35e14236-b401-49d2-8b0b-75871a45657c
  ├─fedora_laptop-home 253:1    0 420.1G  0 lvm                      ext4        6def53ef-997d-4221-b4d3-87cc0a27f43e
  └─fedora_laptop-root 253:2    0    50G  0 lvm                      ext4        7c4a2147-1be1-47be-9534-7b6008777b20
sdb                      8:16   0 111.8G  0 disk                                 
├─sdb1                   8:17   0 111.2G  0 part                     ntfs        EE224D47224D15CD
└─sdb2                   8:18   0   608M  0 part                     ntfs        7C74B23574B1F1CE
sdc                      8:32   1  14.9G  0 disk                     iso9660     2020-04-22-22-45-14-00
├─sdc1                   8:33   1   1.9G  0 part /run/initramfs/live iso9660     2020-04-22-22-45-14-00
├─sdc2                   8:34   1    11M  0 part                     vfat        8F25-49FF
└─sdc3                   8:35   1  22.9M  0 part                     hfsplus     3747a42d-bc17-3725-8f02-97b49d502769
1 Like

It looks like your VG name is not fedora, but fedora_laptop.
Rename the VG with vgrename, or use the correct name.

Note that if you decide to rename the VG, you should update /etc/default/grub and /etc/fstab accordingly, and then run under chroot:

sudo grub2-mkconfig -o /etc/grub2$(test -d /sys/firmware/efi && echo -efi).cfg
sudo dracut -f --regenerate-all
3 Likes

Thank you so much - renaming the volume group worked perfectly

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.