After a recent upgrade to FreeBSD 10.0-RELEASE (from 9.2-RELEASE), I get the following error message, and I can't properly handle it:
After some research, this is what I gathered about this problem:
The problem is I'm not very familiar with ZFS' inner workings and constructed my pool a while back, so I'm a little apprehensive about jumping right in there destroying pools and providers using unfamiliar commands, like gnop(8) in step 04, and I can't tell if I need to zero the partition (or part of it) between steps 02 and 03 with
Which was intended to make everything align correctly. In fact,
I used the following guide as reference when first installing FreeBSD: http://blogs.freebsdish.org/pjd/2010/08/06/from-sysinstall-to-zfs-only-configuration/. If you guys need the specifics of what I changed I can post it here.
About this system, it's a very small media server with two identical 2TB WD Caviar Green drives, mirroring each other. Each is partitioned according to the above guide, with identical boot partitions and encrypted mirrored swap. I do have backups, but only of critical data. Those steps would be executed through ssh while the system is live, I have thought about doing it from a live FreeBSD disk booted on the actual machine.
Code:
# zpool status
pool: system
state: ONLINE
status: One or more devices are configured to use a non-native block size.
Expect reduced performance.
action: Replace affected devices with devices that support the
configured block size, or migrate data to a properly configured
pool.
scan: resilvered 1.63G in 0h3m with 0 errors on Thu Mar 29 13:17:43 2012
config:
NAME STATE READ WRITE CKSUM
system ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
gpt/system1 ONLINE 0 0 0 block size: 512B configured, 4096B native
gpt/system0 ONLINE 0 0 0 block size: 512B configured, 4096B native
After some research, this is what I gathered about this problem:
- This happened because my drives misrepresent their sector size;
- My pool's ashift is 9 which doesn't align with my drives' 4K sectors;
- A pool's ashift can't be changed after creation.
Code:
01. # zpool detach system1
02. # gpart delete -i 3
03. # gpart create -a4k -t freebsd-zfs -l system1 ada1
04. # gnop create -S 4096 /dev/gpt/system1
05. # zpool create -O mountpoint=/mnt -O atime=off -O setuid=off -O canmount=off -O xattr=on temporary /dev/gpt/system1.nop
06. # zfs snapshot system@001
07. # zfs send system | zfs recv -d temporary
08. # zfs umount temporary
09. # zfs set mountpoint=/ temporary
10. # zfs set mountpoint=/mnt system
11. # zpool export system
12. # zpool import system old
13. # zpool export temporary
14. # gnop destroy /dev/gpt/system1.gnop
15. # zpool import temporary system
dd if /dev/zero of /dev/ada1p3
or something. I also suspect the flags -a4k isn't needed on step 03, considering the original setup:
Code:
# gpart create -s GPT ada1
# gpart add -b 1m -s 128 -t freebsd-boot ada1
# gpart add -s 16g -t freebsd-swap -l swap1 ada1
# gpart add -t freebsd-zfs -l system 1 ada 1
geom part list ada1 -v
gives all offsets and lengths as multiples of 4096. The partitions don't start at a multiple, though, which I can't tell is relevant. Also, Sectorsize is 512 and Stripesize is 4096.I used the following guide as reference when first installing FreeBSD: http://blogs.freebsdish.org/pjd/2010/08/06/from-sysinstall-to-zfs-only-configuration/. If you guys need the specifics of what I changed I can post it here.
About this system, it's a very small media server with two identical 2TB WD Caviar Green drives, mirroring each other. Each is partitioned according to the above guide, with identical boot partitions and encrypted mirrored swap. I do have backups, but only of critical data. Those steps would be executed through ssh while the system is live, I have thought about doing it from a live FreeBSD disk booted on the actual machine.
Code:
# uname -a
FreeBSD domain.example.com 10.0-STABLE FreeBSD 10.0-STABLE #0 r267465: Sun Jun 15 02:04:26 BRT 2014 root@domain.example.com:/usr/obj/usr/src/sys/CUSTOM amd64