[SOLVED] Stuck on loop at boot after changing swap size F27

Ok, so I am running Fedora 27 on my XPS 13 and I wanted to enable hibernation. So I changed the swap size from 8GB to 17GB, and disabled secure boot. I thought I was doing everything right until I booted up and greeted me with:

You are in emergency mode. After logging in type “journalctl -xb

on and on

cannot open access to console, the root account is locked. See sulogin(8) man page for more details.
Press Enter to continue.

What works now:

  • After many hours I got grub2 to initialize
    ** I could boot into kernels 4.15 or 4.14
  • I am able to boot off a live Fedora 27 USB and chroot into my root with /boot and /boot/efi both mounted properly

I don’t know what is going on here and I would like to boot normally.

On a side note, I don’t know if this is related to the matter, but on the live USB, my root partition (LVM) showed as using ~67GB. This is noteworthy because I just resized it to 97GB from 50GB. I think that this may mean that I have put my 17GB of swap in the root partition instead of in the swap LVM.

Thanks for any help.

Edit: The problem is solved! I still would like help hibernating if anyone knows how to.

Does CTRL-ALT-F1 to F4 get you a terminal to log in ?

If it’s booting to emergency mode it doesn’t look like it’s even getting to a loaded system.

@dblitt99 you say you now got grub2 to initialise, do you now have a system you can login to?

If you do, we can move from there. If not, we will need to use your live USB system to get more info.

Grub will load, but any kernel I select leads me to the emergency mode screen.

Changing the run level to 3 leads me to emergency mode as well.

Sounds like your UUIDs have changed.

You can run ls -l /dev/disk/by-uuid/ to print off the UUID of the disks.
Check the UUIDs against /etc/fstab

Like in the chroot?

1 Like

yep

Get some more info, boot your live USB and mount and chroot your system. (replace sda with the correct one for your system, you can check with lsblk)

mkdir /mnt/fedora
mount /dev/mapper/fedora-root /mnt/fedora
mount /dev/mapper/fedora-home /mnt/fedora/home

mount /dev/sda2 /mnt/fedora/boot
mount /dev/sda1 /mnt/fedora/boot/efi

cd /mnt/fedora
mount -o bind /dev dev
mount -o bind /proc proc
mount -o bind /sys sys

chroot /mnt/fedora

We can then get system info that you can link here, run: fpsate --sysinfo

grab the contends of your fstab: cat /etc/fstab | fpaste

Mounting my home lvm says:

mount: /mnt/fedora27/home: wrong fs type, bad option, bad superblock on /dev/mapper/fedora-home, missing codepage or helper program, or other error.

What was the full command you ran?

What does the following commands return

lsblk -o NAME,SIZE,FSTYPE

lvdisplay

I ran mount /dev/fedora/home /mnt/fedora27/home

https://paste.fedoraproject.org/paste/MXZDNPxl7zxk-fgmwwA36w

your mount should (likely) be from /dev/mapper

if you run ls -l /dev/mapper you should see listed the partitions you got back from lsblk, e.g. the fedora-home, fedora-root, fedora-swap

doing /dev/mapper/fedora-home or /dev/fedora/home doesn’t matter they both fail

mounting root worked though?

yes it did

Your home partition is all screwed up then. You can try fixing it.

fsck.ext4 -yfv /dev/mapper/fedora-home 

-yfv, y will assume ‘yes’ to fixing errors without manual intervention, f will force the check, v is verbose

just to note the partition sizes line up with what you said you made them

└─nvme0n1p8     365.2G LVM2_member
  ├─fedora-root    90G ext4
  ├─fedora-home 257.4G ext4
  └─fedora-swap  17.9G swap

90g for root, 17 for swap. where did you take the space from?

edit: home i assume?

Yes, but I had only about 150G used on home

https://paste.fedoraproject.org/paste/ZJ9irovGDK1jvkZojNzOEg

OK. the problem is almost certainly that then.
You reduced the LVM partition size of fedora-home but you didnt reduce the ext4 file system to fit (i presume). So the file system thinks its using up 400gb (for example) when the partition size is now 300gb (for example).

when you resized the partition --resizefs should also be passed.

You can try the following to attempt to resize the file system to fit the partition size

resize2fs /dev/mapper/fedora-home

Its worth noting, this may not work, your meant to resize the file-system then the partition.

If it doesn’t work, you may have to increase the size of the home partition to its origonal size then reduce it again passing the --resizefs option. (im guessing, as ive not done this, and it may have been overwritten with the increase in your other partitions (which also need the -resizefs option to actually increase the filesystem size)

e.g.

lvreduce --resizefs --size SIZE /dev/mapper/fedora-home