Jan 6, 2014

HowTo: Run fsck on Emergency Mode on Fedora 19


Problem:

systemd-fsck[529]: /dev/mapper/fedora_XXX--home: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY...
Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "ststemctl reboot" to reboot, "systemctl default" to try again to boot into ddefault mode.
Give root password for maintenance
(or type Control-D to continue):

Solution #1 (untested):
1. type in your root password (you will not see anything when you are typing, but its typing)
2. type fsck
 - if you get an error message like the one below, try Solution #2 or Solution #3
     /dev/mapper/fedora_XXX--root is mounted
      e2fsck: Cannot continue, aborting. 
3. if there are questions about fixing, ignoring, forcing, salvage, etc, always answer y (yes)

Solution #2 (untested):
- we will continue from step 2 of solution #1
1. type the commands below, remember to substitute XXX with the one specified in your error
     umount /dev/mapper/fedora_XXX--root
     umount /dev/mapper/fedora_XXX--home
     umount /dev/mapper/fedora_XXX--swap
2. type fsck /dev/mapper/fedora_XXX--root
3. if there are questions about fixing, ignoring, forcing, salvage, etc, always answer y (yes)
4. repeat step 2 & 3 with --home & --swap just to be sure

Solution #3 (tested):
1. boot into your LiveCD or LiveUSB
2. once logged in, open gnome-disks utility from the applications (I think its called Disks)
3. unmount all the /dev/mapper/fedora_XXX--root & home & swap
4. open a gnome-terminal (terminal)
5. type su -
6. enter your root password

7. type fsck /dev/mapper/fedora_XXX--root
8. if there are questions about fixing, ignoring, forcing, salvage, etc, always answer y (yes)
9. repeat step 7 & 8 with --home & --swap just to be sure

(if you found problems in my solutions, please correct me, also if you can share your solutions & fixes please do so. thanks. I wasn't been able to test other errors simply because I fixed my problem with solution #3, if ever I came across the same problem, I'll try the other methods)

7 comments:

  1. Solution #3 allowed me to fsck root under Fedora 20 (I didn't try the other 2 solutions). Thank you! Only note: I found that steps 2-3 were not necessary since the 'fedora_XXX-root' was not mounted after booting with the Live Desktop DVD.

    ReplyDelete
  2. Hello,

    Solutions 1 and 2 didn't worked for me because it was impossible to unmount /dev/mapper/fedora--root.
    So the solution was to boot on Ubuntu with an USB key. However, my disk was LVM formatted so I had to follow the steps here : http://www.linuxquestions.org/questions/fedora-35/how-can-i-mount-lvm-partition-in-ubuntu-569507/#post4039648. I was then able to run fsck on /dev/mapper/fedora--root to correct the errors.

    ReplyDelete
  3. I have faced this problem when there was a power failure with my desktop updating fedora 20 x86_64.
    The best procedure and perhaps the easiest is to use a gparted live cd. the procedure is explained as follows:
    1. Shutdown the system.
    2. Restart the system boot using gparted live cd
    3. Unmount your computer partition (If its already mounted)
    4. Run the gui gparted application.
    5. Select the partition that has errors (Your desktop partition that harbors fedora installation)
    6. On the gui screen of gparted use --- 'Partition' -----> 'check'
    7. After the process is complete shut down the system and boot as usual.
    8. Enjoy fedora again.. !

    ReplyDelete
  4. Solution #3 worked for me.

    I operate my Fedora 20 from VMware and I booted from the LiveDVD iso file. I had to modify the BIOS settings to boot into the DVD. After fixing the solution, I had to edit the BIOS again to boot to Hard Drive.

    I expected a menu in the Live boot menu from the DVD saying something like "Boot to Hard Drive

    ReplyDelete
  5. I have Fedora 20 running as a VirtualBox guest VM. I did not have a Fedora 20 live iso handy, but for this, almost any version should work. I used Fedora-Live-Desktop-i686-19.iso. Insert that iso in the virtual CD/DVD drive, start the vm, Start Fedora Live
    Once that was up, I checked the visible disks (using Disks), but only fedora-swap was mounted. Everything else was part of the active 'live' session.

    In terminal, su - did not need any password for the live session
    fsck /dev/mapper/fedora-root, and a bunch of "y"s fixed it.
    there was no version or other suffix after "fedora" in the device/partition name

    I am curious just what cased the virtual disk to get the errors. I do not remember any power failure that would seem to be the most likely culprit. But fixed anyway 8D

    ReplyDelete
  6. You my friend, are nothing short of awesome!

    Solution 3 worked well for me.

    ReplyDelete
  7. Awesome !!! Thank you !! I follow Step 1, I had to let my finger pressing y during 15 minuts to fix all the bugs and corrupted files... AND IT WORKS !!! Thank you so much !!

    ReplyDelete