shellgoogle-compute-enginefsck

GCE: Is there access to the maintenance shell?


One of my instances is having trouble with a disk. The serial console teasingly displays the erro and a console prompt:

fsck.ext4: No such file or directory while trying to open /dev/sdbt
Possibly non-existent device?
fsck died with exit status 8
[?25l[?1c7[1G[[31mFAIL[39;49m8[?25h[?0c[31mfailed (code 8).[39;49m
[....] File system check failed. A log is being saved in /var/log/fsck/checkfs if that location is writable. Please repair the file system manually. ...[?25l[?1c7[1G[[31mFAIL[39;49m8[?25h[?0c [31mfailed![39;49m
[....] A maintenance shell will now be started. CONTROL-D will terminate this shell and resume system boot. ...[?25l[?1c7[1G[[33mwarn[39;49m8[?25h[?0c [33m(warning).[39;49m
sulogin: root account is locked, starting shell
root@(none):~# 

Is there any way to make the serial console interactive? It'd be great to look at the fstab file for starters, or even hit ctl-D to kick it along.

Also can anything be done to cleanup the gibberish on the console?


Solution

  • First, you can shutdown the instance but not delete its boot disk. Then you can create a new instance; click on "Show advanced options" during the instance creation, and you will be presented the option to add "ADDITIONAL DISKS (Optional)."

    Attach the disk that needs a fsck as an additional disk. This way the new instance will be booting off of a clean disk, and you can fsck the other disk as normal. Assuming everything can be cleaned up, you can go back to using the original disk as a boot disk again.

    The gibberish is just the ANSI escape sequences used to color the output on a terminal.