LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-30-2012, 05:17 AM   #1
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Rep: Reputation: 1
How to Locate and isolate Bad sectors in HDD


Hi All,
I am facing some problems with my hard disk due to some bad sectors (My O.S is ubuntu).

I Want to Locate the location of these Bad sectors, then isolate these bad sectors in a partition (not to be used), and install the O.S on a healthy partition.

I just did some steps (thanks to cliffordw) as he provide me the link "http://smartmontools.sourceforge.net/badblockhowto.html" but need some advice.

disk is failing self-tests at Logical Block Address LBA = 587529330
Code:
e33@e33:~$ sudo smartctl -l selftest /dev/sda
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%      3630         587529330
# 2  Extended offline    Aborted by host               80%      3630         -
# 3  Short offline       Aborted by host               10%      3630         -
Code:
e33@e33:~$ sudo fdisk -lu /dev/sda

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005dcba

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   607809535   303903744   83  Linux
/dev/sda2       607811582   625141759     8665089    5  Extended
/dev/sda5       607811584   625141759     8665088   82  Linux swap / Solaris
The partition /dev/sda1 start from 2048 till 607809535 and the problem at 587529330.
(320 GB = size of my Hard disk) x 587529330 / 607809535 = 309 GB.
so if I divide the Hard disk in two part:
- Part 1: 300 GB: O.S will be installed here.
- Part 2: 20 GB: will be ignored.

Is that okay?

Last edited by lee_can; 06-30-2012 at 05:23 AM.
 
Old 06-30-2012, 06:17 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,407
Blog Entries: 2

Rep: Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994Reputation: 3994
This will not really work. If there are bad sectors reported that means that the disk has already used up all spare sectors that are normally used to replace bad sectors (every disk will have them from time to time). This is in almost 99% of all cases a sign that the disk is dying. Replace the disk.
 
Old 06-30-2012, 06:52 AM   #3
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Thanks a lot TobiSGD, I will change the hard disk, but is there is a temporary solution for that?
what about low level format?
 
Old 06-30-2012, 07:00 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,042
Blog Entries: 1

Rep: Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367
Member Response

Hi,

You are living on the edge when you expect to use a failing HDD, eventually the failure will happen. Make a backup NOW and move to a new HDD.

Nothing but problems awaiting! Media failure will not be fixed by a low level format.
 
Old 06-30-2012, 07:12 AM   #5
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
Thanks gents for your prompt replies.
 
Old 06-30-2012, 02:25 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 11,086

Rep: Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362
Use the OEM hard drive diags. They can sometimes help you decide the state of the drive better.

Every or almost every hard drive maker offers programs to diag their drives. Some include tools to help make the drive last longer.

I know we used to have scsi drives last for years and years. They allowed you to do a new low level more easily. If the low level then failed, we would junk it only then.
 
Old 09-11-2012, 11:59 PM   #7
linuxquestions2012
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
try pbd

Try PBD(Partition Bad Disk) to isolate bad sectors and fix the bad sector problem
 
Old 09-15-2012, 07:05 AM   #8
Cooper618
LQ Newbie
 
Registered: Sep 2012
Location: Canada
Posts: 8

Rep: Reputation: 1
Go to My Computer and single click on your Hard Drive. Then right-click and select Properties.In the General Tab run Disk Cleanup.In the Tools Tab run Check Now under Error Checking, then run Defragment Now under Defragmentation.
 
Old 09-15-2012, 09:09 AM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,042
Blog Entries: 1

Rep: Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367Reputation: 1367
Member Response

Hi,

Welcome to LQ!
Quote:
Originally Posted by Cooper618 View Post
Go to My Computer and single click on your Hard Drive. Then right-click and select Properties.In the General Tab run Disk Cleanup.In the Tools Tab run Check Now under Error Checking, then run Defragment Now under Defragmentation.
That sounds a lot like the MicroSoft way.

Since the OP is using Ubuntu and it does sound like a 'HDD' failure, not a filesystem failure which could be handle by 'fsck' for a Gnu/Linux. As suggested the OP should backup if possible then run diagnostics to confirm the issue(s).

It would be best to replace a HDD that is displaying this type of issue/errors.
 
1 members found this post helpful.
Old 09-16-2012, 02:08 AM   #10
lee_can
Member
 
Registered: Mar 2011
Posts: 118

Original Poster
Rep: Reputation: 1
thank you gents for your kind useful replies.
The best way was to change the HDD

Regards
 
Old 09-26-2012, 01:10 AM   #11
Cooper618
LQ Newbie
 
Registered: Sep 2012
Location: Canada
Posts: 8

Rep: Reputation: 1
Quote:
Originally Posted by lee_can View Post
thank you gents for your kind useful replies.
The best way was to change the HDD

Regards
You are welcome mate
 
Old 01-27-2013, 05:59 AM   #12
linuxquestions2013
LQ Newbie
 
Registered: Jan 2013
Posts: 1

Rep: Reputation: Disabled
use PBD(Partition Bad Disk)

use PBD(Partition Bad Disk) to locate and isolate bad sectors of HDD
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bad sectors on HDD _Lee_ Linux - Hardware 6 03-28-2012 03:03 PM
HDD burn-in tester to locate bad sectors? Ulysses_ Linux - Server 2 04-01-2010 08:18 PM
[SOLVED] Bad Sectors In HDD Israfel2000 Linux - Hardware 17 02-08-2010 07:26 PM
Isolate bad sectors on an ext3 partition? Cinematography Linux - Hardware 4 05-04-2007 03:31 PM
Bad sectors in RAID 5 HDD arunabh_biswas Linux - Software 2 06-16-2006 12:25 PM


All times are GMT -5. The time now is 11:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration