Trouble forcing 4k / ashift=12, need help with SD.conf

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

bp_968

New Member
Dec 23, 2012
45
0
0
I just can't seem to get it to force 4k even though the majority of the drives are 4k drives (only 2 of the 10 are not 4k!!). Its running in a ESX VM with passthrough so one of my options I think is using ZFS guru to make the pool, I was just hoping to get it all working through openindiana/napp-it.

Here is the SD.CONF file:

Code:
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
#

#4k override
sd-config-list =
    "ATA     SAMSUNG HD204UI", "physical-block-size:4096",
    "ATA     ST2000DL004 HD20", "physical-block-size:4096",
    "ATA     ST3250820NS", "physical-block-size:4096",
    "ATA     WDC WD15EARS-00S", "physical-block-size:4096";

name="sd" class="scsi" target=0 lun=0;
name="sd" class="scsi" target=1 lun=0;
name="sd" class="scsi" target=2 lun=0;
name="sd" class="scsi" target=3 lun=0;
name="sd" class="scsi" target=4 lun=0;
name="sd" class="scsi" target=5 lun=0;
name="sd" class="scsi" target=6 lun=0;
name="sd" class="scsi" target=7 lun=0;
name="sd" class="scsi" target=8 lun=0;
name="sd" class="scsi" target=9 lun=0;
name="sd" class="scsi" target=10 lun=0;
name="sd" class="scsi" target=11 lun=0;
name="sd" class="scsi" target=12 lun=0;
name="sd" class="scsi" target=13 lun=0;
name="sd" class="scsi" target=14 lun=0;
name="sd" class="scsi" target=15 lun=0;

#
# The following stub node is needed for pathological bottom-up
# devid resolution on a self-identifying transport. 
#
name="sd" class="scsi-self-identifying";

#
# Associate the driver with devid resolution.
#
ddi-devid-registrant=1;
and here is what napp-it created when I made a RAIDz2 pool (after editing sd.conf and rebooting):
 

bp_968

New Member
Dec 23, 2012
45
0
0
So i tried some more settings since I obviously had the wrong stuff plugged into SD.CONF. I updated it with the correct names of my drives and even tried doing it "wildcard" like suggested by napp-it but nothing works. If I remember correctly the WD RED drives report 4k sectors to the OS and so it shouldn't work at all with it set to ashift=9 right? Yet it does?

Code:
#4k override
sd-config-list =
    "ATA     SAMSUNG HD204UI", "physical-block-size:4096",
    "ATA     ST2000DL003-9VT1", "physical-block-size:4096",
    "ATA     HDS72202", "physical-block-size:4096",
    "ATA     WDC WD20EARS-00M", "physical-block-size:4096";
    "ATA     WDC WD20EFRX-68A", "physical-block-size:4096";
    "ATA     WDC WD20EADS-11R", "physical-block-size:4096";
    "ST", "physical-block-size:4096";
    "WDC", "physical-block-size:4096";
    "HDS", "physical-block-size:4096";
    "SAMSUNG", "physical-block-size:4096";
And the image of the pool:


At this point I don't know what to do. I'll probably just set it up with ashift=9 I guess and worry about it gagging on drives in the future since I won't upgrade the array anyway, I'd just build a new one with bigger drives in the future.

Regardless, I'm less and less impressed with ZFS by the day (at least on solaris). Having to edit a file and hope and pray it reads it correctly and does something automatically rather then just having a way to force it is moronic. It *should* allow a simple -switch to define sector size in the command to create a new pool.
 

gea

Well-Known Member
Dec 31, 2010
3,156
1,195
113
DE
Code:
#4k override
sd-config-list =
    "ATA     SAMSUNG HD204UI", "physical-block-size:4096",
    "ATA     ST2000DL003-9VT1", "physical-block-size:4096",
    "ATA     HDS72202", "physical-block-size:4096",
    "ATA     WDC WD20EARS-00M", "physical-block-size:4096";
    "ATA     WDC WD20EFRX-68A", "physical-block-size:4096";
    "ATA     WDC WD20EADS-11R", "physical-block-size:4096";
    "ST", "physical-block-size:4096";
    "WDC", "physical-block-size:4096";
    "HDS", "physical-block-size:4096";
    "SAMSUNG", "physical-block-size:4096";
.
I would also prefer to set this as an option of the zfs command but neither Oracle nor
Illumos did it this way, I suppose mainly because its only a home need and only a problem with some
first gen 4k disks that lie about their real internal structure (for compatibility with older Windows).

Your options are:
- stay with ashift=9 You have a higher usable capacity but cannot replace a disk with a "real" 4k disk
- include a disk that reports 4k physical sector/512 logical sectors (first gen report 512/512)
- edit sd.conf, but with correct syntax (list is a commalist with ; only at the end)
- use ZoL or BSD to create the pool and import to Solaris
 

bp_968

New Member
Dec 23, 2012
45
0
0
Thanks for the info. Since I already have a 2TB spare that also gets seen as a 512byte drive and works fine in the array I'll just stick with it at ashift=9. I keep rotated backups of everything anyway :)
 

yu130960

Member
Sep 4, 2013
127
10
18
Canada
Not trying to bring up an old thread, but just wanted to comment that I have had success on the above listed drives with the following syntax (different from OP):
Code:
#4k override
sd-config-list =
    "ATA     WDC WD20EARS-00M", "physical-block-size:4096",
    "ATA     Hitachi HDS72202", "physical-block-size:4096",
    "ATA     Hitachi HDS72302", "physical-block-size:4096";
 
Last edited: