LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   What is the expected output of mke2fs -c -c when there are bad blocks on the disk? (http://www.linuxquestions.org/questions/linux-general-1/what-is-the-expected-output-of-mke2fs-c-c-when-there-are-bad-blocks-on-the-disk-617887/)

pipopo 02-01-2008 04:14 AM

What is the expected output of mke2fs -c -c when there are bad blocks on the disk?
 
I am trying to use a laptop HDD on which WinXP was installed, but which stopped booting after the computer felt on the ground from about 2 feet.

I just created an ext2 partition on the whole drive and ran "mke2fs -c -c /dev/hda1" on it. The "-c -c" option is to run a read/write test to detect bad blocks.

This filesystem creation ran overnight and did not show any error. It says all the read/write tests were done, but I cannot see any error message. This is quite surprising because I assumed the HDD would be mostly unusable.

My question is: do you think bad blocks were found but not displayed? Or do you think there were no bad blocks? I do not know what to expect from "mke2fs -c -c". I know I could now run badblocks and see if it displays something, but I would be happy to save my time... ;-)

Cheers,
Marc.

lylemwood 02-01-2008 08:01 AM

mkfs -c functionality
 
Hi pipopo,

According to the man pages reference, mkfs with a -c will,

"Check the device for bad blocks before creating the file system. If any are found, the count is printed."

Now, that does not mean the HDD is in perfect condition, only that mkfs cannot find a problem specifically related to reading the disk surface. It could be an intermittent problem or it could be simply that some connections inside the case became dislodged or iffy when you dropped it and have since been rectified.

If you want to be certain, fun fsck on the volume with a -V and that should get a nice, chattery output about your drive.

HTH,

Lyle

pipopo 02-01-2008 09:37 AM

Hi lylemwood,

Thanks for your answer, I missed that bit in the man page. I guess it means my HDD is usable.

I specified "-c" two times, which means a torough read/write check was performed: the partition was filled in with some data and read after, four times with a different data pattern each time. I think if a HDD can pass this test it means it is in quite good condition.

I believe the data on the disk was lost when the laptop felt, but the disk surface was not altered. Also I read that some HDD have some backup blocks: when the chip that drives the disks finds a bad block, its maps the bad block's address to one of the backup blocks and the user cannot notice any problem (appart from data loss if anything was stored on the bad block).

I'll try fsck -a -V when I have some time!

If interrested you can follow what happens to the laptop on my Laptop Hack Blog ;-)

Cheers,
Marc.

lylemwood 02-03-2008 11:20 AM

Hi pipopo,

Sorry, should have been more clear... I only meant to imply using the "-V" option, no "-a", though that could be helpful if you wanted it to fix without prompting...

Nonetheless, enjoy and I hope it works out for you!

Lyle

pipopo 02-04-2008 04:09 AM

Hi Lyle,

Thanks for the additionnal information. I ran fsck -a -V: I understand that -a (or -p) is to fix the errors without prompting, which is what I wanted.

Anyway fsck sometimes says the disk is fine and sometimes finds a few badblocks, which is not so good. I'll see how things evolve over the days: hope it does not propagate.

Cheers,
Pipopo.

lylemwood 02-05-2008 07:57 AM

Hi Marc,

Typically it is considered that if a HDD is getting unreliable it should not be used.

Especially if it intermittently pops like that.

If it is under warranty, I would suggest calling the Manufacturer and asking them to replace it. Sometimes, with an error code, they will do it without asking too many pesky questions like, in this case, "Did you drop it?" Who knows? maybe the HDD scanner utility can fix the problem. Could just be a drive-head geometry issue.

Alas, it sounds like something has been jarred loose in there as a result of the fall, hence the "sometimes ok, sometimes bad sectors" results...

I am really a fan of reusing and repurposing hardware, but when a HDD does that to me and the Manufacturer's utility cannot fix it, I see about recycling.

Take care and sorry the prognosis is not better!

Lyle

pipopo 02-06-2008 03:43 AM

Hi Lyle,

Thanks for your advices.

I am playing with a junk laptop, and I have my personal data & system on my main laptop. So I'm not worried about messing around with an unreliable HDD, there's not data I would be bothered loosing.

Warranty is not an option as it expired a few months ago.

Cheers,
Marc.


All times are GMT -5. The time now is 01:34 PM.