LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-22-2022, 03:15 PM   #1
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Rep: Reputation: 144Reputation: 144
Question badblocks bug


I have a brand new 8tb hd and after partitioning it, formatting it ext4 and copying data to it, I thought I'd run badblocks on it.
I get the following error. after running badblocks -s /dev/sdb

Code:
badblocks: Value too large for defined data type invalid end block (7814026584): must be 32-bit value
I am running on slackware 15.0 64bit.

has anyone come across this error before or come accross a work-arround.?
should it be reported upstream?
 
Old 10-23-2022, 05:41 AM   #2
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
You weren't very clear about "partitioning it" .. you're basically forced to use GPT on that thing.
And no mention of brand/model, no mention of how BIOS sees the drive, whether or not it's set to ACPI or something else?
Maybe run extended smartctl test to make sure it's not a faulty drive first?
But if I had to guess based on what little info you've shared, it's probably the partition table that's messed up.
 
Old 10-23-2022, 08:14 AM   #3
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Original Poster
Rep: Reputation: 144Reputation: 144
elcore: the drive has a single ext4 partition, and yes, I had to use gpt as it is over 2tb in size.
it's a wd drive. it is not being used as a boot drive (I have a separate dos partion style 2tb drive for swap and root mount)

Apparently badblocks is using 32bit vars for it's block counts. that could be fixed in source, but maybe there is a reason why not.
I am aware of 48bit lba as well as 32bit lba, and would have thought it could handle either, but maybe not.

The workaround is to specify the blocksize in the badblocks command (rather than leaving it at the default 512bytes.) The actual blocksize used can be obtained from
Code:
blockdev --getbsz /dev/sdx
(where /dev/sdx is your drive)
then use (in my case)
Code:
badblocks -s -b 4096 /dev/sdx
this allows the number of blocks to be small enough.

I get the impression though that on even larger drives, such as 20TB the block size will either be large enough that lots of space is wasted with small files; or if bs is capped at 4k or 8k, badblocks will again hit it's 32bit limit.
 
2 members found this post helpful.
Old 10-23-2022, 08:29 AM   #4
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Seems like a limitation of badblocks, never did hit that one personally since the most block size on any drive I've had is 2048.
I've still got a few externals with 64 block size so.. when mkfs.vfat changed to 2048 default, I've had a similar issues.
Changing the default size is really up to upstream badblocks developer.
 
Old 10-23-2022, 08:46 AM   #5
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495

Original Poster
Rep: Reputation: 144Reputation: 144
i was also concerned in case it affected the slackware installer, but the badblocks checking is always used as a -c parameter of the actual command used, eg mkswap or mke2fs etc, so I can't tell how that binary calls badblocks without delving into their source code as well. If it proves a problem no doubt it will have to be done, but as I added the large drive after installing slackware, and formatted the partition manually, I didn't test the installer on that (check for badblocks option).
 
Old 10-24-2022, 03:36 PM   #6
mishehu
Member
 
Registered: Aug 2014
Location: USA
Distribution: Slackware (where ::1 is), Centos, Debian
Posts: 106

Rep: Reputation: 158Reputation: 158
I'd be rather surprised that an 8TB drive lacked SMART support. Why do people still use badblocks when smartctl is available? I know the installer still offers the badblocks option, but would it not make more sense for the installer to offer instead the option of SMART short and SMART extended/long tests if SMART support was detected?
 
1 members found this post helpful.
Old 10-24-2022, 08:26 PM   #7
1337_powerslacker
Member
 
Registered: Nov 2009
Location: Kansas, USA
Distribution: Slackware64-15.0
Posts: 862
Blog Entries: 9

Rep: Reputation: 592Reputation: 592Reputation: 592Reputation: 592Reputation: 592Reputation: 592
I was heartened to see you in a new thread, and in a way, I am not surprised to see you discussing hard drives, as you are known to me as the guy who applied a patch to LILO so we could use it with NVMe drives. You'll always be the hero in my book for doing that. Anyway, I hope you get your problem resolved shortly.

Happy Slacking!
 
  


Reply

Tags
badblocks, slackware 15.0



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
[SOLVED] How can disk reporting badblocks>0 suddenly become badblocks==0? kaza Linux - Hardware 2 04-09-2019 06:45 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 04:55 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