How to Use Drives with Abnormal Sector Sizes

Joined
Mar 7, 2017
Messages
8
I recently attempted to set up a freeNAS server and ran into problems creating the ZFS pool. My server was unable to format them to GPT or wipe them from the WebGUI. I then proceeded to investigate using the CLI. Using the command "geom disk list" I was able to determine my drives are set up with a 520 byte sector size. This appears to be the issue, as I was able to issue "dd" commands only when I set bs=520 or some multiple of 520.

I found a utility that runs on Linux called sg_utils. The problem with this solution for me is that due to my current hardware setup, I haven't figured out how to get a linux installation to detect the drives.

I am running a Supermicro X9DRi-LN4F+ motherboard, 96GB of 1066Mhz ECC RAM, two Xeon E5-2670's, eight Seagate Constellation ES 2TB SAS 6GB/s drives, and a Dell PERC h310 flashed with LSI 9211i8i firmware in IT mode. Is there a solution that runs natively on a freeBSD platform? Does anyone have experience getting such a card to work on Linux?

I am relatively new to this field, so any help is much appreciated.

EDIT:

code

geom disk list
Geom name: da0
Providers:
1. Name: da0
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c5004147b9cf
ident: Z1P1SZ8C00009235013L
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da1
Providers:
1. Name: da1
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c5004156b6e7
ident: Z1P20EZH0000C236AUZA
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da2
Providers:
1. Name: da2
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c50041e545db
ident: Z1P2Z3N10000C245BQC5
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da3
Providers:
1. Name: da3
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c5004179ece3
ident: Z1P29DA20000C2388J5B
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da4
Providers:
1. Name: da4
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c500415730cb
ident: Z1P20CFX0000C2361T0U
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da5
Providers:
1. Name: da5
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c500414b15bb
ident: Z1P1VRP40000C235R1G8
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da6
Providers:
1. Name: da6
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c5004147cb77
ident: Z1P1SZBV00009234FSMU
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da7
Providers:
1. Name: da7
Mediasize: 1988629626880 (1.8T)
Sectorsize: 520
Mode: r1w1e0
descr: SEAGATE DKS2P-H2R0SS
lunid: 5000c500415de6ab
ident: Z1P21Y310000C235NLDP
rotationrate: 7200
fwsectors: 63
fwheads: 255

Geom name: da8
Providers:
1. Name: da8
Mediasize: 8004304896 (7.5G)
Sectorsize: 512
Mode: r1w1e2
descr: SanDisk Cruzer Glide
lunname: SanDisk Cruzer Glide 4C530201011127110535
lunid: SanDisk Cruzer Glide 4C530201011127110535
ident: 4C530201011127110535
rotationrate: unknown
fwsectors: 63
fwheads: 255

/code
 
Last edited:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
520 byte sectors? The spec sheet for your drives say 512 bytes. Your ashift would be 9 (2^9).
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
@m0nkey_
It appears the original poster got the drives from another RAID device, (probably hardware RAID).
I've seen that before.

@GuardedAirplane
Sorry, can't help you directly. But you are on the right track in that all the 520 byte sectored disks
have to be re-low level formated to 512 byte sectors. I've done this on Solaris 10 SPARC for a few
Fibre Channel disks we pulled from a RAID disk array. I needed them to replace the OS disks on
my Solaris 10 SPARC servers for increased space...
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
@Arwen Thanks for your response. Do you think a OS like Solaris based solution (like SmartOS) might be easier?
Possibly. I could not help you there. My experience with Solaris x86/x64 is much more limited.
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Hi, on my freenas box there is the sg_format command; you don't need to use linux. Also, have you tried camcontrol command with the format option? Take a look at this link
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Happy to hear that...:)
 

Darklion

Explorer
Joined
Oct 18, 2019
Messages
62
I just try with a 520 disk but i got this error. Can someone tell me if I would be able to fix this drive? cuz I am seeing there that it says "fixed format" and at the final says "apart from invalid opcode"

root@freenas[~]# sg_format --format --size=512 --fmtpinfo=0 /dev/da8 -v
HITACHI HUS72302CLAR2000 C1D6 peripheral_type: disk [0x0]
PROTECT=1
<< supports protection information>>
Unit serial number: YGJH3XWD
LU name: 5000cca01c8c3d54
mode sense (10) cdb: 5a 00 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
Number of blocks=3846921026 [0xe54b5b42]
Block size=520 [0x208]
mode select (10) cdb: 55 11 00 00 00 00 00 00 1a 00
mode select (10):
Fixed format, current; Sense key: Illegal Request
Additional sense: Parameter list length error
Sense Key Specific: Error in Command: byte 7
MODE SELECT command: Illegal request sense key, apart from Invalid opcode
 

blueether

Patron
Joined
Aug 6, 2018
Messages
259
Did you try the command in the linked post?
 

Darklion

Explorer
Joined
Oct 18, 2019
Messages
62
Did you try the command in the linked post?

I did it with the camcontrol command.

# camcontrol cmd da1 -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 da1 -q -y

It work like a champ, it took like 6 hours on 10 Hitachi 2tb 7200rpm, 9 hours on a Seagate constellation 2tb 7200rpm and like 45 minutes on 4 Hitachi 600gb 15krpm.

The only frustrated part was that prompt just move down and it didn't do anything until it was done and it looks like just just ended up pressing enter. But after checking the disk info is definitely at 512 sector sized.

# diskinfo -v da1

The first line tells you that is on 512 bits sectors. It worked well.
 

Jason Bacon

Cadet
Joined
Sep 11, 2013
Messages
7
The camcontrol commands worked for me as well on Seagate 3TB disks that my Dell PERC H700 rejected while trying to create a VD. Luckily I have another server with a basic SAS HBA that could access them. Not sure how long the low-level format takes as it finished sometime during the night, but it was at least a few hours.
 

Jason Bacon

Cadet
Joined
Sep 11, 2013
Messages
7
BTW, it's a good idea to run "camcontrol format device -r" after starting the format.

The format command above will not show progress and will time out after 3 hours even if the format is still running. This is OK, because the disk controller does not need OS interaction, but you'll want to know the format is finished before removing the disk. The following will show progress:

root@compute-002:/home/bacon # camcontrol format da3 -r
Formatting: 37.61 % (24649/65536) done
 
Top