Ask Your Question
3

shell command to fix filesystem

asked Dec 16 '11

tonybrowning gravatar image tonybrowning
43 2 4 8

updated Dec 16 '11

I'm using Fedora 16 Verne but before it was Beta. My problem began when I just had updated my auto YUM software updates yesterday, 12/15/11 and it updated Linux kernel from fedora (3.1.5-1.fc16.i686) to (3.1.5-2.fc16.i686) rpm 32bit, then my laptop started acting unstable with a sign Oh no! Something has gone wrong. A problem has occurred and the system can't recover. Please log out and try again. So I did that and then it read Need to contact adminstrator, of which I am. After booting up, everytime it displays....even if I try booting the other 2 earlier Linux kernels, dracut still drops to command shell and gives this same read-out:

Booting 'Fedora (3.1.5-2.fc16.i686)'

Loading Fedora (3.1.5-2fc16.i686)'

Loading initial ramdisk...

_Fedora-16-Beta-: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options)

dracut Warning: e2fsck returned with 4

dracut Warning:_Fedora-16-Beta-contains a file system with errors, check forced.

dracut Warning:_Fedora-16-Beta-: Inodes that were part of a corrupted orphan linked list found.

dracut Warning: * An error occured during the file system check.

dracut Warning: * Dropping you to a shell; the system will try

dracut Warning: * to mount the filesystem(s), when you leave the shell.

dracut Warning:

Dropping to debug shell.

sh: can't access tty; job control turned off

(Repair filesystem):/#

ANY HELP would be most appreciated because I haven't the slightest clue how to fix this nor what went wrong. I tryed typing in fsck and it then reads fsck from util-linux 2.20.1 (or how do I leave the shell?)

7 Answers

Sort by ยป oldest newest most voted
2
tonybrowning has selected this answer as correct

answered Dec 16 '11

stephan gravatar image stephan
36 2

type "blkid" (without quotes) to find out which partition is called Fedora-16-Beta

It will probably be something like /dev/sda2 or possibly /dev/mapper/xxxxx

Once you know which one is Fedora-16-Beta, type the command: fsck -y /dev/sda2 (substituting whichever partition was called Fedora-16-Beta)

then type exit and hopefully you will be fixed up

link

Comments

Thanks very much Stephan for advice on fixing and the new package dracut for catching it to fixing!!!!! This worked !!!!! The fedora-16-beta was in my mapper/boot on harddrive and like you said to substitute the file, so I did and it corrected errors and corrupt files and now is fixed, now again operable , and back to normal.. ty ty ty soooo much!!!!

tonybrowning (Dec 17 '11)

Hello world, Just adding a [solved] note. This method also worked for me, running Fedora 16 Verne 3.1.5-6 I was dropped into debug shell with- WARNING: at fs/inode.c:884 unlocknewinode+0x42/0x50()

topaz (Dec 25 '11)

Thank you! This solved my problem too.

Weird as it may be, this error seems to be the result of the clock in windows and linux not working well together on a dual boot system :-s

Niko (Jan 16)

Thanks a lot. It worked for me.

sfurti rajput (Mar 09)

Thanks a lot.It is working.

ciypro (Mar 26)
see 2 more comments
1

answered Dec 16 '11

hhlp gravatar image hhlp flag of Spain
1409 11 19 43
https://fedoraproject.org...

updated Dec 16 '11

fsck is used to check and optionally repair one or more Linux file systems, Do not run fsck on a live or mounted file system. Running fsck on a mounted filesystem can usually result in disk and/or data corruption.

If no filesystems are specified on the command line, fsck will default to checking filesystems in /etc/fstab serially. This is equivalent to the -As options.

You can do this with fsck -Vy. And check the exit code of fsck afterwards with

echo $?

. These are some values you could get:

    0 - No errors
    1 - File system errors corrected
    2 - File system errors corrected, system should be rebooted
    4 - File system errors left uncorrected
    8 - Operational error
    16 - Usage or syntax error.
    32 - Fsck canceled by user request
   128 - Shared-library error
link

Comments

@hhlp As the system is suggesting "i.e., without -a or -p options" you should not use -p option (neither -a).

ztank1013 (Dec 16 '11)

Thanks hhlp, I tried this and it would read "fixing file system" and then jump back to # again. I tried echo and it read 0 for errors. So I will keep this in mind because I'm assuming this will work on fixing some certain file circumstances of file fixes. Thanks again.

tonybrowning (Dec 17 '11)
0

answered Mar 09

sfurti rajput gravatar image sfurti rajput
1

thanks a lot. it worked 4 me.

link
0

answered Mar 26

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated Mar 26

ciypro gravatar image ciypro
1

thanks for the commands posts here. i have encountered the same problem in fedora 16 full version. but it is finally recovered from the command fsck -y

link
0

answered Jan 30

Liev gravatar image Liev
1

Hello! I just wanted to say i had the same problem, happened when i upgraded the linux kernel with yumex. I also found that the partition was inside mapper. Thig is after doing the whole process (and ia ran echo $? to verify there were no errors) every time i boot the most recent kernel i keep getting the same message and either i have to do the same process of fsck o just ignore it, type exit and continue booting normally... Is it normal that it keeps giving me the same mistake after running the fsck on the right partition? Thanks for your time!

link
0

answered Jan 30

Liev gravatar image Liev
1

Hello! I just wanted to say i had the same problem, happened when i upgraded the linux kernel with yumex. I also found that the partition was inside mapper. Thig is after doing the whole process (and ia ran echo $? to verify there were no errors) every time i boot the most recent kernel i keep getting the same message and either i have to do the same process of fsck o just ignore it, type exit and continue booting normally... Is it normal that it keeps giving me the same mistake after running the fsck on the right partition? Thanks for your time!

link
0

answered Dec 16 '11

ztank1013 gravatar image ztank1013 flag of Italy
861 5 13 28

Once you are in the debug shell you should be able to run the fsck utility on the corrupted file system, try:

fsck -y

or

fsck -y <target-filesystem>

when it finishes type exit or ctrl+d to resume the normal boot process.

link

Comments

Thanks for your help also Ztank!!!!

tonybrowning (Dec 17 '11)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: Dec 16 '11

Seen: 6,921 times

Last updated: Mar 26