Date: Tue, 18 Sep 2012 13:28:17 +0300 From: Daniel Kalchev <daniel@digsys.bg> To: freebsd-fs@freebsd.org Subject: Re: AW: AW: AW: AW: AW: ZFS: Corrupted pool metadata after adding vdev to a pool - no opportunity to rescue data from healthy vdevs? Remove a vdev? Rewrite metadata? Message-ID: <50584CC1.3030300@digsys.bg> In-Reply-To: <50581033.4040102@gmail.com> References: <001a01cd900d$bcfcc870$36f65950$@goelli.de> <504F282D.8030808@gmail.com> <000a01cd90aa$0a277310$1e765930$@goelli.de> <5050461A.9050608@gmail.com> <000001cd9239$ed734c80$c859e580$@goelli.de> <5052EC5D.4060403@gmail.com> <000a01cd9274$0aa0bba0$1fe232e0$@goelli.de> <505322C9.70200@gmail.com> <000001cd9377$e9e9b010$bdbd1030$@goelli.de> <50559CD8.1070700@gmail.com> <000001cd94f1$a4157030$ec405090$@goelli.de> <50581033.4040102@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 18.09.12 09:09, Volodymyr Kostyrko wrote: > > From my point of view all hype about moving to 4k sectors is highly > irrelevant to ZFS and current products on the market. > > 1. ZFS tends to use big recordsize for storing any data. This means > most files on your drives are already stored in 128k sectors. Storing > small tails in 512b or 4k sectors shouldn't give big difference. Truth is, ZFS will write blocks of size from your media sector size up to 128K. The problem is that ZFS writes these records (even 128K) aligned to the sector size. So, once you write some data that is under 4k, your pool will become misaligned. There are two problems with the 4k drives: - many of these drives lie about their sector size. You must instruct your software to threat them as 4k sector drives, otherwise the performance penalty (mostly for writing) is very significant. - new drives you buy will inevitably come with 4k sectors (or more) and if you need to replace a drive in large zpool you will start having abysmal write performance. > > 2. For older drives each drive should be partitioned with respect to > 4k sectors. This is what -a option of gpart does: it aligns created > partitions to 4k sector bounds. But half a year ago I already found > some drives that can auto-shift all disk transactions to optimize read > and write performance. Courtesy of Microsoft Windows, OS that does not > care about anything not written in license terms, same as the users > do, so using this drives would be more straightforward and would not > cause decent pain to IT stuff about realigning partitions the way it > would just work. > This is only hype. There is no way any disk firmware can shift any transactions. All these drives do when you write 512 bytes in any 4k sector is read the 4k sector, replace 512 bytes of it and write it back. Best you could hope is that sector is already in the disk cache, which of course is rare. The problem is not Windows itself, but the old MBR concept, that first partition starts at sector 63. Today, it is wise to always make sure new zpools are created with ashift=12. Daniel
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50584CC1.3030300>