I reduced the number of USB HDDs connected to my Raspberry Pi running at home by one, but forgot to mess with fstab.
In a situation where you cannot log in with SSH! I usually operate it headless, but when I hurriedly connect the display and see the error, it seems that it is in emergency mode. Even if I connect the keyboard and press a key, the same error message goes around, and even if I connect the display and the keyboard, I can not recover.
Pull out the micro SD of the unbootable Raspberry Pi and connect it to another Raspberry Pi via a USB card reader. Then, mount it in an appropriate directory and change the fstab of the Raspberry Pi that became unbootable as follows.
Before changing fstab
/dev/sdb1 /mnt/hoge ext4 defaults 0 0
After changing fstab
/dev/sdb1 /mnt/hoge ext4 defaults,nofail 0 0
Now when I plug the micro SD into the original machine and restart it, it revives, ignoring the mounting error. When I looked at what happened later with fdisk -l, the drive that was previously connected to / dev / sdb1 was moved to / dev / sda1.
Apparently, if the drive listed in fstab is not found or there is an error, Linux will simply give up booting and go into emergency mode? (It may differ depending on the distribution, but since it is a quick survey from the starting point, please let me know if you have any details.)
** On Linux, add the nofail option when mounting with fstab the kind of disks that will be mounted and removed. ** **
Perhaps even for virtual machines on the cloud, if you write the setting to mount the virtual VHD in fstab, remove it by the management operation on the cloud side, and accidentally reboot the OS, I feel that the same situation will occur.
Recommended Posts