To fix this issue you should run fsck
command on your boot disk.
To do it you can follow steps below:
- stop your VM instance (do not delete it):
gcloud compute instances stop [INSTANCE_NAME]
Before detaching the boot disk from the instance, you must stop the
instance. There is no need to unmount the disk.
- detach the boot disk from your VM instance (usually DISK_NAME is same as INSTANCE_NAME):
gcloud compute instances detach-disk [INSTANCE_NAME] --disk=[DISK_NAME]
- create debug VM instance:
gcloud compute instances create debug-instance
- attach your boot disk as a non-boot disk to the debug-instance, but don't mount it:
gcloud compute instances attach-disk debug-instance --disk [DISK_NAME] --device-name debug-disk
- connect to the debug-instance:
gcloud compute ssh debug-instance
- look up the root partition of the disk, which is identified with the part1 notation with a command
ls -l /dev/disk/by-id
(in this case /dev/sdb1
):
$ ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 Feb 13 14:56 google-debug-disk -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 13 14:56 google-debug-disk-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-debug-disk-part14 -> ../../sdb14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-debug-disk-part15 -> ../../sdb15
lrwxrwxrwx 1 root root 9 Feb 13 14:56 google-persistent-disk-0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 13 14:56 google-persistent-disk-0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-persistent-disk-0-part14 -> ../../sda14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 google-persistent-disk-0-part15 -> ../../sda15
lrwxrwxrwx 1 root root 9 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk-part14 -> ../../sdb14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_debug-disk-part15 -> ../../sdb15
lrwxrwxrwx 1 root root 9 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0-part14 -> ../../sda14
lrwxrwxrwx 1 root root 11 Feb 13 14:56 scsi-0Google_PersistentDisk_persistent-disk-0-part15 -> ../../sda15
- run a file system check on the root partition:
sudo fsck /dev/sdb1
for example:
debug-instance:~$ sudo fsck /dev/sdb1
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
/dev/sdb1: clean, 53782/647168 files, 396250/2588667 blocks
- stop the debug-instance VM instance and detach your boot disk from it:
gcloud compute instances stop debug-instance
gcloud compute instances detach-disk debug-instance --disk [DISK_NAME]
- reattach the boot disk to your VM instance:
gcloud compute instances attach-disk [INSTANCE_NAME] --disk=[DISK_NAME] --boot
- start your VM instance:
gcloud compute instances start [INSTANCE_NAME]
- check boot log of your VM instance via serial port.
- delete debug-instance:
gcloud compute instances delete debug-instance
In addition, have a look a the documentation Detaching and Reattaching Boot Disks and Troubleshooting VM start up.