Tag Archives: fstab

Fixing Ubuntu VFS: Can’t find ext4 filesystem error on reboot

TL;DR: When you mount drives in your /etc/fstab, don’t use the drive designations (/dev/sda, /dev/sdb, etc.) because they can change upon reboot. You should label the drives instead and use those labels in /etc/fstab.

List your drives:

fdisk --list | more

Give each drive you need to mount a label using tune2fs. For example:

tune2fs -L EXAMPLE_LABEL /dev/sdb

Change /etc/fstab to use the labels. From:

/dev/sdb  /my_disk ext4 defaults 0 0

To:

LABEL=EXAMPLE_LABEL /my_disk ext4 defaults 0 0

Reboot.

OK, now to the blah, blah, blah part:

Today I learned that the drives can get detected in a different order on each reboot, so the designations (/dev/sdb, /dev/sdc, etc.) could change. I’m not sure how I’ve worked with Linux all these years and not clued into that, but here we are.

I have a desktop system running Pop!_OS 20.10, which is based on Ubuntu 20.10. My system has three internal drives and one external USB. Along with root (/), one internal drive is mounted as /data, and the other as /reference. Yes, they are both one big partition each.

A few weeks ago when I updated the system from 20.04 to 20.10 and rebooted, I was hosed. The system said it couldn’t find the ext4 file system. After a lot of googling, casting about, and fixing things that were a problem without being the problem, I noticed that the mounts for the internal drives were all screwed up. My /data drive was there, but it contained the contents of /reference. The /reference drive was gone. Fortunately I still had my root drive.

Looking at /etc/fstab and comparing it to the output from fdisk –list, it was all screwed up. Somehow the mount points were pointing to the wrong devices. I fixed them, rebooted, and I was on my way. Turns out I didn’t really fix it, I just got lucky on that reboot.

Today I had several workspaces going and performance started to get weird. I figured I’d just stop where I was and reboot.

…and got the same issue again. Couldn’t find the ext4 file system. The contents of /etc/fstab looked wrong compared to fdisk –list again. I wondered why fstab kept getting reverted or something, I fixed it, rebooted, and… got the error again!

Looking at the fdisk –list output again, I noticed that the disks has moved around. What was /dev/sdc on last boot was now /dev/sdd. The prior /dev/sdb was now /dev/sdc. That’s when I learned that this was apparently a thing, and I should be using the disk UUID or a label in /etc/fstab.

I figured labeling would be easier. I looked at the output from fdisk –list again and figured out which device was the data drive and which was reference. I then labeled them:

tune2fs -L DATA_DISK /dev/sdd
tune2fs -L REF_DISK /dev/sdc

I then changed /etc/fstab to use the labels:

LABEL=DATA_DISK /reference ext4 defaults 0 0
LABEL=REF_DISK /reference ext4 defaults 0 0

Rebooted, and I’m back!