LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-26-2006, 02:20 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
trouble using badblocks


im on centos 4.4 I still can't seem to figure out how to use badblocks. I've read all sorts of things on google and everywhere I can't figure it out. (im trying to verify if the hard drive on my laptop is bad or if it is something else) i don't know what parameters to send badblocks, i always get an invalid number of blocks thing for whatever i put in for the -b argument

Ive been killing myself over this for a month now, I don't mind replacing the hard drive if it's bad but I can't seem to find any evidence that prooves the hard drive is bad.

ive run software off of bootup cds that are supposed ot test the hard drive, they all show up saying the hard drive is fine.

My ultimate goal is to dualboot windows XP and linux on the laptop. windows will not install because it says the hard drive is corrupt, but centOS installs just fine. (and i haven't encountered any problems yet while using it)

I've heard someone say the ram might be bad and windows is just giving a mis diagnosis, but I haven't been able to verify any piece of hardware being faulty.
 
Old 12-26-2006, 07:14 PM   #2
runnerfrog
Member
 
Registered: Jul 2006
Location: Paraná, Argentina
Distribution: Frugalware 0.6 (Terminus) - Kubuntu 7.04 (Feisty Fawn Herd 5)
Posts: 217

Rep: Reputation: 31
Quote:
Originally posted by MrSako:
im on centos 4.4 I still can't seem to figure out how to use badblocks.
[...]
I don't mind replacing the hard drive if it's bad but I can't seem to find any evidence that prooves the hard drive is bad.
Hi. Since you want to do it through block size and not give enough info, I have to asume your filesystem is reiserfs.
To get the block size for a reiserfs filesystem you do: debugreiserfs /dev/your_device
To know if it has badblocks: /sbin/badblocks -v -o /badlist_devicename -b <reiserfs-block-size> /dev/your_device
That results in giving you the list of bad blocks for the device in the file "/badlist_devicename"
to fix the list of bad blocks: reiserfsck --badblocks /badlist_devicename /dev/your_device
to rebuild a reiserfs partition: reiserfsck --rebuild-tree --bad-badblocks badlist_devicename /dev/your_device

Suggestions: save the bad blocks file list in a diskette, you never know when you have to format during GNU/Linux install using that list. For receiving better answers or answers at all you should post helpful outputs to this matters, like "# df -Th".
Quote:
My ultimate goal is to dualboot windows XP and linux on the laptop. windows will not install because it says the hard drive is corrupt, but centOS installs just fine. (and i haven't encountered any problems yet while using it)
If you need a clean partition to a propietary OS, that OS surely has to have a formatting option with blocks checking enabled. Using badblocks to check or fix a vfat filesystem doesn't need the blocksize parameter. I don't know if badblocks works over ntfs.
 
Old 12-28-2006, 11:09 PM   #3
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by runnerfrog
Hi. Since you want to do it through block size and not give enough info, I have to asume your filesystem is reiserfs.
To get the block size for a reiserfs filesystem you do: debugreiserfs /dev/your_device
To know if it has badblocks: /sbin/badblocks -v -o /badlist_devicename -b <reiserfs-block-size> /dev/your_device
That results in giving you the list of bad blocks for the device in the file "/badlist_devicename"
to fix the list of bad blocks: reiserfsck --badblocks /badlist_devicename /dev/your_device
to rebuild a reiserfs partition: reiserfsck --rebuild-tree --bad-badblocks badlist_devicename /dev/your_device

Suggestions: save the bad blocks file list in a diskette, you never know when you have to format during GNU/Linux install using that list. For receiving better answers or answers at all you should post helpful outputs to this matters, like "# df -Th".

If you need a clean partition to a propietary OS, that OS surely has to have a formatting option with blocks checking enabled. Using badblocks to check or fix a vfat filesystem doesn't need the blocksize parameter. I don't know if badblocks works over ntfs.

when i try to use debugreiserfs i get a command not found error

in my /sbin directory there is a debugfs do you think that is the same/similar?

Last edited by MrSako; 12-28-2006 at 11:11 PM.
 
Old 12-29-2006, 01:16 PM   #4
runnerfrog
Member
 
Registered: Jul 2006
Location: Paraná, Argentina
Distribution: Frugalware 0.6 (Terminus) - Kubuntu 7.04 (Feisty Fawn Herd 5)
Posts: 217

Rep: Reputation: 31
Quote:
Originally posted by MrSako:
in my /sbin directory there is a debugfs do you think that is the same/similar?
No, no, it is not the same, debugfs it's an ext2/ext3 interactive file system debugger. debugreiserfs is included in the reiserfs package, maybe into reiserfs-utils depending on the distro. It's pretty much impossible it isn't there, try "debugreiserfs", as root, without the path, do not use the /sbin/ before.
This confirms your filesystem is reiserfs, isn't? It's not the same procedure for reiserfs than for any other filesystem, check with df -hT to be sure, or read the /etc/fstab.
 
  


Reply



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 rotty Slackware 2 10-21-2006 07:30 AM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:57 PM.

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