Operating System - Linux
1819928 Members
3094 Online
109607 Solutions
New Discussion юеВ

How use fsck command to repair /usr partition

 
debian111
Regular Advisor

How use fsck command to repair /usr partition

Good morning

When I turned my computer this morning--running linix Debian Sarge I got a message about forced checking my disks--mounted more than 30 times --checking forced.
Then when checking my /usr partition I got a message about an error.
After couple minutes it asks for root paswword to repair system manualy using command fsck....

what is syntax of fsck commandd to repair my /usr partition, I had never do this before
and I have very important data on my disk, so if you know what is solution for my problem please write it down.

I have root privileges, and I am root on this mashine.

Thank you in advance.

9 REPLIES 9
Muthukumar_5
Honored Contributor

Re: How use fsck command to repair /usr partition

check the file system type as,

# df -T
# fsck.ext3 -s -v /usr

like that.
Easy to suggest when don't know about the problem!
Bill Thorsteinson
Honored Contributor

Re: How use fsck command to repair /usr partition

You may want to edit /etc/default/rcS

There is an option there to add the -y flag
to fsck during startup. This will cause
fsck to automatically fix errors if it finds
them.

As root run 'fsck /usr'. It will prompt you
for each fix.
After it is done exit or reboot.

Ivan Ferreira
Honored Contributor

Re: How use fsck command to repair /usr partition

First, ensure that the /usr filesystem is not mounted using the command "mount" or "df". The /usr filesystem should not be mounted.

Then run the command:

fsck -f /usr -y

To repair the filesystem.

If you are using ext3, you can disable the check interval using

tune2fs -i 0 -c 0 /dev/

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
debian111
Regular Advisor

Re: How use fsck command to repair /usr partition

I got following messsage when I turned on my machine:

current sda: Sense key Medium Error
Additional sense: Unrecovered read error-auto reallocate failed
end_request: I/O error, dev sda, sector 26585499
Error reading block 33558536 (Attempt to read block from filesystem resulted in short read) while doing inode scan.

after couple minutes scroling on screen it stoped and wrote next

current sda: Sense key Medium Error
Additional sense: Unrecovered read error-auto reallocate failed
end_request: I/O error, dev sda, sector 26585592
Error reading block 33558629 (Attempt to read block from filesystem resulted in short read) while doing inode scan.

/usr: UNESPECTED INCONSISTENCY: RUN fsck MANUALLY

and ask for root password.
I entered root password and as root enter next command as suggested some of you

#fsck -f /dev -y
tneh I got output

fsck.ext2 is directory while trying to open /usr

the superblock could not be read or does not describe a correct ext2 filesystem (and not swap or ufs or something else), then the superblock is corupted, you might try running e2fsck with an alternate superblock...

and then I run next command

#e2fsck -b 8193 /dev/sda6

then I got output like this

fsck.ext2 is directory while trying to open /usr

the superblock could not be read or does not describe a correct ext2 filesystem (and not swap or ufs or something else), then the superblock is corupted, you might try running e2fsck with an alternate superblock...


I do not know what to do in this situation, and I am compleatelly confused.


Thanks for your help.
bong_3
Advisor

Re: How use fsck command to repair /usr partition

have you tried fixing it by
#fsck -y /usr
debian111
Regular Advisor

Re: How use fsck command to repair /usr partition

Yes, I tried and I got output I wrote in my previous thread.

Thank You for your sugggestions.

Alan_152
Honored Contributor

Re: How use fsck command to repair /usr partition

Are you doing your fsck from single-user mode? Made sure the partition isn't mounted?
debian111
Regular Advisor

Re: How use fsck command to repair /usr partition


Partittion is not mounted, I am trying to repair during booting system.
Ivan Ferreira
Honored Contributor

Re: How use fsck command to repair /usr partition

Are you sure the backup superblock is in 8193?

Do you have a backup of the partition? you may need to re-create the file system and restore the backup.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?