Zpool query

Hi,

I have an X86pc with Solaris 10 and ZFS system. It has 8 similar disks.
I need help in creating some zpools and changing the mount-point of a slice.

Currently, the zpool in my system is like this:

root@abcxxx>zpool status
  pool: rpool
 state: ONLINE
 scrub: none requested
config:

        NAME                       STATE     READ WRITE CKSUM
        rpool                      ONLINE       0     0     0
          c0t5000C50047C6CBD5d0s0  ONLINE       0     0     0

errors: No known data errors
root@abcxxx>

I need to create a pool like this:

root@abcxxx>zpool status
  pool: rpool
 state: ONLINE
 scrub: scrub completed after 0h2m with 0 errors on Tue Sep  4 03:02:08 2012
config:

        NAME                         STATE     READ WRITE CKSUM
        rpool                        ONLINE       0     0     0
          mirror-0                   ONLINE       0     0     0
            c0t5000C50047C6CBD5d0s0  ONLINE       0     0     0
            c0t5000CCA02533FC85d0s0  ONLINE       0     0     0
        spares
          c0t5000CCA025387065d0s0    AVAIL   
          c0t5000CCA0253C4D95d0s0    AVAIL   

errors: No known data errors

  pool: xpool
 state: ONLINE
 scrub: scrub completed after 0h0m with 0 errors on Tue Sep  4 03:03:13 2012
config:

        NAME                         STATE     READ WRITE CKSUM
        xpool                        ONLINE       0     0     0
          mirror-0                   ONLINE       0     0     0
            c0t5000CCA0252B6215d0s0  ONLINE       0     0     0
            c0t5000CCA0252B36D9d0s0  ONLINE       0     0     0
          mirror-1                   ONLINE       0     0     0
            c0t5000CCA0252699DDd0s0  ONLINE       0     0     0
            c0t5000CCA0252B34EDd0s0  ONLINE       0     0     0
        spares
          c0t5000CCA025387065d0s0    AVAIL   
          c0t5000CCA0253C4D95d0s0    AVAIL   

errors: No known data errors
root@abcxxx>

I am not very familiar with the usage of zpool command and tried using various options but ended up creating wrong pools and re-installing the system. So, I need help in creating the above pools.

Also, one of my directories zpool/var/opt/abc is mounted on /var/opt/abc slice. Once the pools are created, I need to change the mount-point from zpool/var/opt/abc to xpool/var/opt/abc. How can i do that?

Thanks in advance.
Mayaank

Here is how I would do it (although untested):

prtvtoc /dev/rdsk/c0t5000C50047C6CBD5d0s2 | fmthard -s - /dev/rdsk/c0t5000CCA02533FC85d0s2
installgrub /boot/grub/stage1 /boot/grub/stage2 c0t5000CCA02533FC85d0s0
zpool attach -f rpool c0t5000C50047C6CBD5d0s0 c0t5000CCA02533FC85d0s0
zpool add rpool spare c0t5000CCA025387065d0s0
zpool add rpool spare c0t5000CCA0253C4D95d0s0

zpool create xpool mirror c0t5000CCA0252B6215d0s0 c0t5000CCA0252B36D9d0s0 mirror c0t5000CCA0252699DDd0s0 c0t5000CCA0252B34EDd0s0
zpool add xpool spare c0t5000CCA025387065d0s0
zpool add xpool spare c0t5000CCA0253C4D95d0s0

Your last request is less clear. Not sure exactly what you mean with zpool/var/opt/abc. Is it a dataset (file system) ? Don't you mean rpool/var/... instead of zpool/var/... ?

Perhaps something like:

zfs set mountpoint=/xpool/var/opt/abc rpool/var/opt/abc to 
1 Like

Many Thanks jlliagre,

Your post was very helpful. Only

 installgrub /boot/grub/stage1 /boot/grub/stage2 c0t5000CCA02533FC85d0s0 

was not working for me. But the pools are created now as per expectation.

BR// :b:

I should have written:

installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t5000CCA02533FC85d0s0
zfs create -o mountpoint=<mount-point> pool0/amy-name