I have to reformat 28 10TB drives inside a server from 4096 Bytes to 512 Bytes, in order for them to be recognised by the raid controller.
Due to the large capacity, when using the GParted Live CD and the
sg_format --format --size=512 /dev/sdX
command, the process takes very long for a single drive to complete.
My next guess was to automate the process sequentially by running it inside a bash loop, however, that way it would still take ~3-4 days to complete.
Is there a way to execute this process in parallel? Any help would be appreciated. I don't mind switching to another live CD, however I would prefer to stay with GParted as it was already a pain to boot something on this server.
I formatted the first drive inside a terminal, it has progressed 4% in 30 minutes.
I first tried loading the GParted GUI, however I think somewhere it crapped out (maybe due to me using the HP iLO 4 interface to load .isos) and froze up.
I solved this problem using the parallel command. It enables running a task on each cpu core available. You can use the
-joption to define the number of cores and thenproccommand to see how many are available on your system.This was the command I used:
However, in this config, parallel doesn't spit out the progress of the formatting process until the job is done. To achieve this, I think one could use the
--ungroupoption. Not sure about that though.Furthermore I highly suggest not terminating a running
sg_formatcommand, as it can be pretty cumbersome to reinitialise the drive afterwards.For reference, this command took ~13-14 hours to terminate on a 10TB SAS drive.