I did a fresh installation of Fedora 20 in the free space of my hard drive after failing to upgrade from the older version. Everything seems to be working fine until I deleted the partition containing the older version to free up some space. Upon restarting the computer, I got the following message after waiting for a long time:

Warning: Could not boot

Warning: /dev/fedora_old/swap does not exist

Starting Dracut Emergency Shell

I am still able to boot if I type exit on dracut prompt. But, that does not solve the root of the problem. There are a few suggestions on the web proposing:

dracut --force --regenerate-all

I am not sure what it does exactly and it doesn't seem to resolve the problem. What is the proper way to sort out the swap partition? It seems that the swap for the older OS was being used when the new OS is being installed despite it having its own swap partition.

And how could I avoid such a problem in the future?

This is what I have for /etc/fstab:

/dev/mapper/fedora_new-root00 /          ext4    defaults                   1 1
UUID=somehexdec               /boot      ext4    defaults                   1 2
UUID=someotherhexdec          /boot/efi  vfat    umask=0077,shortname=winnt 0 0
/dev/mapper/fedora_new-home00 /home      ext4    defaults                   1 2
/dev/mapper/fedora_new-swap   swap       swap    defaults                   0 0
  • did you edit your /etc/fstab?
    – user55518
    Jan 29 '14 at 3:17
  • @bersch, no, I didn't edit that. Jan 29 '14 at 3:57

To make this permanent, you'll want to update /etc/default/grub to point to the correct swap partition.

Example: Change this:

GRUB_CMDLINE_LINUX="rd.lvm.lv=rootVG/root rd.lvm.lv=oldnameVG/swapLV rhgb quiet"

To this:

GRUB_CMDLINE_LINUX="rd.lvm.lv=rootVG/root rd.lvm.lv=rootVG/swapLV rhgb quiet"

When that is completed, you 'll want to regenerate the grub config:

grub2-mkconfig -o /boot/grub2/grub.cfg

You can verify that it worked by looking at /boot/grub2/grub.cfg and verifying that swap is now pointed at the correct VG/LV

  • Is running grub2-mkconfig mandatory and/or required? Feb 16 '17 at 2:57

It seems that manually editing out the parameter containing rd.lvm.lv=fedora_old/swap in the grub configuration file does the trick. There is no need to run dracut or reinstall grub at all.

# vi /boot/efi/EFI/fedora/grub.cfg

Search for the following line under the menu entry which you will be booting from:

linuxefi /vmlinuz-3.12.x-xxx.fc20.x86_64 root=/dev/mapper/fedora_new-root00 ro rd.lvm.lv=fedora_old/swap rd.lvm.lv=fedora_new/swap vconsole.font=....

To make sure the above changes stick, do the same for /etc/default/grub:

GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora_old/swap rd.lvm.lv=fedora_new/swap vconsole.font=...

Please provide an answer or leave a comment if this method is wrong.

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.