LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-12-2006, 11:03 AM   #1
liutabme
LQ Newbie
 
Registered: Oct 2005
Posts: 26

Rep: Reputation: 15
Howto map a badblock number to an inode in reiserfs?


Boot messages tell me I have one bad block on /dev/hda9 which is /home.
Bad Block Number 385247 (Slackware 10.1, kernel 2.16.16.16 reiserfs3.6.18)

Since it is only 1 block I decided to try writing to the bad block to see if will be reallocated from a reserve (one option suggested by the boot messages).

But first...

I did a bad block listing after umounting the partition (but stayed in multi-user mode) first getting reiserfs-blocksize 4096 from debugreiserfs:
#debugreiserfs /dev/hda9
#badblocks -b 4096 /dev/hda9

This now tells me I have 2 bad blocks:
Numbers: 385247 385216

Since I will be destroying data in the bad blocks I'd like to know what dirs and files the 385216 block corresponds to. Also, I'd like to ensure that it is a bad block before I do write to it.

I have identified the dirs for the first block [385247] using the inode numbers in syslog. Seems that they correspond to an encrypted dir and its counterpart.

Questions:
1.How do I get the inode number(s) from the block number 385216 so I can get the files from the inode? (Read that icheck (& ncheck) might work but I think they are Debian.)
2.Alternatively, how might I get the inode nos from the LBA for block no 385216?


Thanks

Last edited by liutabme; 08-13-2006 at 07:03 AM.
 
Old 08-13-2006, 10:13 PM   #2
davidsrsb
Member
 
Registered: Oct 2003
Location: Kuala Lumpur, Malaysia
Distribution: Slackware 13.37 current
Posts: 770

Rep: Reputation: 33
Modern drives hide bad blocks from the filesystem until things are getting really bad.
Have a look at the smartmon status of your drive and also get the (usually dos mode) diagnostic test software from your drive maker.
If the drive is on its way out there is nothing to be done but buy a new one quickly and get your data off before its too late
 
Old 08-14-2006, 03:05 AM   #3
liutabme
LQ Newbie
 
Registered: Oct 2005
Posts: 26

Original Poster
Rep: Reputation: 15
Regardless of whether the disk is replaced, I would still like to know
where the bad block is in the file system (then I can check my backup
is OK (I have already done a tar of the whole disk) The files on the bad
block that I have identified I don't mind losing.
I know reiserfs people advise replacing the disk as a first option, but also suggest writing to it to reallocate the bad sector.
The disk is only a few months old, so I'd like to try this first since, if it worked and continued to work, this would be quicker.
As to the suggestion of running smartcl, I had already done the short test, though it didn't show any errors. I assume the drive maker software would not identify the files affected, which is what I need at the moment.
I know there is some question about the ability of Reiserfs to recover from bad blocks, I never had a problem before with the ext2 fs. After this I am wondering whether to switch to ext3.

Anyway, does anyone know the answer to the first questions???.
 
  


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
Can two files have the same inode number? sambyte Linux - Newbie 5 02-04-2009 07:27 AM
Error with cpio: truncating inode number abefroman Linux - Software 2 08-30-2006 11:52 AM
inode number in kernel space manali Programming 7 02-27-2006 11:59 AM
iNode number, how does it change? saudoi Solaris / OpenSolaris 4 05-22-2005 05:38 AM
What can change an inode number? nc101 Linux - General 2 01-03-2005 11:29 AM

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

All times are GMT -5. The time now is 09:59 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