Unable to boot after "gparting" swap

I can’t figure out, what do I need to do with resume=? I run grub2, but the system still can’t boot with resume= present.

UPD: *resume

UPD2: figured out:
sudo blkid /dev/zram0 and then put the UUID into /etc/default/grub.

resume on zram? The name should be hint enough, that this is a ram only swap device.

You need to use the UUID of a real swap partition.

2 Likes

Just remove it. It is only used when waking up from suspend to disk aka hibernation.

I believe glb is correct in that you need to rebuild your initramfs either with or without the resume=UID of your current new swap. Every time you re-run grubby, I believe it just adds the resume (swap) partition back in to the kernel variables with the older config.

Running from your live mint iso, you could try… Please verify everything before running!
Create folders as needed..

sudo mount /dev/nvme0n1p8 /mnt
sudo mount /dev/nvme0n1p7 /mnt/boot
sudo mount /dev/nvme0n1p1 /mnt/boot/efi
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /sys /mnt/sys
sudo mount -o bind /proc /mnt/proc
sudo mount -o bind /run /mnt/run
sudo mount -o bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars

Either manually modify the files with editor or change the UID in the below commands. Swapping out your UID’s of course.

sed -i "s/$swap_old_uid/$swap_new_uid/g" /mnt/etc/default/grub
sed -i "s/$swap_old_uid/$swap_new_uid/g" /mnt/etc/kernel/cmdline
sed -i "s/$swap_old_uid/$swap_new_uid/g" /mnt/boot/grub2/grub.cfg
# (/boot/grub2/grub.cfg may not be needed but I had some complications cloning to other systems and this resolved it)

Lastly, update grub and your initramfs.

sudo chroot /mnt grubby --update-kernel=ALL
sudo chroot /mnt dracut --regenerate-all --force
sudo chroot /mnt grub2-mkconfig -o /boot/grub2/grub.cfg
sudo chroot /mnt sync
sudo umount /mnt -l

Hope it helps..

Actually, you don’t need to. The file /etc/fstab is not copied to the initrd file system.

The only thing needed is to remove the resume= entry.

This shows there are nothing to remove from the /etc/fstab file and that removing the resume= entry will fix the problem.

I see that that is the case.

$ sudo lsinitrd | grep fstab
-rw-r--r--   1 root     root            0 Nov 27 00:00 etc/fstab.empty
-rwxr-xr-x   1 root     root        62168 Nov 27 00:00 usr/lib/systemd/system-generators/systemd-fstab-generator
lrwxrwxrwx   1 root     root           41 Nov 27 00:00 usr/lib/systemd/systemd-sysroot-fstab-check -> system-generators/systemd-fstab-generator

I’m not sure now if it ever was, but I’ll revise my earlier post so people don’t find it and get confused. Thanks for the clarification.

I clone my main system between two devices and a portable nvme drive before big updates. One has a swap the others don’t. Not one of them has the swap listed in the fstab. If I do not rebuild the initramfs with either “resume=” completley removed from the configs as your suggesting or with the uuid swapped, the system will fail to boot the next time a kernel or grub config is updated somehow placing the old “resume=” back in. Rebuilding the initramfs was the only fix for me. This gives me a 1:1 clone with all kernels booting in one shot and fully update-able making it a permanent fix.