Jump to content
Sandro

Software for make "low level format" for an HDD

Recommended Posts

Hi.

A friend of mine has an old IBM Thinkpad laptop; but the HDD (Hitachi 40 GiB) doesn't start (run).

 

Using SysRescueCD , i've seen in the kernel messages at startup that that there are messages about troubles for block (sector ?) 0

 

I've tried a "zero-fill" using dd if=/dev/zero of=/dev/sda but nothing is changed; then a

# badblocks -svn /dev/sda

But it doesn't found errors.

 

Then i think (last chanche) to make a "real old style" method for attempting to repristinate the hdd (if possible).

 

Someone know a right method ?

 

Thanx very much for any suggestion.

Share this post


Link to post
Share on other sites

You might want to check the S.M.A.R.T. attributes on the disk...

# smartctl -A /dev/sda

You also might want to run a selftest on it to see if there are any other issues...

# smartctl -t long /dev/sda

FYI, sometimes you can force a drive to reallocate bad blocks by writing zeros to the disk, but there are limits.  The way a disk typically works is that it reserves a certain amount of space it can reallocate bad blocks from.  Generally you only start seeing bad blocks once it runs out of that reserved space.

Share this post


Link to post
Share on other sites

I have an ancient laptop with a HD of that size, mini IDE I believe it was called.  And I have another 32?G mini IDE drive.  The 32G recently died, it was used approx. a couple of hours per day.  The laptop with the 40G is still ticking, but recently had a severe disk hit and I had to reformat it, luckily I back up everything so it was easy to fix.  That machine is rarely turned on.  End of life?  perhaps...

Anyhow, if it's ext type filesystem fsck works fine of course.   fsck.vfat for fat32, ntfsfix for ntfs. I never use badblocks but I wonder if you could have all blocks intact and yet still have an error in the filesystem?  Don't know the answer but I suspect you could.  Have you tried reformatting?  Of course, he will lose all of his ancient data  :)

Share this post


Link to post
Share on other sites

Hi uxcn and thank you for your interest ... :)

 

I've used also 2 utilities for this "Hitachi HTS541040G9AT00" written ohn a bootable cd-rom (FreeDOS i think),

but they have not solved the trouble about sector 0 :(

 

Hi sputnik and Thanx to You for the interest ... :)

 

I don't need to rescue data but only that the HDD return to be able to start.

The error is about sector 0

 

I've tryed also 2 utilities downloaded from "Hitachi" .... but without solving the trouble :(

 

Now i'm using

# badblock -svw -d 512 -c 1 /dev/sda

15 houres that it runs without errors .... and i think that are necessary 15 - 20 hours to complete.

 

Now i want to learn more about HDD.

 

Thank You All for suggestions.

 

I will inform you when badblocks will terminate :)

Share this post


Link to post
Share on other sites

For some reason my old account is gone, well any ways, here's a solution for you. Sorry. Not around much.

 

System Rescue CD has a program called hdparm. You can use the drives built in secure erase to essentially reset the drive. It will hit all the sectors that the OS can't access. Drives keep some sectors hidden for the case or re-allocating bad sectors so the drive still appears the same size to the OS.

 

Some bios, however, lock out the drives. There are various methods of bypassing that. To check if your drive is frozen by the bios, run the following command:
 

hdparm -I /dev/X

Where X is your drive number.

Sample output:

Security: 
       Master password revision code = 65534
               supported
       not     enabled
       not     locked
       not     frozen
       not     expired: security count
               supported: enhanced erase
       2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.

However, if there is no "not" in front of frozen for you, then you need to try several methods.

One is to put the computer to sleep and then resume:

 echo -n mem > /sys/power/state

Another with IDE drives is to plug the IDE cable into the CD Rom drive first and then swap IDE cables. NOTE: Power must must still be applied to both CD Rom and Hard Drive on boot up. The IDE cable is just not plugged into the HD. Though, sometimes you can get away with plugging in the drive after the immediate post of the bios. Some computers can boot to a boot select device screen which should be past the initial lock out of the hard drive.

 

SATA Drives support hot plugging, but sometimes that needs to be enabled in the bios. This can be done after the OS has loaded.

 

Once the drive is not frozen, set a user password. The password can be a single letter for this as it's not permanent after the reboot.

hdparm --user-master u --security-set-pass A /dev/X

Now make sure the drive is enabled:

hdparm -I /dev/X

Sample output. The Enabled line is the one that's important here as there is no longer a "not" in front of Enabled.

Security: 
       Master password revision code = 65534
               supported
               enabled
       not     locked
       not     frozen
       not     expired: security count
               supported: enhanced erase
       Security level high
       2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.

Now enter the secure erase command:

hdparm --user-master u --security-erase A /dev/X

The prompt will not return until the operation is finished. If you want to do more shell commands while this is going on, you will need a new terminal. On older drives it can take up to 2 hours. Also, since this is a in-built drive command, there is no traffic over the IDE/SATA bus at all. This means that you can set several drives to wipe at the same time, but must use different terminals, and it will not affect the speed of erase. I did this for three 2TB drives once.

 

After the erase has happened, the security will be disabled automatically:

# hdparm -I /dev/X

Security: 
       Master password revision code = 65534
               supported
       not     enabled
       not     locked
       not     frozen
       not     expired: security count
               supported: enhanced erase
       2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.

Hope you are successful.

 

-Jon

Share this post


Link to post
Share on other sites

hmmm ... thanks to All but the hdd was very corrupted :| 

solution a new hdd .... thanks for all Greats friends of Funtoo and for yours informations :P :)

 

You are very great :)

 

Thanx a lot :?)

 

Whit estimate ....

 

Sandro :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...