Solved Help to reformat ibm hard disk 528 to 512

Hello, I have been trying to convert my IBM disks from 528 bytes to 512 for 4 years. I will tell you my experiences in these 4 years. I hope I can guide someone and solve this problem. You have seen 528/520 to 512 problems on many forum sites. I have always succeeded in converting different brands of drives other than IBM to 512. But IBM disks shortened my life by at least 10 years.

Methods I tried (Methods I encountered in the forum)
setblocksize (tried didnt work)
sedutil (tried didnt work)
sudo sg_format --format -v --size=4096 (I tried, it didn't work)
sg_format -F -F -F (I tried, it didn't work)

"A friend's comment on my post is very important, please read it."

"`Oh hey, I have this exact same drive, and exact same issue! I haven't been able to solve this yet, but maybe putting what I've tried to do on the internet might help someone actually solve it? If they do, I really hope they post it in a public place.

This SSD really is a piece of work. It's a Seagate Nytro 3131 Read Intensive 7.68TB SED SSD that's been rebranded to an IBM 3.84TB SED SSD. Not only is the firmware modified to show all the fancy IBM stuff, but the drive size has been cleaved in half for whatever reason (my current guess is so they could sell 3.84TB drives when the real ones ran out of stock?) and it being an SED absolutely doesn't help.

What I tried on Ubuntu 22.04 running on an IBM Slicestor 2448 chassis (intel x86, probably just rebranded SuperMicro?): While sg_format with --size=528 works, or at least doesn't error, other sizes (like 512, 4096, and even 4224) will fail with the Invalid field in parameter list error I've grown to despise. I even ended up going through the SCSI command spec (the SeaGate
one) to figure out if sg_format was sending incorrect commands, but even my manual attempts via sg_raw ran into that error. I'm going to guess that IBM's custom firmware doesn't follow the spec when you try to change the block size, and they have custom data fields that must be provided. Or perhaps it's actually the right format, but IBM is having the drive throw a bogus error because proprietary reasons.

echo -n -e "\x00\x00\x00\x00\x01\x00\x00\x10\x00\x00\x00\x03\x7e\x3e\x92\xb0\x00\x00\x00\x00\x00\x00\x02\x00" | sg_raw --cmdset=1 --send=24 /dev/sg2 55 11 00 00 00 00 00 00 18 00
This was the command I have in my notes, I think this is the correct one? It's been a bit since I've worked on this. I do recall that using \x02\x10 (528) instead of \x02\x00 (512) worked, which aligns with sg_format with --size=528 working but --size=512 not.

I should probably mention that I'm not new to reformatting block sizes. The previous IBM drives I've gotten in with non-512 block sizes have all formatted fine to 512 via sg_format, but IBM-branded SSD's, especially the SED ones, reject being converted. All of the IBM HDD's I've gotten have converted fine, and even some SSD's (though not SED SSD's).

sedutil-cli can handle the SED portion of the drive fine. The standard PSID reset works fine, I can take ownership of the drive and the mess with the locking ranges, all that works as standard. Trying to do any of the sg_format stuff while the drive is locked will correctly throw errors that point to the drive being locked. Trying to do the sg_format stuff with the drive freshly PSID-reset or unlocked will result in the Invalid field in parameter list crap, so it doesn't look like the SED stuff is actually getting in the way. SeaChest, Seagates own utility for this stuff, doesn't seem to be able to handle the drive either. While SeaChest Format seems to recognize the drive, displaying some information and showing that it should be able to do 512, 520, and 528 sector sizes, all of my attempts to use SeaChest Format to reformat the drive to 512 have failed, seemingly running into the same Invalid field in parameter list error from the sg_* commands.

One of the things I found referenced in the IBM docs that is supposed to be able to change an "Advanced Function" disk into a JBOD disk is iprconfig, the IBM Power RAID Configuration utility. There's even a github repo
for it that I was able to grab, compile, and install. Unfortunately, likely due to the Slicestor not actually having a RAID card (seems to just be an HBA) let alone an IBM one, while iprconfig will launch fine it wont actually detect any RAID cards or the drive. Most of this you can find online on existing discussions if you look hard enough though, so not much of this is new info, but it is compiled here. Now to what else I've done that I haven't been able to find online at all: Using actual non-rebranded IBM hardware.

I managed to get my hands on an IBM Power8 8247-21L/S812L server and got it to boot AIX Diag 7.2 to try to have the AIX Diagnostics reformat it to JBOD/512. Unfortunately, the drive never showed up in AIX. I took the 2 HDD's that were in it, put them in a RAID 0, and installed the PowerPC version of SUSE Linux Enterprise 15 via the power of the free trial and got iprconfig running on there. This time, on the actual IBM hardware, iprconfig DID recognize the RAID card and was able to see the 2 drives I put in the RAID 0 for SUSE, but still wasn't able to see the SED SSD. After some more testing, it seems like it can't see any SSD's? Not sure if it's my setup or if the RAID card is just wack.

I proceeded to get my hands on an IBM Power9 9008-22L/L922 server, which actually came with 2 U.2 SAS 4224 block sized SSD's (not SED though), and popped the 2 RAID 0 SUSE HDD's and the SED SSD in there. Got SUSE up and running, ran iprconfig, and though the SSD was labeled "R/W Protected", it was able to see it! Unfortunately, I wasn't able to reformat it to 512. Based on the logs, it seems iprconfig was also running into the same issues as sg_format. iprconfig also wasn't able to make a single-drive RAID 0 from the drive, and just errored (TODO: Try again from SUSE and put error in here). Putting the drive back into my Ubuntu box and using sedutil-cli to take ownership, make a locking range that spans the entire drive, and having the locking range unlocked by default, and putting the drive back into the Power9 box made it stop showing up as "R/W Protected" and allowed me to create the RAID 0.

Putting the drive into my Ubuntu box, PSID-resetting the drive, putting it back into the Power9 box, and booting into AIX 7.2 it showed the drive but errored when trying to format it for JBOD/512. The drive was listed as "R/W Protected", but doing a general reformat (keeps the block size) that AIX offers not only worked, but changed the state of it to "zeroed". Booting into SUSE, I was able to use iprconfig to make it into a RAID 0, so that was neat.

In SUSE, the various /dev/sg*'s will point to the actual drives even if they are in a RAID. For me right now, /dev/sg1 and sg2 are pointing to the two 283 GB drives that are in the RAID 0 housing SUSE, and sg3 is the SSD SED. Very interestingly, smartctl in SUSE will show the SSD as having a logical block size of 512, though it wont mention the physical block size. Running sudo smartctl --test=short /dev/sg3 wont error, but doesn't seem to actually work. I ran a single short test a while ago, and I can see that in the SMART Self-test log on SUSE, but no new tests I try to run are added to that log. Starting a long test then cancelling it via sudo smartctl --test=long /dev/sg3 and sudo smartctl -X /dev/sg3 still wont error, but no cancelled test shows up in the log. Running sudo sg_readcap /dev/sg3 will show a logical block size of 512, Logical blocks per physical block exponent=0, and both lbpme=0 and lbprz=0, despite Ubuntu saying otherwise (both are set to 1). Running

sudo sg_format --format --size=512 /dev/sg3
yields a different error, "MODE SELECT command: Transport Error". I'm going to guess that the IBM RAID card is not providing direct communication to the drive, and shows a false version of the drive.
Weirdly, after running the smartctl stuff just now, it allowed me to do the sg_format with --size=512. Unfortunately, removing it and checking in Ubuntu shows that it's still 528/4224 block size. It also doesn't show any of the (cancelled) SMART tests I ran on SUSE but I can run a test from Ubuntu and it does show up in the SMART log. The IBM RAID card doesn't seem to actually relay any of the test requests to the drive.

Another message: "
You might want to read this:
https://hddoracle.com/viewtopic.php?f=59&t=3279
https://hddoracle.com/viewtopic.php?f=59&t=3280

These disks have software locks, it's all in the firmware on the disk. I tried more or less some brutal methods, changing firmware-parts, but killed some disks on the way.

You don't need special hardware, a regular SAS2/SAS3 HBA with IT-firmware that can talk directly to the disk is enough.
I also have no solution, but narrowed it a bit down. If partitcular 3rd vendor firmware has locks (no other sector size than 520 (SSD should have 4096) or no write without verify), you must change the whole firmware to generic.

You need to send some magic unlock code(s?) to the disk, then a secure erase, quick format and whole firmware with mode14 (then a power on/off reset/camcontrol stop/start). In a way similar to the sbr change on a HBA ( https://marcan.st/2016/05/crossflashing-the-fujitsu-d2607/ )
I am just not sure about the sequence order and the magic codes. I found out the protection stuff for SCSI/SAS began somewhere in 2005 and upwards , it is documented at t10.org, but there are too many files.

More info is spread over config files in niagara, I just can't put it together. You need to combine the info found in the readable config files over different niagara versions, then it all narrows down to regular scsi/sas commands.

In the links hddoracle you'll find videos of baking firmware with expensive software, but that is only needed to crossflash with mode5 and mode7 directly.

The important things: quick format, secure erase and/or start/stop a special smart-test gives a small time window, where the disk accepts more or THE magic codes.

I just can't put it together."

Many people said that this friend :
could solve the problem for money. I sent an e-mail to guy, but he said he had the disks I had and couldn't help.


The company sells the same disks I have on ebay and the TITLE says "FOR IBM DS8880". ebay link
This company is not a small business. I contacted this company and they said there is a way to convert these disks to 512 but there is a risk of bricking during converting.

These drives are manufactured by Seagate for IBM. you can see from here
Anyway, guys, my wife and I started to fight constantly because of these discs. If I can't solve this problem soon, I'm going to throw them away. It makes my wife very angry that I spend 3-4 hours on these discs every weekend. (150 discs in total, 3.8TB, 7.6TB, 15.3TB)



ibm.png




ibm2.png
 
Disclaimer: Longtime IBM storage employee, but left there about 6 years ago.

I am not at all optimistic. This drive isn't just a "open system" drive configured for AIX with longer sectors, it is actually an internal drive for the "Shark", a.k.a. DS8xxx. The Shark is a very large RAID array (typically the size of two refrigerators), which uses highly specialized internal firmware, millions of lines of code. To the outside, the Shark acts like a block device over its various interfaces. I would expect that most of the time, Sharks are used as back-end storage for mainframes (today z-Series machines), which have forever used longer sectors, since the bulk of the data is stored in CKD (count-key-data) format, not as individual blocks like on Unix (a.k.a. "open system").

A typical large storage system has an economic life of 5-7 years. The likely source of these drives is an IBM customer who bought a Shark, decommissioned it, and sold it for pennies on the dollar to a dismantler, who is now selling the pieces on eBay. The drives are unlikely to be defective (or worn out) customer returns, as those have to be sent back to IBM after receiving spares, and there will be destroyed.

For very good reason, the IBMers who run the Shark product line are extremely paranoid. What's the good reason? A shark is exceedingly reliable, and data written to it is highly durable. To get to such a good storage system, you have to control pretty much everything, including things that sound superficial like the sheet metal (in case of a water leak from ceiling fire sprinklers, the water will usually not seep through the top of the rack) or power cables (routed in such a fashion that it is very unlikely that someone will trip over them and pull them out). Obviously, controlling the drive configuration and firmware is very high on the list of things that need to be done. For a drive inside a Shark, there just isn't a realistic need to ever change sector size. And because there is no need, giving it the capability to do so would just create risk and complexity. Similarly, only approved (and cryptographically signed) firmware can be installed on these drives; otherwise, it would be possible to attack a shark by (intentionally or through a mistake) have the wrong firmware installed; for example a firmware version created by a large nation state to spy on the data (and yes, this has happened to disk drives manufactured in China). The same logic is why these drives are SED and use T10DIF.

My educated guess: trying to use these drives will be de-facto impossible. If you were inside IBM, you might be able to talk to a firmware engineer in a place like Poughkeepsie or Austin or Fujisawa, and they might be able to give you the secret hint. For an outsider, that is flat out impossible. And yes, I know people who are currently in federal prison for trying to exfiltrate secrets from IBM. If you had an older Shark that you are doing self-maintenance on (such things exist, but are very rare), this disk might be useful as a spare, but for connecting to a *BSD/Linux/Windows systems, I would not get my hope up.
 
Disclaimer: Longtime IBM storage employee, but left there about 6 years ago.

I am not at all optimistic. This drive isn't just a "open system" drive configured for AIX with longer sectors, it is actually an internal drive for the "Shark", a.k.a. DS8xxx. The Shark is a very large RAID array (typically the size of two refrigerators), which uses highly specialized internal firmware, millions of lines of code. To the outside, the Shark acts like a block device over its various interfaces. I would expect that most of the time, Sharks are used as back-end storage for mainframes (today z-Series machines), which have forever used longer sectors, since the bulk of the data is stored in CKD (count-key-data) format, not as individual blocks like on Unix (a.k.a. "open system").

A typical large storage system has an economic life of 5-7 years. The likely source of these drives is an IBM customer who bought a Shark, decommissioned it, and sold it for pennies on the dollar to a dismantler, who is now selling the pieces on eBay. The drives are unlikely to be defective (or worn out) customer returns, as those have to be sent back to IBM after receiving spares, and there will be destroyed.

For very good reason, the IBMers who run the Shark product line are extremely paranoid. What's the good reason? A shark is exceedingly reliable, and data written to it is highly durable. To get to such a good storage system, you have to control pretty much everything, including things that sound superficial like the sheet metal (in case of a water leak from ceiling fire sprinklers, the water will usually not seep through the top of the rack) or power cables (routed in such a fashion that it is very unlikely that someone will trip over them and pull them out). Obviously, controlling the drive configuration and firmware is very high on the list of things that need to be done. For a drive inside a Shark, there just isn't a realistic need to ever change sector size. And because there is no need, giving it the capability to do so would just create risk and complexity. Similarly, only approved (and cryptographically signed) firmware can be installed on these drives; otherwise, it would be possible to attack a shark by (intentionally or through a mistake) have the wrong firmware installed; for example a firmware version created by a large nation state to spy on the data (and yes, this has happened to disk drives manufactured in China). The same logic is why these drives are SED and use T10DIF.

My educated guess: trying to use these drives will be de-facto impossible. If you were inside IBM, you might be able to talk to a firmware engineer in a place like Poughkeepsie or Austin or Fujisawa, and they might be able to give you the secret hint. For an outsider, that is flat out impossible. And yes, I know people who are currently in federal prison for trying to exfiltrate secrets from IBM. If you had an older Shark that you are doing self-maintenance on (such things exist, but are very rare), this disk might be useful as a spare, but for connecting to a *BSD/Linux/Windows systems, I would not get my hope up.
Thank you for the information, I am just a simple seller. 4 years ago I bought IBM 1.2TB disks from a data center that was about to go bankrupt, easily converted them to 512 bytes and sold them. Later, this data center said that it had such disks and would sell them cheaply. But he didn't tell me these were 528 bytes. I didn't know that these disks were produced by Seagate specifically for IBM and that they only worked on DS8XXX devices. Unfortunately, at that time, I had made all my investments in these discs. I have been trying to convert these disks to 512 bytes every day for 4 years and they are starting to upset my psychology. Looks like I'm going to tear it all apart eventually.
 
I don't see any magic bullet in that conversation. I fear the sticking point is going to be that (a) these drives have IBM specific firmware, which is designed to make sure the drives stay in a configuration that is useful and secure for their target environment, (b) the DS8xxx needs the disks to be >512 byte sectors, to store its internal checksums, and (c) the firmware on the drive will not accept a new firmware update, unless it is signed to be a valid (IBM-internal) firmware. Nothing on that GitHub discussion changes that.

You have to remember that the Shark was using checksums internally long before SCSI allowed checksums to be stored using T10DIF, so Shark disks needed to have blocks larger than 512 bytes. And Sharks were designed and intended to store CKD data from mainframes, so for the common use case, they also needed larger blocks.

There may be a way to get these drives to accept different firmware. It is certainly possible in a lab, usually by using pogo pins on a test point of the PC board. But none of that is known outside a small group of people.
 
CKD format is not the same as fixed sectors. I doubt new firmware would solve this.

The solution would be to write a driver for this device. On the mainframe one defines the largest blocksize for the device with the goal of using the maximum blocksize supported by MVS (back in the day, now z/OS) in order to a) reduce space wasted by interblock gaps and b) improve read/write performance. I don't see how a variable blocksize device would work on any UNIX-like system except to define a per-device blocksize sysctl.

Support for CKD would allow DBMSs the opportunity to seek to a key on the track. But that would also require a new API or try to have lseek() leverage this capability.

I'm not sure it would be worth it though. It's not often we'd see such devices attached to a UNIX-like system. Maybe Linux or FreeBSD on the mainframe but those would still need to use fixed sectors, which are emulated by z/VM.
 
There may be a way to get these drives to accept different firmware. It is certainly possible in a lab, usually by using pogo pins on a test point of the PC board. But none of that is known outside a small group of people.
Then one should ask the Russians.
usbdev.ru
(That page is about reinstalling crashed SSD firmware in order to recover the lost data - which appears to be a big business)
 
CKD format is not the same as fixed sectors. I doubt new firmware would solve this.

The solution would be to write a driver for this device. On the mainframe one defines the largest blocksize for the device with the goal of using the maximum blocksize supported by MVS (back in the day, now z/OS) in order to a) reduce space wasted by interblock gaps and b) improve read/write performance. I don't see how a variable blocksize device would work on any UNIX-like system except to define a per-device blocksize sysctl.
Well, I doubt these devices have a firmware crafted specially for MVS.
Anyway, ralphbsz may have run the Shark with mainframes - we did it with everything else but not mainframes. We used it as genuine SAN.

Also, the Seagate product manual says the device can be formatted to either 512/520/528 sectorsize. So this might be a native feature of the series, and maybe the firmware just prevents it from being changed (if at all, because what freudkid describes is not the most professional approach either - which would be to grab camcontrol cmd -c and systematically work along the product manual, to see what works and what doesn't).

Anyway it is unclear to me how the physical blocksize is supposed to cope with changed sector sizes, or how the flash translation might be designed for the device being able to provide the same number of sectors with varying sizes.

The more easy approach would probably be to just hack our device driver to disregard the surplus 16 bytes. That might be do-able, and might make sense if one had 150+ of these things and want to equip their own site.
But here it seems the case is different, and freudkid is rather interested in selling the reformatted devices. If that's the case, my compassion starts to target against zero, because honestly I'm quite pissed: in former times one could obtain used-up industrial equipment for the regular price of 1$ plus bakshish. But nowadays ebay is full of "re-sellers" who, after having already cashed-up for transporting and scrapping, then try to still sell the stuff for rather grotesque prices. (Obviousely in a free market this is just alright, but then also I am free to not being amused.)
 
Well, I doubt these devices have a firmware crafted specially for MVS.
Anyway, ralphbsz may have run the Shark with mainframes - we did it with everything else but not mainframes. We used it as genuine SAN.

Also, the Seagate product manual says the device can be formatted to either 512/520/528 sectorsize. So this might be a native feature of the series, and maybe the firmware just prevents it from being changed (if at all, because what freudkid describes is not the most professional approach either - which would be to grab camcontrol cmd -c and systematically work along the product manual, to see what works and what doesn't).

Anyway it is unclear to me how the physical blocksize is supposed to cope with changed sector sizes, or how the flash translation might be designed for the device being able to provide the same number of sectors with varying sizes.

The more easy approach would probably be to just hack our device driver to disregard the surplus 16 bytes. That might be do-able, and might make sense if one had 150+ of these things and want to equip their own site.
But here it seems the case is different, and freudkid is rather interested in selling the reformatted devices. If that's the case, my compassion starts to target against zero, because honestly I'm quite pissed: in former times one could obtain used-up industrial equipment for the regular price of 1$ plus bakshish. But nowadays ebay is full of "re-sellers" who, after having already cashed-up for transporting and scrapping, then try to still sell the stuff for rather grotesque prices. (Obviousely in a free market this is just alright, but then also I am free to not being amused.)
you have every right to be angry with me. 4 years ago, I thought I could make a good profit from these discs, but these discs did nothing more than destroy my marriage and psychology. I started to hate these discs and sent them to 5-6 reddit users who said they could convert these discs by paying the shipping fee :). (I know they can't convert to 512, I just wanted the disks away from me)
 
Back
Top