2 Replies Latest reply on Jan 22, 2020 8:36 AM by YTC#1

    Zpool detach V Split

    YTC#1

      Bit of an S10/S11 question, maybe there is some where for purely ZFS queries (I did not think that the ZFS Appliance area was correct).

       

      I have a customer using zpool detach to split pools, then swing the

      disks to a new server (LDom) and import on that.

       

      It has been working, but I have advised to use split instead.

       

      Apparently that failed to import on the target (I am still awaiting the

      error report).

       

      They want to go back to using detach, I know split cleanly flushes the

      data etc, but can't find anything that says not to use detach for this

      operation.

       

      Anyone got any info ??

        • 1. Re: Zpool detach V Split
          bemo

          Hello,

           

          I think "zpool split" dosen't clear the data.

           

          When use "zpool split", the data and the meta data remains in both splitted pools.

          Also after splitting, data can be accessed by using "zpool import".

           

          -------------------------------

          # zpool status tank

            pool: tank

          state: ONLINE

            scan: none requested

          config:

           

                  NAME        STATE      READ WRITE CKSUM

                  tank        ONLINE        0     0     0

                    mirror-0  ONLINE        0     0     0

                      c1d3    ONLINE        0     0     0

                      c1d6    ONLINE        0     0     0

           

          # zfs list -r tank

          NAME   USED  AVAIL  REFER  MOUNTPOINT

          tank  1.00G  3.89G  1.00G  /tank

           

          # ls -lh /tank/

          total 2099233

          -rw-------   1 root     root        1.0G Apr 12 03:04 hoge

           

          # zpool split tank split-tank c1d6

           

          # zpool status tank

            pool: tank

          state: ONLINE

            scan: none requested

          config:

           

                  NAME    STATE      READ WRITE CKSUM

                  tank    ONLINE        0     0     0

                    c1d3  ONLINE        0     0     0

           

          errors: No known data errors

           

          # zpool import

            pool: split-tank   <--- !

              id: 4861564942752109418

          state: ONLINE

          action: The pool can be imported using its name or numeric identifier.

          config:

           

                  split-tank  ONLINE

                    c1d6      ONLINE   <--- the data and the meta data remains in c1d6

                   

          # zpool import split-tank

          # zfs list -r split-tank

          NAME         USED  AVAIL  REFER  MOUNTPOINT

          split-tank  1.00G  3.89G  1.00G  /split-tank

          # ls -lh /split-tank

          total 2099233

          -rw-------   1 root     root        1.0G Apr 12 03:04 hoge

          -------------------------------

           

          "zpool detach" clear the meta data.

          The data actually remains in pool, but cannot be accessed.

          -------------------------------

          # zpool status tank

            pool: tank

          state: ONLINE

            scan: resilvered 1.00G in 17s with 0 errors on Sun Apr 12 03:46:12 2020

           

          config:

           

                  NAME        STATE      READ WRITE CKSUM

                  tank        ONLINE        0     0     0

                    mirror-0  ONLINE        0     0     0

                      c1d3    ONLINE        0     0     0

                      c1d6    ONLINE        0     0     0

           

          errors: No known data errors

           

          # zpool detach tank c1d6

           

          # zpool import

          no pools available to import

          -------------------------------

           

          I hope this is the information you want.

           

          Regards,

          • 2. Re: Zpool detach V Split
            YTC#1

            Hi,

            Yes, this is the behavior I expect (I suppose I should have run up a test in Vbox (doh!).

            I need to double check with the custy *exactly* what he is doing, and get more info out of him as to what happened when he tried split and it failed.

             

            What I have been looking for is some more detail of how detach cleans up, I can find info on split flushing the data caches etc.