Author Topic: Format HD checking bad sectors [Solved]  (Read 2236 times)

Offline Crow

  • Hero Member
  • *****
  • Posts: 8744
  • OBJECTS IN MIRROR... ARE LOSING
Format HD checking bad sectors [Solved]
« on: September 20, 2011, 07:33:23 AM »
In the process of partitioning a HD to install PCLinuxOS from a Live USB GParted just stalled, after that on rebooting Windows XP made some "fixes". The result is Win XP could not boot, files are backed up so I just formatted the drive but Win XP disk failed after loading; used again Gparted and rebuilt partition table, partitioned and formatted.

Win XP disk refused to play again after loading.

It seems to me that the disk has bad sectors but nor GParted nor the PCLinuxOS control center gives me the option to check for bad sectors while formatting (I'm sure it did before  ??? )

The computer is a netbook Compaq CQ10 150 GB HD

Do I have any option using PCLOS or do I need another tool?

Thank you
« Last Edit: September 21, 2011, 01:05:11 PM by Crow »
I shall pass this way but once;
any good therefore that I can do,
or any kindness that I can show
let me not defer nor neglect it,
for I shall not pass this way again.

Linux User #330412

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Format HD checking bad sectors
« Reply #1 on: September 20, 2011, 08:10:51 AM »
Hi Crow,

HP notebook/latptop generally do have a built in function in BIOS to make a short test of the hard disk, not sure about your specific model, but you can check.

About bad blocks, assuming the disk is a relatively recent model, your best option is to perform a S.M.A.R.T. test, which is much much faster than a scanning for badblocks.

I'm not sure that scanning for badblocks make any sense these days, because SATA disks are designed to automatically replace bad sectors (using some spare storage on the same disk) when some error occurs. Once the spare blocks are exhausted your best choice is to replace the hard disk.

Anyway, to check the disk using S.M.A.R.T. technology you need the command smarctl, provided by the packaged smartmontools, available in repo non available on a brand new PCLinuxOS ISO image:

smartmontools-5.41-1pclos2011
gsmartcontrol-0.8.6-1pclos2011

gmsartcontrol is a graphics interface to smartctl, your best option is to install both packages, available there are a general healt status, a short test (2 minutes) a long test (1 or more hours), please note that SMART status is based on data collected along the whole life of the hard disk, not only data collected at test time.

graphics interface:
gsmartcontrol

from command line:
smartctl -H /dev/sdX (general healt status)
smartctl -t short /dev/sdX (perform a short test)
smartctl -t long /dev/sdx (perform a long test)
smartctl -l selfest (list and status about already performed tests)

if you want to perform a scan for bad blocks, the command is badblocks, is available on the official live ISOs, and can be used directly from command line, see man badblocks for further details:
badblocks  /dev/sdaX

or you can use fsck on ext2/3/4 partitions (that in turn will call badblocks):
fsck -f -c /dev/sdaX (read-only test)
fsck -f -c -c /dev/sdaX (read-write test)

Regards
AS




Offline Crow

  • Hero Member
  • *****
  • Posts: 8744
  • OBJECTS IN MIRROR... ARE LOSING
Re: Format HD checking bad sectors
« Reply #2 on: September 20, 2011, 08:21:06 AM »
Thank you I will try as soon as I get home
I shall pass this way but once;
any good therefore that I can do,
or any kindness that I can show
let me not defer nor neglect it,
for I shall not pass this way again.

Linux User #330412

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15281
  • ┌∩┐(◕_◕)┌∩┐
Re: Format HD checking bad sectors
« Reply #3 on: September 20, 2011, 08:33:01 AM »
I believe when installing PCLinuxOS there is an option for bad sector checking during the format stage.
PCLinuxOS 32bit KDE 4.10.1; kernel-3.4.11-pclos1.bfs & 64bit 3.2.18bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000

Offline Crow

  • Hero Member
  • *****
  • Posts: 8744
  • OBJECTS IN MIRROR... ARE LOSING
Re: Format HD checking bad sectors
« Reply #4 on: September 20, 2011, 09:08:02 AM »
I believe when installing PCLinuxOS there is an option for bad sector checking during the format stage.

Probably I saw it there  :(
I shall pass this way but once;
any good therefore that I can do,
or any kindness that I can show
let me not defer nor neglect it,
for I shall not pass this way again.

Linux User #330412

Offline Crow

  • Hero Member
  • *****
  • Posts: 8744
  • OBJECTS IN MIRROR... ARE LOSING
Re: Format HD checking bad sectors
« Reply #5 on: September 21, 2011, 12:26:50 PM »
Just want to thank As and Menotu,after several intents in which Linux worked recognizing the drive but not XP, it turned to be that the nettbook needed XP SP3 or later and we were using XP SP2   :-\    live and learn!

Thank you again for your time.
« Last Edit: September 21, 2011, 12:47:22 PM by Crow »
I shall pass this way but once;
any good therefore that I can do,
or any kindness that I can show
let me not defer nor neglect it,
for I shall not pass this way again.

Linux User #330412

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Format HD checking bad sectors
« Reply #6 on: September 21, 2011, 12:28:42 PM »
 ;) :)