converting 512B alignment pool to 4K aligned pool

184 views
Skip to first unread message

Dave Cottlehuber

unread,
Sep 21, 2013, 6:14:51 PM9/21/13
to zfs-...@googlegroups.com
Hey,

I discovered I've got one of those 4K aligned SSD drives, but it was created before this feature was available in MacZFS. So  I should fix that :-)

Can I mirror the pool to another (larger) HD and then re-mirror back?

I guess the question actually is, is alignment part of the pool properties?

And given that AFAICT it is, what's the best way to fix this? I have a lot of zfs compressed filesystems if that's relevant.

A+
Dave


Graham Perrin

unread,
Sep 22, 2013, 6:35:12 AM9/22/13
to zfs-...@googlegroups.com
AFAIK: with implementations of ZFS such as the current MacZFS stable, you can't convert – the ashift property value can be set only at the time of creation of a pool. 

If you give your larger drive to a new pool, then you might: 

a) use zfs send and receive to effectively clone all content of the original pool, to the pool that uses the larger drive

b) backup

c) destroy the original pool (where the ashift property value is not what's required)

d) recreate the pool with the required ashift property value

e) zfs send and receive, from the larger drive to the recreated pool. 

Amongst the answers to frequently asked questions: 

What should I do with 4k (Advanced Format) hard drives

Add "-o ashift" to zpool add

– so we may expect to find that improvement in a future stable version of MacZFS. 

HTH

Bjoern Kahl

unread,
Oct 27, 2013, 5:20:34 PM10/27/13
to zfs-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Sorry for answering an old thread, but I was away for a long time.

Am 22.09.13 12:35, schrieb Graham Perrin:
> AFAIK: with implementations of ZFS such as the current MacZFS
> stable, you can't convert – the ashift property value can be set
> only at the time of creation of a pool.

Actually you can mix and match different ashift values in the same
pool. Although the preferred "ashift" value is stored in the pool
property list, it is technically a vdev property and as such can be
set independently for each top-level vdev.

When adding a new top-level vdev you can say "zpool add -o ashift=xx".
If no ashift is specified on the command line, then it takes the value
stored in the pool property list or "9" if the property is not set.
That is the only purpose of the "ashift" property. It is completely
ignored by the zfs code, apart form serving as default for "zpool
add".

This works since MacZFS 74.3 from April 2, 2013. [1]


> If you give your larger drive to a new pool, then you might:
>
> a) use zfs send and receive to effectively clone all content of the
> original pool, to the pool that uses the larger drive
>
> b) backup
>
> c) destroy the original pool (where the ashift property value is
> not what's required)
>
> d) recreate the pool with the required ashift property value
>
> e) zfs send and receive, from the larger drive to the recreated
> pool.
>
> Amongst the answers to frequently asked questions:
>
> What should I do with 4k (Advanced Format) hard drives
> <http://code.google.com/p/maczfs/wiki/FAQ#What_should_I_do_with_4k_(Advanced_Format)_hard_drives?>
>
> ----
>
> In the ZFS on Linux area:
>
> Add "-o ashift" to zpool add
> <https://github.com/zfsonlinux/zfs/issues/566> (closed 2012-11-06)
>
>
> – so we may expect to find that improvement in a future stable
> version of MacZFS.

It is in since MacZFS 74.3, which was released April 2nd 2013.


Best regards

Björn

[1]
https://github.com/BjoKaSH/mac-zfs/commit/592fe6dca47a016389978b18cf4f43af2924e894
- --
| Bjoern Kahl +++ Siegburg +++ Germany |
| "googlelogin@-my-domain-" +++ www.bjoern-kahl.de |
| Languages: German, English, Ancient Latin (a bit :-)) |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQCVAgUBUm2DmVsDv2ib9OLFAQKffgQApE8kYIrf0ghIOnN0acGvLpzIJt2+vDGe
jxT4/LdMAyEhKLhunpwluYSm6LWnI8YukpQ6ikK7+MRI90M+l31MMEz2VExX7dyk
HeyB73EOnn54ygWDq88mBiEqtIV297HvH/YSb7McMHir17nIZ6wwEINMPYI6gPiA
RsMLbF4J5JA=
=fG9f
-----END PGP SIGNATURE-----

David Hunt

unread,
Oct 29, 2013, 8:17:00 PM10/29/13
to zfs-...@googlegroups.com
I wanted to make sure I did this correctly.
 
I created a pool of 5x 2TB drives. As I was putting the drives in the computer I discovered that two of them (Toshiba's) were still 512b drives, the rest were 4K. My goal is to slowly replace each drive with a 4TB drive so that I can grow it out eventually.
 
When I created the pool I did
 
zpool create -o ashift=12 poolname raidz /disk1 /disk2 /disk3 /disk4 /disk5
 
Did that correctly apply ashift of 12 to all the vdev's in the pool so that later I can replace them with 4K native drives? Based on what I was reading that it's probably safer to just always use the ashift=12 option so that everything going forward will be compatible no matter what. 
 
This pool is strictly for large video files by the way. So I am not concerned about loss of space due to using too big a block of data.
Reply all
Reply to author
Forward
0 new messages