1752511 Members
4804 Online
108788 Solutions
New Discussion юеВ

fsck?

 
SOLVED
Go to solution
Alessandro_22
Advisor

fsck?

Dear all, my filesystem contains some error after a power cut, I'm not able to boot. I know I should use fsck, but before doing serious damage... Any suggestion how? Best,
Alessandro

(P.S. I have a win partition in /dev/hda1)
7 REPLIES 7
Paulo A G Fessel
Trusted Contributor
Solution

Re: fsck?

It would be interesting if you've posted the partition that is unclean. Anyway, normally a "fsck -y /dev/hdaX" will solve the problems. "/dev/hdaX" is your dirty partition. If there's more than one dirty partition, you'll have to fsck each one of them.

Just don't run fsck over your Windows partition (/dev/hda1), unless you don't matter that it gets fscked. ;-)

[]'s
Paulo Fessel
L'employ├Г┬й propose, le boss dispose.
GK_5
Regular Advisor

Re: fsck?

fsck -y /dev/hdax should fix the file system errors.
IT is great!
dirk dierickx
Honored Contributor

Re: fsck?

depending on the version of the linux distro you are using, you could implement a journaled filesystem. that would have saved you from the misery you are in now.

most distros will allow you to boot from cd or else boot from a resque disk/cd, and run 'fsck -y ' from there on your internal harddisk.

next time you boot, you can then convert your ext2 filesystem to an ext3 filesystem and get away from these long fsck checks after your system went down unclean. 'tune2fs -j
Huc_1
Honored Contributor

Re: fsck?

Depending on your platform,distribution,Hardware

You could boot from a cd/floppy like knopppix our your distribution cd in rescue mode

from there

fsck -y on the corrupted partion (not on /dev/hda1 your win partition)

This will probably fix it ? ... if not you have a good backup ?... yes

To save yourself most of this hardship I would do as Dirk Dierickx suggess that is use a journaling file, this will make boot faster and does make it more robust.

Keep us informed success/failure progress

Jean-Pierre

Smile I will feel the difference
Alessandro_22
Advisor

Re: fsck?

Thanks a lot to all of you, I saved my most important directories using fsck, I backup them and I'm now going to reinstall my Redhat linux. Best,

Alessandro
Sorrel G. Jakins
Valued Contributor

Re: fsck?

My understanding is that a journaled filesystem does not obviate the need for fsck, it merely limits the chance of having to run it. fsck does run much faster if there is a journal log that passes integrity checking. fsck does do its best to fix the filesystem without loss of data, but cannot guarantee that it can reclaim everything. fsck is run when Something Bad has happened to your filesystem, and fsck tries to minimize the damage. If you're neurotic, run it first with -N switch set, and it'll tell you what it is thinking of doing.

The error codes returned are:
0 - No errors
1 - File system errors corrected
2 - System should be rebooted
4 - File system errors left uncorrected
8 - Operational error
16 - Usage or syntax error
128 - Shared library error

Note that these are bitwise error codes, and if you run fsck on multiple file systems then the return code will be a composite 'or' of all return codes.

HTH,
Sorrel Jakins
Alessandro_22
Advisor

Re: fsck?

fsck worked ok, at least for my most important important dir! Problem fixed!