Replacing 4Kn disks

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I have an array of 6*12TB Seagate Exos drivers in 3* Mirrored vdevs.
Before building the array I specifically formatted the drives using seagate tools to 4Kn

I have bought as spares some 12TB Toshiba N300 drives in case I lose one of the Seagates. These are default formatted, presumably 512e

Could I swap one of the seagates with a Toshiba without issue, or do I need to somehow format the Tosh's fisrt to 4Kn?

And if so - anyone got an idea how?
I could try the seagate tools, which may or may not work.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
These are default formatted, presumably 512e
I would make sure they are 512 first using fdisk.

If your HDD supports the changing of the Logical Sector size then on Linux, you could do
Code:
hdparm --set-sector-size 4096 /dev/sdX

Obviously all data will be destroyed and you will have to re-partition everything so that the partitions are aligned correctly.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
The disks don't have any partitions on them - just finishing badblocks by somtime tomorrow I hope

I can try the code you put but I am afraid I don't fully understand the
"`re-partition everything so that the partitions are aligned correctly." or do you just mean I can't keep any data onthe disks - which I am fine with
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
@Inxsible assumed you had partitions and data on the drives. But there's no point in preserving the zeroes that badblocks will leave overall. Just proceed…

Even if the drives were 512b, what would be the issue in mixing them with 4Kn? Introducing 4Kn among 512b would cause write amplification, but eight 512b sectors make a nice 4k block.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I shall give this a try tomorrow - when I get back.
 

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
@NugentS
You didn't report back but here's something that I found worked in case hdparm doesn't work for you.

I recently bought a bunch of SAS drives and found that 2 of them were 520 formatted. For some reason hdparm could not set it to 512. I kept getting errors so I used sg3_utils to re-format the drives after the fact.
Code:
#sg_scan -i

This should list the drives for you. It did not list anything for me -- probably because I was using a LiveUSB and sg3_utils does not come pre-installed on the LiveUSB, so it couldn't recognize the drives.
So I tried lsscsi
Code:
#lsscsi -g

This listed my liveUSB and the other 3TB 520 formtted drive. I had connected only 1 drive at a time just to be sure of which drive I was working with. Then I did
Code:
#sg_readcap /dev/sda

which also listed the correct drive capacity. Then issuing
Code:
#sg_format --format --size=512 /dev/sda

started the formatting and converted the drive to 512 and I was able to use it on the linux system.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
You are right - I haven't reported back - and thats because I have done nothing yet.
I am considering the issues involved in killing my main pool and going back to 512e as a safer bet when it comes to swapping stuff out. I have spare disks, but some are 512 only and some are variable.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
OK - I (finally) did some testing.
The Hitachi SAS drives will format to 4096 (takes the better part of a day), but the Toshiba N300 will not, coming up with
Format unit command: Illegal request, type: sense key, apart from Invalid opcode FORMAT UNIT failed
 

eptesicus

Dabbler
Joined
Sep 12, 2018
Messages
20
OK - I (finally) did some testing.
The Hitachi SAS drives will format to 4096 (takes the better part of a day), but the Toshiba N300 will not, coming up with
Format unit command: Illegal request, type: sense key, apart from Invalid opcode FORMAT UNIT failed
Did you find a solution to this? I'm getting the problem with some HGST 10TB 4k SAS drives.
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
"If there's no solution, there's no problem."

In this case, there's no issue with using a 512e drive in a pool with ashift=12. ZFS will just always write sectors in multiples of 8.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
I reformatted all the drives that did go to 4096, rebuilt the pool with all 512 and am just ignoring the issue.
 
Top