LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-16-2005, 11:35 AM   #1
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Rep: Reputation: 47
badblocks time


My sturdy 20 GB Wester Digital Caviar Drive just failed. Fortunately Linux gave me some warning signs (Buffer I/O error) before I started having major problems and I was able to back up important data. My drive has 4 partitions that I made with the Western Digital Low Level Format Software. Here it is:

cfdisk 2.12p

Disk Drive: /dev/hda
Size: 20525137920 bytes, 20.5 GB
Heads: 255 Sectors per Track: 63 Cylinders: 2495

Name Flags Part Type FS Type [Label] Size (MB)
----------------------------------------------------------------------------------------------------
hda1 Boot Primary Linux ext3 [/boot] 98.71
hda5 Logical Linux swap / Solaris 641.58
hda6 Logical Linux 197.41
hda7 Logical Linux ext3 [/] 19584.40
----------------------------------------------------------------------------------------------
The fdisk output is a bit different and shows that hda5-7 are a part of hda2 and was formatted as W95 Ext'd:

Disk /dev/hda: 20.5 GB, 20525137920 bytes
255 heads, 63 sectors/track, 2495 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 12 96358+ 83 Linux
/dev/hda2 13 2495 19944697+ f W95 Ext'd (LBA)
/dev/hda5 13 90 626503+ 82 Linux swap / Solaris
/dev/hda6 91 114 192748+ 83 Linux
/dev/hda7 115 2495 19125351 83 Linux

I'm hoping to salvage this drive. fsck shows no problem on hda1 and 6 and says errors are on hda7 (not sure how to check swap space). Right now I'm using badblocks on hda7 (19.5 GB) to mark the bad blocks in a map. I hear the harddrive working but I'm not getting any progress indication. Any idea how long this will take me on a 40 pin IDE connection and a 600 MHz P3?

Here's what I typed:

badblocks -sv -i - /dev/hda7
 
Old 07-16-2005, 01:27 PM   #2
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
i think you just need : badblocks -sv /dev/hda7

the -i option is to specifie an input file that contains
the block numbers that are already known to be bad.

you could also run fsck with the "-c" option, to scan for bad blocks.

egag
 
Old 07-16-2005, 01:45 PM   #3
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
fsck -c /dev/hda7 says my superblock is bad and wants me to specify the superblock location-can the superblock be random? I'm thinking one of the blocks towards the end of my 19.5 GB partition. Which block is that?
 
Old 07-16-2005, 01:51 PM   #4
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
i'm sorry for not being clear,
i meant " e2fsck " for ext2/3 and "reiserfsck" for reiserfs.

egag
 
Old 07-16-2005, 01:55 PM   #5
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
I understood what you meant-e2fsck -c /dev/hda7 doesn't like my superblock and wants me to specify another. Can I use any block? Any which block is toward the end of my partition?

EDIT:

It works now-I had badblocks on it and I guess it fixed the superblock. I did a -C 0 so that I could see the progress, but it says it is read only....is it going to mark the badblocks?

This is what I typed:

e2fsck -c -C 0 /dev/hda7

Last edited by linuxhippy; 07-16-2005 at 02:07 PM.
 
Old 07-16-2005, 03:52 PM   #6
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
i think you should take a look at " man e2fsck "

it sais :
-----------
-b superblock
Instead of using the normal superblock, use an alternative
superblock specified by superblock. This option is normally used
when the primary superblock has been corrupted. The location of the
backup superblock is dependent on the filesystem's blocksize. For
filesystems with 1k blocksizes, a backup superblock can be found at
block 8193; for filesystems with 2k blocksizes, at block 16384; and
for 4k blocksizes, at block 32768.

Additional backup superblocks can be determined by using the mke2fs
program using the -n option to print out where the superblocks were
created. The -b option to mke2fs, which specifies blocksize of the
filesystem must be specified in order for the superblock locations
that are printed out to be accurate.
-------------

but i guess you got it working...

egag
 
Old 07-16-2005, 05:00 PM   #7
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
This is taking forever-I imagine it won't be done till tomorrow. Does it actually block off bad blocks from being used by Linux even though it says "Read Only"?

This is what I typed:

e2fsck -c -C 0 /dev/hda7
 
Old 07-16-2005, 05:24 PM   #8
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
how large is that partition ?

egag
 
Old 07-16-2005, 05:26 PM   #9
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
19.5 GB
 
Old 07-16-2005, 05:39 PM   #10
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
that can't take that long.
i think that disk is nogood anymore.

i would stop it, and go to the W.D. website.
they will have some kind of low-level checking tool.
download it, and check the disk with that program.

egag
 
Old 07-16-2005, 05:48 PM   #11
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
The disks (I've used 5) have always been slow on this pc in Linux. I have an old pc-600 MHz and this is a 40 pin IDE connection.

I have the WD diagnostic tools already and did a LLF first with that. It could not fix my bad blocks, though.

Also, the pc Win guy at work recommended scandisk. When I said it was for a 20 GB drive he said scandisk would probably take at least 9 hours. I'm at 6 hours and not half way done, though. Anyway, he was thinking it would take a real long time.

What I'm wondering, though. Is this similar to scandisk in that it will mark these blocks as unusable?

Last edited by linuxhippy; 07-16-2005 at 05:52 PM.
 
Old 07-16-2005, 06:03 PM   #12
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
i don't think it should take so long...
IIRC the Slackware setup script runs a badblock check,
and i cannot remember it taking more than a few minutes.

i have a P1-200mhz pc with a 20 GB hd.
that one was also checked with a badblock check.
i believe scandisk is MS software, so that winguy might be right about that. ( 9 hrs. )

...but a badblock check will mark all bad parts as unusable...

egag
 
Old 07-16-2005, 06:10 PM   #13
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
If this doesn't work, I'll be putting a new drive in. May buy a new one...not sure. My pc is 6 years old and I've upgraded all the hardware in it except for the motherboard and nothing overheats (I put a new powerpack/fan in the pc). Is it probable that anything besides the harddrive will go bad in an old pc....or should I put money in savings for a new pc?
 
Old 07-16-2005, 06:21 PM   #14
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
if you're happy with the speed it has, then just keep it.
any disk you buy now will be usable in a new setup.

egag
 
Old 07-16-2005, 06:25 PM   #15
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
Actually, I have the original Conner 4 GB drive that came with it. I already have a 2nd drive in there-a Fujitsu 6 GB. I would have 10 GB which is plenty. The Conner drive that came with my pc was faster in Win98SE than with Linux-you're saying that's not your experience?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
badblocks trouble gsgleason Linux - Hardware 12 03-03-2005 09:34 PM
Badblocks odd Linux - Software 1 06-03-2004 01:54 PM
badblocks check... wrongman Linux - Hardware 3 05-20-2004 10:38 AM
Badblocks and using dd? sthemage Linux - General 1 12-26-2003 02:52 PM
When and how to use e2fsck and badblocks Silly22 Linux - Newbie 5 05-29-2002 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:44 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration