[SOLVED] Booting into Emergency Mode CentOS 7

Issues related to applications and software problems
Post Reply
dona paula
Posts: 5
Joined: 2019/05/30 14:22:53

[SOLVED] Booting into Emergency Mode CentOS 7

Post by dona paula » 2019/05/30 14:37:45

Dear Friends,

Centos Newbie here and requesting your help on the following:

Due to a sudden power outage, my Centos 7 laptop shutdown and is now booting into emergency mode. I have the root password. All important files are on the desktop of user "Dona" and I wish to back up of these files. However I am unable to see the desktop folder in the directory at /home/Dona/Desktop after using root password.

All I need are few files on the desktop of user "Dona". After that I want to reformat the system and load the centos again.

Please help. Thank you

Dona Paula

User avatar
TrevorH
Forum Moderator
Posts: 30168
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Booting into Emergency Mode CentOS 7

Post by TrevorH » 2019/05/30 15:04:53

I would start by just booting the install DVD in rescue mode which is an option off the initial "Troubleshooting" menu you see when you first boot from the install media. From there, try running the xfs_repair command against your filesystems. Rescue mode asks you if you want to mount your system partitions and in order to run xfs_repair they mist not be mounted so say no.

If that fixes your problem then you won't need to reinstall. If it does not then you can boot in rescue mode again and this time have it mount your filesystems and copy the data off to a USB stick or to somewhere on the network.

Also, if you use Shift-PgUp you should be able to scroll up the console output from the emergency mode and see the actual error that it got that made it drop to emergency mode. For example, a trivialway to get it go into emergency mode is to list a filesystem in /etc/fstab that either doesn't exist or has problems being mounted. Just that will cause the system to not boot. And very easily fixable by commenting the offending line in fstab.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

dona paula
Posts: 5
Joined: 2019/05/30 14:22:53

Re: Booting into Emergency Mode CentOS 7

Post by dona paula » 2019/05/31 08:21:59

Hi Trevor,

As suggested by you, I booted the system via a USB with the ISO image. From there I chose
Troubleshooting > Rescue a Centos System > Continue
Now all I see is a bunch of lines (made of "=" symbols) scrolling on the screen for the past 1 hour now

FYI, After choosing the "Rescue a Centos System", I was given 4 options
1. Continue
2. Read-only mount
3. Go to Shell
4. Reboot

I chose option 1. After that I see these continues lines.
Should I let this go on ?
All I need are a few files on the desktop as stated earlier.

Any help is highly appreciated.

Dona Paula

User avatar
TrevorH
Forum Moderator
Posts: 30168
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Booting into Emergency Mode CentOS 7

Post by TrevorH » 2019/05/31 13:39:41

You took the wrong option from the menu. When asked you should be choosing 3) Go to shell. That opens a root command prompt and let's you repair your system. No idea what option 1) does, never tried it but it's the wrong option.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

dona paula
Posts: 5
Joined: 2019/05/30 14:22:53

Re: Booting into Emergency Mode CentOS 7

Post by dona paula » 2019/05/31 15:42:03

Hi Trevor

Perhaps I did take a wrong turn. Having read your initial reply and not finding the exact options in the latest centos, I searched for blogs with the said options and found this link

https://subscription.packtpub.com/book/ ... escue-mode

However the system did not respond as expected and I did not get a sub menu after choosing option 1 as stated in the above link.

I was of the opinion that rescue mode > continue will lead me to the right option. Anyway I kept the system running for now overnight. It still showing the lines scrolling. Hope I will see something tomorrow morning.

If there is anything I can do to salvage whatever is possible, Please advise.

Dona paula

User avatar
TrevorH
Forum Moderator
Posts: 30168
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Booting into Emergency Mode CentOS 7

Post by TrevorH » 2019/05/31 19:20:15

Once more: you do not want option 1. It is the wrong thing. Pick option 3.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

dona paula
Posts: 5
Joined: 2019/05/30 14:22:53

Re: Booting into Emergency Mode CentOS 7

Post by dona paula » 2019/06/01 05:54:04

Hi Trevor,

Thank you for your guidance and patience thus far. I was able to get to the root prompt with in the rescue mode and use the xfs_repair command with the following results. I have 2 partitions namely /dev/sdb1 and /dev/sdb2. Both were unmounted at the time of running the xfs command. The sdb2 is the LVM.

1. The sdb1 passed thru all the phases and was ok
2. However when I can the repair command on the sdb2, it did not go beyond phase 1, it could not find the primary superblock, so it searched for a while and found a secondary superblock but could not confirm/validate the same.
3. Now the search continues and all I see are linear dots in a line formation on the screen. Sometimes in between I get the following message
" Found candidate secondary superblock, Unable to verify superblock, continuing"

I found the following in some blog elsewhere

XFS has both primary and secondary superblocks. xfs_repair uses information in the primary superblock to automatically find and validate the primary superblock against the secondary superblocks before proceeding. Should the primary be too corrupted to be useful in locating the secondary superblocks, the program scans the filesystem until it finds and validates some secondary superblocks. At that point, it generates a primary superblock.

Based on the above, Shall I assume that it will take sometime (a few hours ) to scan the entire file system (1 TB) until it finds and validates the secondary superblock ? or shall I assume that xfs is beyond repair ?

Much appreciated

Dona Paula

dona paula
Posts: 5
Joined: 2019/05/30 14:22:53

Re: Booting into Emergency Mode CentOS 7

Post by dona paula » 2019/06/01 09:29:49

Hi Trevor,

Good News. I got the system working again without having to reload the OS. I used the xfs_repair as you suggested but with the -L option (I know it is risky sometimes, I thought to just bite the bullet and go for it).

When I did not use the -L option, it was troubling me with the superblock error etc. as outlined in my previous post.

Thank you for your valuable support. I couldn't have done it without your guidance.

Dona Paula

Post Reply

Return to “CentOS 7 - Software Support”