How to mass-reformat Storage Array disks from 3Par and Dell EMC storage arrays from 520 to 512
For the first time in a couple of years I happened to come to some cheap disks from a decommissioned storage array. I already wrote a guide 4 years ago, but I figured the current market situation makes this interesting again.
For those who don’t know it:
Storage arrays like HPE 3Par or Dell EMC use the same disks as your server, to avoid data corruption though the disks are formatted with checksums that allow the array to recheck all data written on the fly when writing and reading. Those disks can be incredibly cheap to buy, but need particular reformatting before usage.
I bought 40 of them, so I am selling some of those here for cheap: https://www.reddit.com/r/homelabsales/comments/1x2bot8/fseu_seagate_st8000nm0075_3par_8tb_drives/
IMPORTANT
1. Do not use SSH, log in locally, on SSD disks the process is rather quick, on HDs it can take many many hours, if your session times out you can start over
2. All data will be destroyed!!!!!
Requierements
sg3_utils
parallel
Instructions
List disks using lsblk
Identify the device with the wrong block size by executing sg_format <device>
Run for i in {1..28}; do echo "sg_format --format --size=512 /dev/sg$i"; done | parallel -j40
Additional Information for systems using letters to denominate drives
The same command would work also with systems using a drive letter system:
for i in {a..z}; do echo "sg_format --format --size=512 /dev/sg$i"; done | parallel -j40
Additional Information for formating multiple drives that are not in a sequence
Given that the nomenclation of the drives is not always sequential, for i in can be adapted to that use case: If I want to format drives /dev/sga to /dev/sgc and the drives /dev/sge/ to /dev/sgf/ the command could look like this:
for i in {{a..c},{e..f}}; do echo "sg_format --format --size=512 /dev/sg$i"; done | parallel -j40
https://redd.it/1x364ha
@r_SelfHosted
Post #54028
32