Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-04-2008, 02:37 PM   #1
Registered: Sep 2007
Posts: 31

Rep: Reputation: 15
I need help with fixing bad blocks


My computer has the following partitions:

root@ubuntu:/home/ubuntu# fdisk -lu

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x01840183

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    20482874    10241406   83  Linux
/dev/sda2        20482875    20996954      257040   82  Linux swap / Solaris
/dev/sda3        20996955   156296384    67649715   83  Linux

Disk /dev/sdb: 30.7 GB, 30738677760 bytes
255 heads, 63 sectors/track, 3737 cylinders, total 60036480 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x016b35db

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    60034904    30017421   83  Linux
Since I was having I/O problems which froze the computer I did a check on them and I found this:

root@ubuntu:/home/ubuntu# fsck.reiserfs /dev/sda1
reiserfsck 3.6.19 (2003

** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at **

Will read-only check consistency of the filesystem on /dev/sda1
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
reiserfsck --check started at Tue Mar  4 16:20:04 2008
Replaying journal..
Reiserfs journal '/dev/sda1' in blocks [18..8211]: 0 transactions replayed
Checking internal tree..
The problem has occurred looks like a hardware problem. If you have
bad blocks, we advise you to get a new hard drive, because once you
get one bad block  that the disk  drive internals  cannot hide from
your sight,the chances of getting more are generally said to become
much higher  (precise statistics are unknown to us), and  this disk
drive is probably not expensive enough  for you to you to risk your
time and  data on it.  If you don't want to follow that follow that
advice then  if you have just a few bad blocks,  try writing to the
bad blocks  and see if the drive remaps  the bad blocks (that means
it takes a block  it has  in reserve  and allocates  it for use for
of that block number).  If it cannot remap the block,  use badblock
option (-B) with  reiserfs utils to handle this block correctly.

bread: Cannot read the block (1114121): (Input/output error).

Aborted (core dumped)
Then I tried this:

root@ubuntu:/home/ubuntu# badblocks /dev/sda1
My other partitions did not report any errors.

Interestingly, I also tried a smart tools check which my partition passed:

root@ubuntu:/home/ubuntu# sudo smartctl -H /dev/sda1
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is

SMART overall-health self-assessment test result: PASSED

root@ubuntu:/home/ubuntu# smartctl -i /dev/sda1
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is

Model Family: Maxtor DiamondMax D540X-4K family
Device Model: MAXTOR 4K080H4
Serial Number: 674120623352
Firmware Version: A08.1500
User Capacity: 80,026,361,856 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 5
ATA Standard is: ATA/ATAPI-5 T13 1321D revision 1
Local Time is: Tue Mar 4 17:42:35 2008 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
I am currently running my system off a live-CD so I am able to access the web (and this forum).

My questions are:

1) Is there a way to map and isolate the bad blocks and keep on living happily with my hard drive


2) what is the safest way to clone my partition to another hard disk (which I rather not do, since I am very short on cash)

Of course, if I have missed anything, please let me know how I could otherwise fix my computer.

Many thanks in advance,



/dev/sda1 is my / partition with the system on it
/dev/sda2 is my /swap partition
/dev/sda2 is my /home partition with my data on it and this is the one I *really* would like to save, if possible.
/dev/sdb1 is my /usr partition
Old 03-04-2008, 06:30 PM   #2
LQ Guru
Registered: Feb 2003
Location: Mineral, Virginia
Distribution: Debian 8
Posts: 7,880

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
Originally Posted by mamadu.bwana View Post

1) Is there a way to map and isolate the bad blocks and keep on living happily with my hard drive
All of your bad blocks seem to be in one fairly small area the hard drive in the /dev/sda1 partition. You could set up a small partition which includes all of the bad blocks and stop using that partition. Don't even try to format the bad partition. I did this a long time ago for a friend and he kept using the two thirds of the hard drive that were still good for at least another two years before I lost contact with him.

Originally Posted by mamadu.bwana View Post

2) what is the safest way to clone my partition to another hard disk (which I rather not do, since I am very short on cash)
I recommend that you use cp to clone a file system whether you copy it to another partition on the same hard drive or a partition on another hard drive. i think that your bad blocks are all in /dev/sda1:

boot a live CD

make directories for the from and to partitions:

mkdir /from
mkdir /to

mount your old and new partitions:

mount -t reiserfs /dev/sda1 /from

mount -t reiserfs (wherever you are saving it) /to

cp -ar /from/* /to

Then change /etc/fstab /boot/grub/menu.lst on your /to partition. chroot to /to

chroot /to

Then use grub-install to install the new grub to the MBR.

If cp won't work because of the bad blocks then you may have to make several partial copies to get around the problem.

Steve Stites

Last edited by jailbait; 03-04-2008 at 06:32 PM.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bad blocks bong.mau Linux - General 1 11-16-2005 03:17 PM
ReiserFS with bad blocks bruce ford Linux - Software 2 07-23-2005 05:15 AM
Fixing a Bad Superblock PionexUser Linux - General 6 11-14-2003 03:52 PM
fixing bad blocks/sectors warheros Linux - Software 3 07-19-2003 11:01 PM
Fixing Bad Blocks PionexUser Linux - Newbie 1 07-19-2003 05:00 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:58 PM.

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