Morten-Christian Bernson
2010-Jan-15 16:03 UTC
[zfs-discuss] Is the disk a member of a zpool?
I was curious as to if it''s possible to know if a disk device (from the SAN) is a member of any zpool. The disks are shared to several servers, and the zpool is exported/imported between servers. I am writing a script to list all the disks available from the SAN with some misc. information, and it would be nice to list which pool the disk is a part of, and which disks are free to quickly find new disks when they are shared out from the san... It would not be possible to get this from a "zpool status" since all the disks will not be present on the machine, some may be in use in a zpool mounted on another machine. I have noticed though, that if you do a "format <disk device>" on a disk, it will tell you if this disk is a member of a ZFS pool, and the name of the pool in question. This much mean that this information is stored on the disk somehow, and the quetion is: Is it possible to get this information trough a command in a script? -- This message posted from opensolaris.org
The on Disk Layout is shown here: http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf You can use the name value pairs in the vdev label. ( I guess). Unfortunately I do not know any scripts. -- This message posted from opensolaris.org
Lutz Schumann wrote:> The on Disk Layout is shown here: > http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf > > You can use the name value pairs in the vdev label. ( I guess). Unfortunately I do not know any scripts.you can try zdb -l /dev/rdsk/cXtYdZs0