How repair /usr partition using fsck, after finding errors during boot up?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How repair /usr partition using fsck, after finding errors during boot up?
Hi,
after 30 times mounting my filesystem without checking it it was checked automaticly while boot up. All disks checked without problems except /usr partition.
I am using Debian Sarge, and it works perfectly. The best one.
I got following messsage when for /usr partition
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.
I am no fsck expert (FAR from it). But here are a few suggestions:
(1) You did umount the filesystem before running fsck, right? fsck on a mounted filesystem, while possible, is not adviseable.
(2) Your first invokation of fsck is wrong. You said: "fsck -f /dev -y"
I think you meant: "fsck -y -f /dev/sda6"
Trying to run fsck on just "/dev" surely won't work, and I'd expect "Bad superblock" to be a good candidate for the error you might receive.
Make sure /dev/sda6 is where /usr really is. If you're wrong in that specification and running fsck on your swap or maybe a Windows NTFS partition, you'll surely get a failure.
(3) Running e2fsck with "-b 8193" is a good thing to try if indeed your superblock is corrupted. You may also need to specify the specific blocksize with "-B" (a capitol 'B' for this option). This -B option takes a parameter, the specific blocksize. I've never used -B in practice so I don't know exactly how you specify the blocksize. Assuming you have the standard 1k blocksize, you could try "-B 1k" or "-B 1024". One of those may work. Experiment. The worst thing I can see happening if you specify blocksize incorrectly is another of those "Bad superblock" error messages.
(4) Your original error: "end_request: I/O error, dev sda, sector 26585499" sounds a little ominous. You may have an actual harddisk problem. If you have a low level disk diagnostic tool (like Seagate's "Seatools") then you might try running that to see if your hardware is in good shape. These tools usually boot off a floppy or CDROM. fsck can't fix messed up hardware.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.