Press enter for maintenance (or type control-d to continue)

I am using windows 10 and configured Ubuntu on virtual machine using Hyper-V for making a shared file server within our small office. I have assigned 2048Mb RAM to Ubuntu file server. I am facing a problem, whenever the physical computer shuts down accidentally (Due to electricity issue) and restarts, the file server is not accessible. When I open the Hyper-V, Ubuntu gives the message in last line

Welcome to emergency mode! After logging in, type "journalct1 -xb" to view
Press enter for maintenance (or press Control-D to continue"

The only problem is that I have to manually RDP the server and click manually the CtrlD to continue otherwise it keeps there and server files are not accessible.

I am not very good in Linux and just first time I am using it with the help of video tutorials. Kindly help me out to get rid of this situation so in any case when the physical computer restarts, the VM starts completely itself. Thanks.


Solution 1:

Probably your file-system is corrupted. Try this:

First identify your partition.

Run the command:

umount -t /dev/your-partition

Then:

fsck -y /dev/your-partition

For example, my Linux / directory is at sda3, but my /home directory is at sda5, so when something like this happens to me, I do the following:

  • Press enter for command line;

  • Type:

umount -t /dev/sda3

  • Hit enter;

umount -t /dev/sda5

*****DO NOT USE: umount -a*****

  • Hit enter;

  • Then:

fsck -y /dev/sda3

  • Hit enter;

fsck -y /dev/sda5

  • Hit enter;

If you don't know which partition to choose, type umount -t /dev/sd and hit tab twice for you to see its available partitions.