FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-06-2011, 04:07 PM
Nikos Chantziaras
 
Default How do I show list of bad blocks on a disk?

Before leaving home, I started an fsck.ext4 on a filesystem (500GB) that
resides on a disk that I suspect is damaged:


fsck.ext4 -c -c -f /dev/sdb1

When I came back 10 hours later, it was still checking. After 2 hours
more (so it took 12 hours total) it finally finished. The output was:


e2fsck 1.41.14 (22-Dec-2010)
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done
Extra: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

Extra: ***** FILE SYSTEM WAS MODIFIED *****
Extra: 11/30531584 files (0.0% non-contiguous),
1966902/122096638 blocks

I'm not sure how to read this. Were there any bad blocks or not? Is
there a way to query the filesystem for the now known bad blocks? (The
"Updating bad block inode." message suggests that such a list is stored
directly inside the filesystem.)
 
Old 03-06-2011, 04:25 PM
Alex Schuster
 
Default How do I show list of bad blocks on a disk?

Nikos Chantziaras writes:

> Before leaving home, I started an fsck.ext4 on a filesystem (500GB) that
> resides on a disk that I suspect is damaged:
>
> fsck.ext4 -c -c -f /dev/sdb1
>
> When I came back 10 hours later, it was still checking. After 2 hours
> more (so it took 12 hours total) it finally finished. The output was

Anything about erros in dmesg or syslog?

> e2fsck 1.41.14 (22-Dec-2010)
> Checking for bad blocks (non-destructive read-write test)
> Testing with random pattern: done
> Extra: Updating bad block inode.
> Pass 1: Checking inodes, blocks, and sizes
> Pass 2: Checking directory structure
> Pass 3: Checking directory connectivity
> Pass 4: Checking reference counts
> Pass 5: Checking group summary information
>
> Extra: ***** FILE SYSTEM WAS MODIFIED *****
> Extra: 11/30531584 files (0.0% non-contiguous),
> 1966902/122096638 blocks
>
> I'm not sure how to read this. Were there any bad blocks or not? Is
> there a way to query the filesystem for the now known bad blocks? (The
> "Updating bad block inode." message suggests that such a list is stored
> directly inside the filesystem.)

dumpe2fs -b /dev/sdb1 probably also works for ext4.

bablocks /dev/sdb2 will do a read-only check of the whole partiton for
bad blocks. Use option -n for a non-destructive write mode.
I qalso like to add options -s and -v to see the progress. I redirect
the output into a file then, because output of progress and bad blocks
will overlap: badblocks -sv /dev/sdb1 > sdb1.bad
See man badblocks for more information.

Wonko
 
Old 03-06-2011, 04:51 PM
Nikos Chantziaras
 
Default How do I show list of bad blocks on a disk?

On 03/06/2011 07:25 PM, Alex Schuster wrote:

Nikos Chantziaras writes:


Before leaving home, I started an fsck.ext4 on a filesystem (500GB) that
resides on a disk that I suspect is damaged:

fsck.ext4 -c -c -f /dev/sdb1

When I came back 10 hours later, it was still checking. After 2 hours
more (so it took 12 hours total) it finally finished. The output was


Anything about erros in dmesg or syslog?


Nope. All clean.



[...]
Were there any bad blocks or not? Is
there a way to query the filesystem for the now known bad blocks? (The
"Updating bad block inode." message suggests that such a list is stored
directly inside the filesystem.)


dumpe2fs -b /dev/sdb1 probably also works for ext4.


Thanks. I just tried and it prints nothing. I guess that means no bad
blocks were found.


(Rant: Don't you just love programs that instead of explicitly telling
you that all is OK, they just stay silent, leaving you wondering whether
they actually work at all? Argh...)
 
Old 03-06-2011, 05:14 PM
Florian Philipp
 
Default How do I show list of bad blocks on a disk?

Am 06.03.2011 18:07, schrieb Nikos Chantziaras:
> Before leaving home, I started an fsck.ext4 on a filesystem (500GB) that
> resides on a disk that I suspect is damaged:
>
> fsck.ext4 -c -c -f /dev/sdb1
>
> When I came back 10 hours later, it was still checking. After 2 hours
> more (so it took 12 hours total) it finally finished. The output was:
>
> e2fsck 1.41.14 (22-Dec-2010)
> Checking for bad blocks (non-destructive read-write test)
> Testing with random pattern: done
> Extra: Updating bad block inode.
> Pass 1: Checking inodes, blocks, and sizes
> Pass 2: Checking directory structure
> Pass 3: Checking directory connectivity
> Pass 4: Checking reference counts
> Pass 5: Checking group summary information
>
> Extra: ***** FILE SYSTEM WAS MODIFIED *****
> Extra: 11/30531584 files (0.0% non-contiguous),
> 1966902/122096638 blocks
>
> I'm not sure how to read this. Were there any bad blocks or not? Is
> there a way to query the filesystem for the now known bad blocks? (The
> "Updating bad block inode." message suggests that such a list is stored
> directly inside the filesystem.)
>
>

When there is nothing else reported, there was no error. "FILE SYSTEM
WAS MODIFIED" usually just means that a directory "lost+found" was created.
 
Old 03-06-2011, 05:44 PM
Francesco Talamona
 
Default How do I show list of bad blocks on a disk?

On Sunday 06 March 2011, Florian Philipp wrote:
> Am 06.03.2011 18:07, schrieb Nikos Chantziaras:
> > Before leaving home, I started an fsck.ext4 on a filesystem (500GB)
> > that
> >
> > resides on a disk that I suspect is damaged:
> > fsck.ext4 -c -c -f /dev/sdb1
> >
> > When I came back 10 hours later, it was still checking. After 2
> > hours
> >
> > more (so it took 12 hours total) it finally finished. The output was:
> > e2fsck 1.41.14 (22-Dec-2010)
> > Checking for bad blocks (non-destructive read-write test)
> > Testing with random pattern: done
> > Extra: Updating bad block inode.
> > Pass 1: Checking inodes, blocks, and sizes
> > Pass 2: Checking directory structure
> > Pass 3: Checking directory connectivity
> > Pass 4: Checking reference counts
> > Pass 5: Checking group summary information
> >
> > Extra: ***** FILE SYSTEM WAS MODIFIED *****
> > Extra: 11/30531584 files (0.0% non-contiguous),
> > 1966902/122096638 blocks
> >
> > I'm not sure how to read this. Were there any bad blocks or not?
> > Is there a way to query the filesystem for the now known bad
> > blocks? (The "Updating bad block inode." message suggests that
> > such a list is stored directly inside the filesystem.)
>
> When there is nothing else reported, there was no error. "FILE SYSTEM
> WAS MODIFIED" usually just means that a directory "lost+found" was
> created.

That would be interactive, and it would show up in the console output:

fsck from util-linux-ng 2.18
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found. Create<y>? yes

Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/mapper/sda5: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/sda5: 177646/4481024 files (6.7% non-contiguous),
10916521/17920370 blocks

Anyway I don't worry about the fact that the filesystem was modified, as
long as the program doesn't ask for user intervention. As you can see in
my case there was a directory optimization.

Fsck took a very long time because of "-c" option (you are not taking
advantage of the fact that the disk is almost empty), and you specified
it twice, so "the bad block scan will be done using a non-destructive
read-write test." as stated in the man page, so in the end, nothing to
worry about WRT filesystem.

You should also check SMART status.

Bye
Francesco

--
Linux Version 2.6.37-gentoo-r1, Compiled #4 SMP PREEMPT Sat Mar 5
16:45:57 CET 2011
Two 2.8GHz AMD Athlon 64 Processors, 4GB RAM, 11255 Bogomips Total
aemaeth
 
Old 03-07-2011, 01:39 AM
james
 
Default How do I show list of bad blocks on a disk?

Nikos Chantziaras <realnc <at> arcor.de> writes:


> Before leaving home, I started an fsck.ext4 on a filesystem (500GB) that
> resides on a disk that I suspect is damaged:

smartmontools may be of interest to you....

http://smartmontools.sourceforge.net/badblockhowto.html


hth,
James
 
Old 03-07-2011, 05:25 AM
Thanasis
 
Default How do I show list of bad blocks on a disk?

on 03/06/2011 07:07 PM Nikos Chantziaras wrote the following:
> Before leaving home, I started an fsck.ext4 on a filesystem (500GB)
> that resides on a disk that I suspect is damaged:
>
> fsck.ext4 -c -c -f /dev/sdb1
>
You can check the SMART (Self-Monitoring, Analysis, and Reporting
Technology) data, which is built-in in all hard drives today, and allows
you to see the status or overall “health” of a hard drive.

( smartctl -a /dev/sdb )
 
Old 03-07-2011, 05:45 AM
Dale
 
Default How do I show list of bad blocks on a disk?

Thanasis wrote:

on 03/06/2011 07:07 PM Nikos Chantziaras wrote the following:


Before leaving home, I started an fsck.ext4 on a filesystem (500GB)
that resides on a disk that I suspect is damaged:

fsck.ext4 -c -c -f /dev/sdb1



You can check the SMART (Self-Monitoring, Analysis, and Reporting
Technology) data, which is built-in in all hard drives today, and allows
you to see the status or overall “health” of a hard drive.

( smartctl -a /dev/sdb )




You can also tell it to run a selftest too. Example commands to look into:

smartctl -t long /dev/<your drive here>

and for the results, usually a good while later:

smartctl -l selftest /dev/<your drive here>

If you think heat may be a issue, try this:

smartctl -a /dev/<your drive here> | grep Temp

With all this, you should be able to find out if you are good to go or
got a drive going bad.


Dale

:-) :-)
 

Thread Tools




All times are GMT. The time now is 02:44 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org