Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Fix bad sectors

  1. #1
    Join Date
    Dec 2007
    Beans
    60

    Fix bad sectors

    i was going to reinstall my windows today. HOwever i ran into some trouble, and i found out that my Harddrive have some bad sectors. I was therefore unable to properly install windows, some files where not copied ot the HD. I was however able to install ubuntu (which is the most important).

    So i am wondering if there is some way of fix the bad sectors with linux?

  2. #2
    Join Date
    Nov 2007
    Location
    Okieville, USA
    Beans
    3,178
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Fix bad sectors

    fsck
    MCP, A+/Linux+ Certified IT Technician
    System Specs | Dress up your "Super Button" FREE
    "If sometimes you can't be good, then be VERY good at being naughty!"

  3. #3
    Join Date
    Mar 2008
    Beans
    464
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Fix bad sectors

    You can run diagnostic tools for your drive which can sometimes mark bad sectors as unusable. The diagnostics can usually be downloaded from the the manufacturers website of your hard drive.

    However if a hard drive has bad sectors I would recommend replacing it because you are at risk of losing data.

  4. #4
    Join Date
    Dec 2007
    Beans
    60

    Re: Fix bad sectors

    Quote Originally Posted by theozzlives View Post
    fsck
    i get:

    Code:
    fsck 1.40.8 (13-Mar-2008)
    fsck.ext3: Unable to resolve 'UUID=f5c9bc83-057c-4880-9d97-00ae94c25279'
    You can run diagnostic tools for your drive which can sometimes mark bad sectors as unusable. The diagnostics can usually be downloaded from the the manufacturers website of your hard drive.

    However if a hard drive has bad sectors I would recommend replacing it because you are at risk of losing data.
    And how would i do that?

    ^ sorry misunderstood. But i doubt i will find that kind of software for linux? how can i find out which type of HD i have? (without opening the computer)
    Last edited by epqr; December 7th, 2008 at 08:43 PM.

  5. #5
    Join Date
    Mar 2008
    Beans
    464
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Fix bad sectors

    The diagnostics would usually run off a DOS based boot disk.
    You can sometimes work out the brand of drive by looking in the bios, if not Drive Fitness test diagnostic is a good place to start although I am not sure it will resolve the bad sectors because it will be a generic test and not drive model specific unless you have an IBM or Hitachi drive.

    Drive Fitness Test:
    http://www.hitachigst.com/hdd/support/download.htm#DFT

    Download link for Drive Fitness Test ISO:
    http://www.hitachigst.com/hdd/suppor...2_v414_b00.iso

    You could also try Ultimate Boot CD which has many diagnostic tools for various drives:
    http://www.ultimatebootcd.com/

  6. #6
    Join Date
    Mar 2008
    Beans
    464
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Fix bad sectors

    To find your drive model under linux run:

    Code:
    sudo hdparm -I /dev/sda
    where /dev/sda is the device your hard drive is.
    Last edited by mk1w86; December 7th, 2008 at 09:00 PM.

  7. #7
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Fix bad sectors

    If you want, you can run the HDD diagnostic test from Ubuntu by doing the following:
    Code:
    sudo apt-get install smartmontools
    First do the following to save the current health status parameters of your HDD to a file on your desktop:
    Code:
    sudo smartctl -a /dev/sda > ~/Desktop/sda_health_before_test.txt
    Then run:
    Code:
    sudo smartctl -t long /dev/sda
    That command will immediately terminate while the HDD begins its self-test, and it could take quite a while. You can monitor the progress with:
    Code:
    sudo smartctl -a /dev/sda | grep -A 1 -i "self-test execution status"
    Once the above command says the test is done, then do:
    Code:
    sudo smartctl -a /dev/sda > ~/Desktop/sda_health_after_test.txt
    sudo smartctl -H /dev/sda
    And then post the results of those two files so we can see what your HDD's health is like at this point.

  8. #8
    Join Date
    Dec 2007
    Beans
    60

    Re: Fix bad sectors

    Quote Originally Posted by mk1w86 View Post
    To find your drive model under linux run:

    Code:
    sudo hdparm -I /dev/sda
    where /dev/sda is the device your hard drive is.
    I get this

    Code:
    /dev/sda:
    
    ATA device, with non-removable media
    	Model Number:       ST9120821AS                             
    	Serial Number:      5PL42H5A
    	Firmware Revision:  7.24    
    Standards:
    	Supported: 7 6 5 4 
    	Likely used: 8
    Configuration:
    	Logical		max	current
    	cylinders	16383	16383
    	heads		16	16
    	sectors/track	63	63
    	--
    	CHS current addressable sectors:   16514064
    	LBA    user addressable sectors:  234441648
    	LBA48  user addressable sectors:  234441648
    	device size with M = 1024*1024:      114473 MBytes
    	device size with M = 1000*1000:      120034 MBytes (120 GB)
    Capabilities:
    	LBA, IORDY(can be disabled)
    	Standby timer values: spec'd by Standard, no device specific minimum
    	R/W multiple sector transfer: Max = 16	Current = 16
    	Advanced power management level: 128
    	Recommended acoustic management value: 254, current value: 0
    	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
    	     Cycle time: min=120ns recommended=120ns
    	PIO: pio0 pio1 pio2 pio3 pio4 
    	     Cycle time: no flow control=240ns  IORDY flow control=120ns
    Commands/features:
    	Enabled	Supported:
    	   *	SMART feature set
    	    	Security Mode feature set
    	   *	Power Management feature set
    	   *	Write cache
    	   *	Look-ahead
    	   *	WRITE_BUFFER command
    	   *	READ_BUFFER command
    	   *	DOWNLOAD_MICROCODE
    	   *	Advanced Power Management feature set
    	   *	48-bit Address feature set
    	   *	Device Configuration Overlay feature set
    	   *	Mandatory FLUSH_CACHE
    	   *	FLUSH_CACHE_EXT
    	   *	SMART error logging
    	   *	SMART self-test
    	   *	IDLE_IMMEDIATE with UNLOAD
    	   *	SATA-I signaling speed (1.5Gb/s)
    	   *	Phy event counters
    	    	Device-initiated interface power management
    	   *	Software settings preservation
    	   *	SMART Command Transport (SCT) feature set
    Security: 
    	Master password revision code = 65534
    		supported
    	not	enabled
    	not	locked
    		frozen
    	not	expired: security count
    		supported: enhanced erase
    	66min for SECURITY ERASE UNIT. 66min for ENHANCED SECURITY ERASE UNIT.
    Checksum: correct
    jonesu1@jonesu1-laptop:~$ sudo hdparm -I /dev/sda1
    [sudo] password for jonesu1: 
    
    /dev/sda1:
    
    ATA device, with non-removable media
    	Model Number:       ST9120821AS                             
    	Serial Number:      5PL42H5A
    	Firmware Revision:  7.24    
    Standards:
    	Supported: 7 6 5 4 
    	Likely used: 8
    Configuration:
    	Logical		max	current
    	cylinders	16383	16383
    	heads		16	16
    	sectors/track	63	63
    	--
    	CHS current addressable sectors:   16514064
    	LBA    user addressable sectors:  234441648
    	LBA48  user addressable sectors:  234441648
    	device size with M = 1024*1024:      114473 MBytes
    	device size with M = 1000*1000:      120034 MBytes (120 GB)
    Capabilities:
    	LBA, IORDY(can be disabled)
    	Standby timer values: spec'd by Standard, no device specific minimum
    	R/W multiple sector transfer: Max = 16	Current = 16
    	Advanced power management level: 128
    	Recommended acoustic management value: 254, current value: 0
    	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
    	     Cycle time: min=120ns recommended=120ns
    	PIO: pio0 pio1 pio2 pio3 pio4 
    	     Cycle time: no flow control=240ns  IORDY flow control=120ns
    Commands/features:
    	Enabled	Supported:
    	   *	SMART feature set
    	    	Security Mode feature set
    	   *	Power Management feature set
    	   *	Write cache
    	   *	Look-ahead
    	   *	WRITE_BUFFER command
    	   *	READ_BUFFER command
    	   *	DOWNLOAD_MICROCODE
    	   *	Advanced Power Management feature set
    	   *	48-bit Address feature set
    	   *	Device Configuration Overlay feature set
    	   *	Mandatory FLUSH_CACHE
    	   *	FLUSH_CACHE_EXT
    	   *	SMART error logging
    	   *	SMART self-test
    	   *	IDLE_IMMEDIATE with UNLOAD
    	   *	SATA-I signaling speed (1.5Gb/s)
    	   *	Phy event counters
    	    	Device-initiated interface power management
    	   *	Software settings preservation
    	   *	SMART Command Transport (SCT) feature set
    Security: 
    	Master password revision code = 65534
    		supported
    	not	enabled
    	not	locked
    		frozen
    	not	expired: security count
    		supported: enhanced erase
    	66min for SECURITY ERASE UNIT. 66min for ENHANCED SECURITY ERASE UNIT.
    i don't see a manufacturer there

  9. #9
    Join Date
    Mar 2008
    Beans
    464
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Fix bad sectors

    ST9120821AS suggests the drive is a Seagate.

  10. #10
    Join Date
    Dec 2007
    Beans
    60

    Re: Fix bad sectors

    Quote Originally Posted by caljohnsmith View Post
    If you want, you can run the HDD diagnostic test from Ubuntu by doing the following:
    Code:
    sudo apt-get install smartmontools
    First do the following to save the current health status parameters of your HDD to a file on your desktop:
    Code:
    sudo smartctl -a /dev/sda > ~/Desktop/sda_health_before_test.txt
    Then run:
    Code:
    sudo smartctl -t long /dev/sda
    That command will immediately terminate while the HDD begins its self-test, and it could take quite a while. You can monitor the progress with:
    Code:
    sudo smartctl -a /dev/sda | grep -A 1 -i "self-test execution status"
    Once the above command says the test is done, then do:
    Code:
    sudo smartctl -a /dev/sda > ~/Desktop/sda_health_after_test.txt
    sudo smartctl -H /dev/sda
    And then post the results of those two files so we can see what your HDD's health is like at this point.
    Code:
    Self-test execution status:   
     (  73)	The previous self-test completed having
    	a test element that failed and the test
    I get that and it doesn't change (if i do it again after a while). Does the test still run or is something wrong ?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •