Hello All , On todays senario we will cover how to recover an fstab issue.
As you all probably faced that common issue that adding a new mount /line to fstab and forgot to check mount -a and once you boot your VM it is not coming up.
At On -premise it’s easy when you have access to the console / VMware / Hyper-V . you may use Single mode or any Live CD to recover fast.
First make sure you have entered once after every VM creation to the serial console and created a root password.
Recovery console required root password.
Until March 2018 on Azure Linux VM’s if you faced that issue [fstab] then you had to create a New VM as a rescue VM deleted you OS / or Clone that Os Disk mount it the the rescue VM make the proper changes and rebuild / switch with the healthy Os Disk.
Serial console is a great option for fast recovery. it allows you to reach your VM via serial port that means you can reach your VM even if your Network is down to repair \fix any boot \network\firewall\file system issues.
I have a Centos 7.5 where i have added an fake mount to a VM that doesn’t exist.
this prevents my VM to boot unless i have used some fstab parameters to ignore that mount.
View from Azure Portal
and I have reboot the VM for this scenario to cause an fstab issue.
below from the Azure portal Serial console blade we can see that the VM is not able to complete the boot and dropped to emergency mode!
You will need another VM for recovery.
Delete the VM facing the issue From the Portal.[this won’t delete the disks]
wait around 5-10 minutes then navigate to another VM in the same region & using the same disk type [manged disk or STD or Premium] then attach the disk to that VM mount edit ad detach
Log in the rescue VM mount the new HDD
use dmesg | tail to see the new Disk and fdisk -l .
after you have mouted and fixed your fstab please unmout all partisions and then navigate to azure Portal and remove that disk by press Edit
Use the Disk Blade to create a New VM using existing Disk
Feel free to raise a ticket to our wonderfully Azure support Support and an engineer will be happy to assist mitigate the issue.
Thank you ,