To compile "zpool" on s10u9, I used the sources from OpenSolaris b138. The instructions how to compile are mostly unchanged from s10u8. The only required additional step is to compile and link against /usr/src/cmd/stat/common/timestamp.c. I am omitting further details.
For Solaris 11 Express, I used b147 as the basis. I was unable to find a complete on-src.tar.bz2 for this release, but had to pull the sources from hg.openindiana.org via hg (mercurial). I then compiled with:
cd /tmp
mkdir -p usr/src
cd ~ftp/pub/OpenSolaris/hg.openindiana.org/onnv-gate/usr/src
find \
cmd/stat/common \
common/zfs \
cmd/zpool \
lib/libuutil/common \
lib/libdiskmgt/common \
| cpio -pmdv /tmp/usr/src
cd /tmp/usr/src/cmd/stat/common
gcc -O2 -DTEXT_DOMAIN='"en_US"' -c timestamp.c
cd /tmp/usr/src/cmd/zpool
ln -s /usr/lib/libuutil.so.1 libuutil.so
gcc -O2 \
-Dzpool_rewind_policy_t=zpool_load_policy_t \
-DZPOOL_REWIND_REQUEST=ZPOOL_LOAD_REWIND \
-DZPOOL_REWIND_POLICY=ZPOOL_LOAD_POLICY \
-DZPOOL_REWIND_REQUEST_TXG=ZPOOL_LOAD_REWIND_TXG \
-DZPOOL_NO_REWIND=ZPOOL_NORMAL_LOAD \
-DTEXT_DOMAIN='"en_US"' \
-I/tmp/usr/src/cmd/stat/common \
-I/tmp/usr/src/common/zfs \
-I/tmp/usr/src/lib/libuutil/common \
-I/tmp/usr/src/lib/libdiskmgt/common \
-c *.c
gcc -o zpool *.o ../stat/common/timestamp.o \
-L. \
-lzfs \
-lnvpair \
-ldevid \
-lefi \
-ldiskmgt \
-luutil \
-lumem \
-L/lib -lcryptoutil
The modification to zpool_vdev.c is always the same (at line 474/475):
--- zpool_vdev.c.orig 2011-01-11 16:01:14.906720955 +0100
+++ zpool_vdev.c 2011-01-11 16:39:00.334827548 +0100
@@ -471,6 +471,7 @@
verify(nvlist_add_string(vdev, ZPOOL_CONFIG_PATH, path) == 0);
verify(nvlist_add_string(vdev, ZPOOL_CONFIG_TYPE, type) == 0);
verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_IS_LOG, is_log) == 0);
+ verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_ASHIFT, 12) == 0);
if (strcmp(type, VDEV_TYPE_DISK) == 0)
verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK,
(uint64_t)wholedisk) == 0);
For your convenience, I offer pre-compiled versions of the modified zpool program for s10u8, s10u9 and Solaris 11 Express.
So, this fix does not primarily work around a Solaris bug or missing feature, it works around a deficiency in the 4K sector disks.
Consequently, I am pretty sure that zpools with a higher ashift value will happily survive patches and/or upgrades.
I have been using this on an array of 12 2TB seagate baracuda LP drives.
Here are some results on testing a single disk using dd to write, read, then reread:
testing single drive on lsi controller in x4 slot:
10000000000 bytes (10 GB) copied, 97.0095 s, 103 MB/s
10000000000 bytes (10 GB) copied, 89.6962 s, 111 MB/s
10000000000 bytes (10 GB) copied, 87.5328 s, 114 MB/s
testing single drive on lsi controller WITH ASHIFT 12 in x4 slot:
10000000000 bytes (10 GB) copied, 82.6509 s, 121 MB/s
10000000000 bytes (10 GB) copied, 78.9441 s, 127 MB/s
10000000000 bytes (10 GB) copied, 77.043 s, 130 MB/s
running snv_151a solaris 11 express
The results are even more pronounced in raidz arrays
Thanks
Mick
chmod 755 /tmp/zpool-s11exp
I then gave command zpool create pool1 c8t1d0
It still creates pools with ashift=9. What am I missing?
cd ~ftp/pub/OpenSolaris/hg.openindiana.org/onnv-gate/usr/src
gives error "No such file or directory exists"
I have Solaris 11 Express with two 2TB WD20EARS (green) drives. It is a VM running on vmware esxi 4.1 boz. The two drives are RDM'ed to the Solaris VM.
With thanks to Christian, this is how I used the modified zpool binary zpool-s11exp
Download the binary and place somewhere - mine went into Downloads
# cd Downloads
# chmod 755 zpool-s11exp
# ./zpool-s11exp create mypool mirror c8d0 c9d0
That's it
Running zdb mypool |grep ashift
Shows ashift: 12
Mick