ZFS Keep a specific filesystem on a designated disk

Hello,

Let's say that I have a zpool with 2 disks - disk01 and disk02. On the zpool there are zfs file systems- FS01, FS02, FS03.
I'd like to organize the fs allocation in a way that FS01 resides exclusively on disk01, FS02 on disk02 and FS03 is mirrored between disk01 and disk02.
For those of you familiar with AIX, is there a concept of LPs and PPs on zfs? Can file systems be moved between disks?
 
Not possible with ZFS. Not on a vdev that contains both disks. If you want something like that you're going to have to create three separate pools.
 
... and FS03 is mirrored between disk01 and disk02.

Part of the point of ZFS is you don't have to micro manage this. If you had a striped pool and you wanted to add some redundancy for the FS03 filesystem in your example, you can get limited degree of control with the zfs set copies=2 <filesystem> to ensure data gets written to 2 independent vdevs. However rather then adding redundancy like this you would be far better off using a mirror or RAID-Z pool and let ZFS handle things behind the scenes.
 
what you can do is make 2 separate pools.
Code:
zpool create singlepool1 disk1
zpool create singlepool2 disk2

then make 2 vzvols one on each disk.
Code:
zfs create -V 100G singlepool1/zvol1
zfs create -V 100G singlepool2/zvol2

then make a mirrored pool out of zvol1 and zvol2
Code:
zpool create mirrorpool1 mirror /dev/zvol/singelpool1/zvol1 /dev/zvol/singelpool2/zvol2

now you have 3 pools first pool on disk 1 second on disk 2 and the third on disk 1 and 2, the nice thing about zvols is that you can easily expand them to make mirrorpool1 bigger i have not tested the comands so dont copy past them. :)
 
Last edited by a moderator:
(...)If you had a striped pool and you wanted to add some redundancy for the FS03 filesystem in your example, you can get limited degree of control with the zfs set copies=2 <filesystem> to ensure data gets written to 2 independent vdevs.(...)
As far as I know, copies=N>1 does not guarantee that the copies will be written to independent/different vdevs.

cellini: I think there's still a chance of deadlock when running a zpool on top of a zvol in the same kernel. Should be "fine" to use geom mirror + ufs though. :)
 
Back
Top