0

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?

user3126740
  • 121
  • 1
  • 1
  • 8
  • Any way to view or modify files on a GCE instance that can't come up past single user mode, or is it completely hosed even if I can see the serial console prompt? – user3126740 May 21 '14 at 00:30

1 Answers1

2

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.

CharlesB
  • 227
  • 1
  • 1
  • That makes sense to me. But the only two shutdown options are 'sudo poweroff' or 'gcutil deleteinstance'. Since I can't ssh in, the only option is the scary looking 'gcutil deleteinstance'. Hmm. But I think this is the answer. Hopefully the persistent disk remains and it's not a hardware issue. – user3126740 May 22 '14 at 06:39
  • The persistent disk will only be deleted if you selected [auto-deletion](https://developers.google.com/compute/docs/disks#attachdiskcreation) when you created the instance. Otherwise, there is a (y/n) prompt to confirm the instance deletion, and a separate (y/n) prompt for persistent disk deletion. – CharlesB May 22 '14 at 18:21
  • Thanks Charles. The root of the issue was a typo in an fstab entry. In my case it was related to /dev/sdbt (the 't' was a typo). Mounting the disk on another instance allowed me to delete the bad entry and the disk booted successfully. – user3126740 May 25 '14 at 20:08