Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is there a safer (idiot proof) way to run badblocks destructively?

Featured Replies

I recently bought some refurbished drives and I wanted to run `badblocks -wsv -b 4096 /dev/disk/by-id/whatever-abc` but I ran it on an array drive on accident. I kicked off badblocks, started a dozen docker services, changed over to the unraid main tab and that's when I saw that I had just run badblocks on the wrong drive. I took the array offline, unassigned the drive, started the array without the drive, and ran `xfs_repair` on the emulated drive.

 

In case you're curious `xfs_repair` seems to have fixed it.

```

bad primary superblock - bad magic number !!!

attempting to find secondary superblock...
.found candidate secondary superblock...
verified secondary superblock...
writing modified primary superblock

```

 

Anyways, does anyone have a safer way to run badblocks? Maybe a script that objects if the drive is in the array or something? The closest I found in the forums was this saying that it's not going to happen in UD.

 

Thanks! Backup you data, haha!

  • Community Expert

Badblocks is basically meaningless with modern drives since any media error will be handled and compensated for internally by the drive, the OS / badblocks will never know. Preclear does all that's needed, if something's wrong it'll reflect in SMART.

Edited by Kilrah

  • Author

It's true; I do not understand how hard drives work. It's very confusing. Badblocks does four passes over the drive writing a pattern and reading it back on each pass. I have a drive that had no errors for the first pass writing and reading 0xaa but failed halfway through the second pass writing and reading 0x55. That makes me suspicious that a preclear is not enough.

  • Community Expert
14 hours ago, NominallySavvyTechPerson said:

I recently bought some refurbished drives

I think you need to ask yourself some questions.  

  1. What is a refurbished drive?
  2. What was done to it to make it refurbished?
  3. The company that did the 'refurbishing'  have a reputation for doing proper screening and testing of their product?
  4. Do they warranty their product and what are the terms of that warranty?

 

14 hours ago, NominallySavvyTechPerson said:

I have a drive that had no errors for the first pass writing and reading 0xaa but failed halfway through the second pass writing and reading 0x55.

 

I would be trying to get an RMA for this Drive as soon as possible--- assuming you have a warranty or return window.

 

I would consider that any refurbished drive is only good for use as a free standing drive-- preferably as a scratch drive where data security was not a primary consideration.   I would not want to  use it in any sort of a parity protected situation where the ability to read every bit on every drive is a requirement.  (You have to ask yourself, why was this drive put into a refurbishing environment in the first place.  Had it been found to be flaky in its previous environment? Did it already have 70,000+ hours on it? How was it physically treated/handled after removal from service?) 

  • Author

@Frank1940

1. A refurbished drive is heavily used but not failed. I think... I don't know. I imagine that it would be easier for a data center to rotate all their drives before eol rather than wait until they individually fail. I don't actually know where they come from. Where do refurbished drives come from?

2. I imagine the seller checks the smart report to see that it doesn't have any reallocated sectors. I don't actually know what they do.

3. The two sellers that I see talked about most are GoHardDrive and ServerPartDeals. I think they have reputation around respecting the warranty. Idk if they have any rep around screening and testing.

4. 5 year warranty. Only for "Reallocated sector count" or "UDMA CRC error count" in the case of SPD. "Any issues with the drive" in the case of GoHD.

 

The drive that failed badblocks is a drive that I bought new that is now out of warranty. I ran badblocks on it because I was curious what would happen.

23 minutes ago, NominallySavvyTechPerson said:

3. The two sellers that I see talked about most are GoHardDrive and ServerPartDeals. I think they have reputation around respecting the warranty. Idk if they have any rep around screening and testing.

I dont know about GOHardDrive but since you mention ServerPartDeals I will say that i have had great success with their "Manufacturer Recertified" Drives? In my experience and from what I have read those "manufacturer recertified" drives are basically good as new. I use them in my main array without any additional worry. 

  • Community Expert
50 minutes ago, NominallySavvyTechPerson said:

1. A refurbished drive is heavily used but not failed. I think... I don't know. I imagine that it would be easier for a data center to rotate all their drives before eol rather than wait until they individually

 

If this were true, the power-on hours would in the SMART data.   IF the power-on hours are zero, someone is messing with the on-board data cache.  The question one should be asking is why?  What don't they want you to know.   (High power-on hours are not an cause for undue concern.  I recently pulled a 3TB that had close to 100,000 hours on it.  A month or so prior to tha,t I pulled another 3TB drive that power-on hour counter had rolled over!  Both drives were pulled because I need to add larger capacity drives to get more space.  Granted that both of those drives were probably data outliers--- Other drives of that same model had failed years prior!)

 

50 minutes ago, NominallySavvyTechPerson said:

4. 5 year warranty. Only for "Reallocated sector count" or "UDMA CRC error count" in the case of SPD.

 

CRC errors are very seldom an indicator of a data problem.  What they report is the serial data being sent on the SATA cable between the MB and Hard Drive has an error in it.  The data will be resend until it is received correctly. 

 

'Reallocated sector count' is a count of sectors that had problems with data errors and that the drive then mapped them out of use and new spare sectors were mapped in to replace them.  Many Gurus consider that drives with only a few reallocated sectors are acceptable for use.  (But most also agree that if you find one early failure-- say, first thirty days-- replacement is probably the thing to do.)  A steady increase is definite concern as it probably indicates that the drive is early stages of complete failure. 

 

IF you are buying refurbished drives, just be prepared to test them thoroughly and ready to deep-six an occasional drive.  (As I recall, years ago, there was a discussion about integrating badblocks in the preclear script.  But it was never really done for reasons I can't remember...)  And have a cold spare ready to go.  (I use mostly new Seagate Ironwolfs and I always have a cold spare.  If a drive does give a problem, I swap it and figure out what went wrong later!  Most of the time, it was apparently a 'gitch'.) 

Edited by Frank1940

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.