Accidentally interrupted sg_format any way to fix the drive? (520 to 512)

Laguz

Cadet
Joined
May 8, 2020
Messages
6
Edit: Update i ended up finding another tool to use and that worked just fine
Code:
# camcontrol cmd da11 -v -c "15 10 0 0 v:i1 0" 12 -o 12 "0 0 0 8 0 0:i3 0 v:i3" 512
# camcontrol format da11 -q -y
# camcontrl format da11 -r to check the progress on web shell          

I purchased four SAS drives after receiving them i discovered they where 520 sector size and attempted to format the first drive to 512.

The command I used that got interrupted was
Code:
sg_format --verbose --format --size=512 --six /dev/da8
After which da8 shows 1KiB of space and fails smart scans and diskinfo checks "medium format corrupted"

Is there any way to recover from this or did i brick the drive? I have 3 more drives of the exact same size and model if that is relevant at all.

Any help would be greatly appreciated
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I had the same issue, interrupted three formats. Ouch. I got back from it by:
- Halting the system
- Powering it off and allowing the drives to spin down
- Powering it back on
- Here I was stuck - an sg_format told me I couldn't format the drive
- Be depressed and do something else
- Come back hours later and try again - format started and completed

I don't know whether I needed a few hours pause for the drive firmware to get out of its funk, and whether I even needed to power down. What I can say is that this worked and I have two drives formatted and the third formatting right now.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
The key is to physically remove power to the drive - completely unplug it and let it sit there for a few seconds. If your system supports hotplug you can do it live; otherwise, power down, unplug the drive, let it sit, and then plug it back in.

Then just restart the command.
 

Laguz

Cadet
Joined
May 8, 2020
Messages
6
After power cycling the drive i did manage to get the diskinfo to work on the drive, and did the format command again it's still reporting 1KiB in size even after power cycling again.

steps i tried
1. power cycle drive
2. diskinfo -c reported 1Kib
3. attempted the format command again letting it fully complete, web gui showed 1KiB size
4. power cycle drive
5. diskinfo -c reported 1Kib size again

Code:
root@freenas[~]# diskinfo -c /dev/da8
/dev/da8
        512             # sectorsize
        1024            # mediasize in bytes (1.0K)
        2               # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        0               # Cylinders according to firmware.
        64              # Heads according to firmware.
        32              # Sectors according to firmware.
        SEAGATE DKS2C-H2R0SS    # Disk descr.
        9WM7YBCF000092112YAZ    # Disk ident.
        id1,enc@n50050cc1020161c5/ty


from that it looks like the firmware got corrupted when the format first failed?

one of the drives i haven't tried to format yet out of fear of repeating the issue report

Code:
root@freenas[~]# diskinfo -c /dev/da9
/dev/da9
        520             # sectorsize
        1988629626880   # mediasize in bytes (1.8T)
        3824287744      # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        238050          # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        SEAGATE DKS2C-H2R0SS    # Disk descr.
        9WM7XFNA0000C2050LYN    # Disk ident.
        id1,enc@n50050cc1020161c5/
 

jumpnjet

Cadet
Joined
Jul 21, 2023
Messages
1
Hi,

I have a similar issue I am currently using truenas scale on a Dell 730XD and I accidentally started to format one of drives in my zpool, I halted it tried rebooting, That didn't work I tried just unplugging the drives still doesn't work. when I check IPMI the drives are showing up as blocked on the HBA but they did showed up a ready before. If I try lsblk I do not see the drives. currently I do not have the server setup on a network with internet access, so I can't use anything that doesn't come with Scale. I am racking my brain trying to figure out how to go about fixing it. Can any one help?
 
Top