Working with SAS drives with non-standard sector sizes

Categories: Storage

Problem definition:

I got some new drives to which I saw little issue until firing it up and attempting to use I get large blocks of errors in the kernel log similar to the following:

My scenario is Hitachi HUC109060CSS601 (S.M.A.R.T. info below) what specifically seems to be the problem is the line “8 bytes of protection information per logical block” which was causing issues to ZFS by having odd sector sizes. To some tools the disk shows up as having 520 byte sectors (the normal 512 + 8 bytes of protection information). I was also not able to run any S.M.A.R.T. tests on the disks.

An important issue here is also the drive does not show up in “fdisk -l” and you get an I/O error when referencing it directly. We are also not seeing any other errors indicating something is actually wrong with the drive. A way to test this is to run the “badblocks” command (before fixing I was getting bad blocks for 0 to 255).

Ok, now that I’ve bored you to tears lets get to actually fixing the drive, everything revolves around the following command (on ubuntu the package is ‘sg3-utils’):

sg_format --format --fmtpinfo=0 /dev/sdX

This is the base version to be explicit you can add “--size=512” or “--size=4096″ to force a sector size.

As it starts the format will warn you that the disk will be wiped and then it begins.

When it finishes you should see a success prompt (I ran it under time so for a 10k rpm 600GB drive it took just over an hour).

fdisk now shows the drive and you can use it normally. A run of badblocks against the drive now shows no errors.

Notes:

  • sg_map – Useful for determining the mapping between /dev/sdX and /dev/sgX

References:

  • https://talesinit.blogspot.com/2015/11/formatted-with-type-2-protection-huh.html

»