Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-04-2020, 05:50 PM
|
#1
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,147
|
Why does badblocks check more blocks than the disk has?
badblocks finds 80,475,544 bad blocks.
Code:
dumpe2fs -b /dev/sdb1
returns no blocks.
Code:
e2fsck -L BadBlockList /dev/sdb1
returns
Quote:
Bad block xxxx out of range; ignored
|
for every entry in BadBlockList.
Code:
dumpe2fs -x /dev/sdb1
returns .
The lowest block in BadBlockList is 36,744,256.
I see a problem:
Code:
badblocks /dev/sdb1
reports
Quote:
Checking blocks 0 to 117219799
|
- way too many. Where does it get this number?
Last edited by RandomTroll; 04-04-2020 at 10:46 PM.
Reason: More explicit
|
|
|
04-04-2020, 06:00 PM
|
#2
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.5
Posts: 5,843
|
Please show us the exact commands you're running. On my 'puter, all of those commands require the specification of a device name, and simply return syntax instructions without one.
I also note this in the dumpe2fs man page
Code:
Note: When used with a mounted filesystem, the printed information may be old or inconsistent.
and
Code:
-x print the detailed group information block numbers in hexadecimal format
|
|
|
04-04-2020, 10:52 PM
|
#3
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,147
Original Poster
|
Quote:
Originally Posted by scasey
Please show us the exact commands you're running. On my 'puter, all of those commands require the specification of a device name, and simply return syntax instructions without one.
|
I thought anyone could figure that out, but I put them in for you.
Quote:
Originally Posted by scasey
I also note this in the dumpe2fs man page
Code:
Note: When used with a mounted filesystem, the printed information may be old or inconsistent.
|
The filesystem was not mounted.
Quote:
Originally Posted by scasey
and
Code:
-x print the detailed group information block numbers in hexadecimal format
|
[/quote]
group information block numbers, not the summary information. -x was irrelevant to the information I reported.
|
|
|
04-05-2020, 01:12 AM
|
#4
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.5
Posts: 5,843
|
OK. Not at my ‘puter just now, but please review the man pages about the differences in default block sizes used in the various tools.
|
|
|
04-05-2020, 09:05 AM
|
#5
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,147
Original Poster
|
Quote:
Originally Posted by scasey
please review the man pages about the differences in default block sizes used in the various tools.
|
I had to do that in the first place, as I rarely use these tools. The information I reported is correct and in the same base. The question is 'whence gets badblocks the number of blocks to check?' It uses too-high a number for this disk, more than 3 times the number dumpe2fs reports, which corresponds to the size of the disk as reported by the documentation, thus reports 87 million bad blocks, because they aren't there.
|
|
|
04-05-2020, 09:35 AM
|
#6
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,804
|
Read them again, especially the part of the e2fsck manpage that reads: "Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results." and the part of the badblocks manpage that reads: "-b block-size
Specify the size of blocks in bytes. The default is 1024." and note that "0 to 117219799" is 117,219,800 blocks, which is exactly 4 times the filesystem block count of 29,304,950.
|
|
2 members found this post helpful.
|
04-06-2020, 01:05 AM
|
#7
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,147
Original Poster
|
Quote:
Originally Posted by rknichols
Read them again, especially the part of the e2fsck manpage that reads: "Note that the block numbers are based on the blocksize of the filesystem. Hence, badblocks(8) must be given the blocksize of the filesystem in order to obtain correct results." and the part of the badblocks manpage that reads: "-b block-size
Specify the size of blocks in bytes. The default is 1024." and note that "0 to 117219799" is 117,219,800 blocks, which is exactly 4 times the filesystem block count of 29,304,950.
|
That portion of the man page of e2fsck goes on to say
Quote:
it is much simpler and safer to use the -c option to e2fsck.
|
I ran badblocks only because 'e2fsck -c' failed in the same way, tried to correct all 87 million errors. And I had an off-by-one error dividing 117219799 by 29304950. So I really need to use the -B on e2fsck. Thanks.
|
|
|
04-06-2020, 01:31 PM
|
#8
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,147
Original Poster
|
dumpe2fs reports the correct block size - how can e2fsck & badblocks get it wrong?
|
|
|
All times are GMT -5. The time now is 03:43 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|