Hello ZFS Experts I have two ZFS pools zpool1 and zpool2 I am trying to create bunch of zvols such that their paths are similar except for consisent number scheme without reference to the zpools that actually belong. (This will allow me to have common references in my setup scripts) If I create zfs create -V 100g zpool1/tablespace1 zfs create -V 100g zpool2/tablespace2 zfs create -V 100g zpool1/tablespace3 zfs create -V 100g zpool2/tablespace4 Then I get /dev/zvol/rdsk/zpool1/tablespace1 /dev/zvol/rdsk/zpool1/tablespace2 /dev/zvol/rdsk/zpool1/tablespace3 /dev/zvol/rdsk/zpool2/tablespace4 As you notice I have two series zpool and tablespace.. I am trying to eliminate 1 series. So I tried zfs create zpool1/dbdata1 zfs create zpool2/dbdata2 zfs create zpool1/dbdata3 zfs create zpool2/dbdata4 And changed their mount point as follows zfs set mountpoint=/tablespace1 zpool1/dbdata1 zfs set mountpoint=/tablespace2 zpool1/dbdata2 zfs set mountpoint=/tablespace3 zpool2/dbdata3 zfs set mountpoint=/tablespace4 zpool2/dbdata4 And then created a common zvol name for all pools: zfs create -V 100g zpool1/dbdata1/data zfs create -V 100g zpool2/dbdata2/data zfs create -V 100g zpool1/dbdata3/data zfs create -V 100g zpool2/dbdata4/data I was expecting I will get /dev/zvol/rdsk/tablespace1/data /dev/zvol/rdsk/tablespace2/data /dev/zvol/rdsk/tablespace3/data /dev/zvol/rdsk/tablespace4/data Instead I got /dev/zvol/rdsk/zpool1/dbdata1/data /dev/zvol/rdsk/zpool2/dbdata2/data /dev/zvol/rdsk/zpool1/dbdata3/data /dev/zvol/rdsk/zpool2/dbdata4/data Any idea how do I get my abstracted zvol paths like I can do with my mountpoints in regular ZFS. Thanks. Regards, Jignesh
On Dec 8, 2006, at 05:20, Jignesh K. Shah wrote:> > Hello ZFS Experts > > I have two ZFS pools zpool1 and zpool2 > > I am trying to create bunch of zvols such that their paths are > similar except for consisent number scheme without reference to the > zpools that actually belong. (This will allow me to have common > references in my setup scripts) > > > > If I create > zfs create -V 100g zpool1/tablespace1 > zfs create -V 100g zpool2/tablespace2 > zfs create -V 100g zpool1/tablespace3 > zfs create -V 100g zpool2/tablespace4 > > Then I get > /dev/zvol/rdsk/zpool1/tablespace1 > /dev/zvol/rdsk/zpool1/tablespace2 > /dev/zvol/rdsk/zpool1/tablespace3 > /dev/zvol/rdsk/zpool2/tablespace4 > > As you notice I have two series zpool and tablespace.. I am trying > to eliminate 1 series. So I tried > > > zfs create zpool1/dbdata1 > zfs create zpool2/dbdata2 > zfs create zpool1/dbdata3 > zfs create zpool2/dbdata4 > > And changed their mount point as follows > zfs set mountpoint=/tablespace1 zpool1/dbdata1 > zfs set mountpoint=/tablespace2 zpool1/dbdata2 > zfs set mountpoint=/tablespace3 zpool2/dbdata3 > zfs set mountpoint=/tablespace4 zpool2/dbdata4 > > > And then created a common zvol name for all pools: > > zfs create -V 100g zpool1/dbdata1/data > zfs create -V 100g zpool2/dbdata2/data > zfs create -V 100g zpool1/dbdata3/data > zfs create -V 100g zpool2/dbdata4/data > > I was expecting I will get > /dev/zvol/rdsk/tablespace1/data > /dev/zvol/rdsk/tablespace2/data > /dev/zvol/rdsk/tablespace3/data > /dev/zvol/rdsk/tablespace4/data > > Instead I got > > /dev/zvol/rdsk/zpool1/dbdata1/data > /dev/zvol/rdsk/zpool2/dbdata2/data > /dev/zvol/rdsk/zpool1/dbdata3/data > /dev/zvol/rdsk/zpool2/dbdata4/data > > > Any idea how do I get my abstracted zvol paths like I can do with > my mountpoints in regular ZFS.setting the mountpoint isn''t going to affect the volume name .. for vanity zvol paths you''ll have to use symlinks .. try: mkdir /dev/zvol/rdsk/tablespace1 /dev/zvol/dsk/tablespace1 ln -s /dev/zvol/rdsk/zpool1/dbdata1/data /dev/zvol/rdsk/tablespace1/data ln -s /dev/zvol/dsk/zpool1/dbdata1/data /dev/zvol/rdsk/tablespace1/data ... etc ... or better yet, simply link to the underlying /devices entry and you don''t even have to keep it in the /dev/zvol tree since everything in the /dev tree is a symlink anyhow .. .je
I am already using symlinks. But the problem is the ZFS framework won''t know about them . I would expect something like this from ZVOL specially abstracting the poolname path from zvol. Specially since many database will store the path names in their metadata and is hard to change later on. Regards, Jignesh Jonathan Edwards wrote:> > On Dec 8, 2006, at 05:20, Jignesh K. Shah wrote: > >> >> Hello ZFS Experts >> >> I have two ZFS pools zpool1 and zpool2 >> >> I am trying to create bunch of zvols such that their paths are >> similar except for consisent number scheme without reference to the >> zpools that actually belong. (This will allow me to have common >> references in my setup scripts) >> >> >> >> If I create >> zfs create -V 100g zpool1/tablespace1 >> zfs create -V 100g zpool2/tablespace2 >> zfs create -V 100g zpool1/tablespace3 >> zfs create -V 100g zpool2/tablespace4 >> >> Then I get >> /dev/zvol/rdsk/zpool1/tablespace1 >> /dev/zvol/rdsk/zpool1/tablespace2 >> /dev/zvol/rdsk/zpool1/tablespace3 >> /dev/zvol/rdsk/zpool2/tablespace4 >> >> As you notice I have two series zpool and tablespace.. I am trying >> to eliminate 1 series. So I tried >> >> >> zfs create zpool1/dbdata1 >> zfs create zpool2/dbdata2 >> zfs create zpool1/dbdata3 >> zfs create zpool2/dbdata4 >> >> And changed their mount point as follows >> zfs set mountpoint=/tablespace1 zpool1/dbdata1 >> zfs set mountpoint=/tablespace2 zpool1/dbdata2 >> zfs set mountpoint=/tablespace3 zpool2/dbdata3 >> zfs set mountpoint=/tablespace4 zpool2/dbdata4 >> >> >> And then created a common zvol name for all pools: >> >> zfs create -V 100g zpool1/dbdata1/data >> zfs create -V 100g zpool2/dbdata2/data >> zfs create -V 100g zpool1/dbdata3/data >> zfs create -V 100g zpool2/dbdata4/data >> >> I was expecting I will get >> /dev/zvol/rdsk/tablespace1/data >> /dev/zvol/rdsk/tablespace2/data >> /dev/zvol/rdsk/tablespace3/data >> /dev/zvol/rdsk/tablespace4/data >> >> Instead I got >> >> /dev/zvol/rdsk/zpool1/dbdata1/data >> /dev/zvol/rdsk/zpool2/dbdata2/data >> /dev/zvol/rdsk/zpool1/dbdata3/data >> /dev/zvol/rdsk/zpool2/dbdata4/data >> >> >> Any idea how do I get my abstracted zvol paths like I can do with my >> mountpoints in regular ZFS. > > > setting the mountpoint isn''t going to affect the volume name .. for > vanity zvol paths you''ll have to use symlinks .. try: > > mkdir /dev/zvol/rdsk/tablespace1 /dev/zvol/dsk/tablespace1 > ln -s /dev/zvol/rdsk/zpool1/dbdata1/data /dev/zvol/rdsk/tablespace1/data > ln -s /dev/zvol/dsk/zpool1/dbdata1/data /dev/zvol/rdsk/tablespace1/data > ... etc ... > > or better yet, simply link to the underlying /devices entry and you > don''t even have to keep it in the /dev/zvol tree since everything in > the /dev tree is a symlink anyhow .. > > .je >
Jignesh K. Shah wrote:> I am already using symlinks. > But the problem is the ZFS framework won''t know about them .Can you explain how this knowledge would benefit the combination of ZFS and databases? There may be something we could leverage here.> I would expect something like this from ZVOL specially abstracting the > poolname path from zvol. > Specially since many database will store the path names in their > metadata and is hard to change later on.Which is why everyone I know uses symlinks :-) -- richard
The way I see it benefits is because it will mean less "stray" threads which is what I would call symlinks. Say if the mount option for zvols are used to define that purpose, ZFS metadata will always know how it is really being used. Also if someday we come up with the framework to dump the metadata out of one system and use that on a recovery system, we will cover all those hidden symlinks and save the customer the trouble of remembering all the symlinks that were created. I would say .. truly abstracting the poolname from the zvol path would be my main goal. What if in the middle of a database deployment I think the vol should go on a different pool. Now I have the poolname hard coded in my database and have to create a symlink referencing the poolname/path combination to the new poolname path. From the user point of view he is under the wrong impression from what he reads from the database. There are lot of scenarios where I think it will also help out a lot. Consider massive deployments of identical setups. A design which abstracts the zvol names is safer in scenarios where they end up with different pool names. . Atleast in my case where I am using DB2 with multiple partitions on the same server all having their own tablespace areas, a simplified zvol names cuts down the number of lines I have to write for all partition from N lines to 1 where I add the partition id to the end of it. I would say sleep over it to see where else it can apply. Thanks for considering my 2 cents. Regards, Jignesh Richard Elling wrote:> Jignesh K. Shah wrote: >> I am already using symlinks. >> But the problem is the ZFS framework won''t know about them . > > Can you explain how this knowledge would benefit the combination > of ZFS and databases? There may be something we could leverage here. > >> I would expect something like this from ZVOL specially abstracting >> the poolname path from zvol. >> Specially since many database will store the path names in their >> metadata and is hard to change later on. > > Which is why everyone I know uses symlinks :-) > -- richard