7 Replies Latest reply: Feb 3, 2010 11:26 AM by user4994457 RSS

    zpool expand? how to

    807567
      I have a volume from SAN which is managed by ZFS (zpool) on solaris 10 box. There is need to increase the voulme, this was done on the SAN and this reflect on solaris format command.
      I export the zpool and try to create a slice using the extra volume but it give me an error that the size specified is out of range.
      is it not possible to increase a pool by exporting the zpool and using format to increase it then import it back?
        • 1. Re: zpool expand? how to
          user4994457
          ibroxy wrote:
          I have a volume from SAN which is managed by ZFS (zpool) on solaris 10 box. There is need to increase the voulme, this was done on the SAN and this reflect on solaris format command.
          Solaris doesn't make this easy today.
          I export the zpool and try to create a slice using the extra volume but it give me an error that the size specified is out of range.
          is it not possible to increase a pool by exporting the zpool and using format to increase it then import it back?
          The likely issue is that the label on the disk remains in place with the old size. So ZFS isn't seeing the increase yet. (And you don't have to do anything with ZFS... If the existing pool is on the whole disk, it'll pick up the increase automatically).

          If you have the pool using the whole disk, and it has used an EFI format, this is doable, but annoying. You'd probably want to have a backup, and you'll probably want to verify the procedure on a non-production lun first.

          *) Export the pool
          *) Examine the LUN with format or prtvtoc. Should have slice0 taking up the whole disk (sector 34 to end)
          *) Increase the LUN size
          *) Destroy the label on the disk (format -e -> label -> go to SMI, then label -> go to EFI)
          *) With EFI label, recreate slice 0, now bigger (again, take all the space available)
          *) Now that slice is larger, import the pool. ZFS should show more space available on the disk.

          If you are using slices instead of the whole disk, or if you are using SMI labels, then this procedure changes somewhat.

          --
          Darren
          • 2. Re: zpool expand? how to
            807567
            Darren_Dunham wrote:
            *) Export the pool*
            ) Examine the LUN with format or prtvtoc. Should have slice0 taking up the whole disk (sector 34 to end)
            *) Increase the LUN size*
            ) Destroy the label on the disk (format -e -> label -> go to SMI, then label -> go to EFI)
            *) With EFI label, recreate slice 0, now bigger (again, take all the space available)*
            ) Now that slice is larger, import the pool. ZFS should show more space available on the disk.

            If you are using slices instead of the whole disk, or if you are using SMI labels, then this procedure changes somewhat.

            --
            Darren
            This method destroys data. Is there a method available which keeps the data? At least you should mention this crucial point in your post.
            • 3. Re: zpool expand? how to
              user4994457
              >
              This method destroys data. Is there a method available which keeps the data? At least you should mention this crucial point in your post.
              At what point do you think data is destroyed? This method should not destroy data. (That doesn't mean I'd want to try this without having a backup, but it should work.) I don't have easy access to a real resizable LUN to try this.

              I have done essentially the same thing under VMware, where I used the vmware tools to resize the "disk" that is presented to the virtual OS. Using the same steps from that point forward succeeded. There was no loss of data.

              The only thing overwritten in the steps is the disk label, not data.

              --
              Darren
              • 4. Re: zpool expand? how to
                807567
                I think at that point my data was destroyed:

                Destroy the label on the disk (format -e -> label -> go to SMI,
                then label -> go to EFI)

                I had a backup and I always do such things on a test machine first, so no damage occurred. But I don't know exactly what to do on a production machine and I can't find an exact description how it works without data loss.

                I guess the problem might be that we lease SAN volumes which are already configured with data redundancy. Additional zfs mirror would be a kind of an overkill, double disk cost.

                If you can provide a hint or a link to a tutorial which covers the issue "unmirrored zfs on SAN" I would appreciate.
                • 5. Re: zpool expand? how to
                  user4994457
                  Calamity wrote:
                  I think at that point my data was destroyed:

                  Destroy the label on the disk (format -e -> label -> go to SMI,
                  then label -> go to EFI)
                  That only rewrites the label on disk. This whole section in my post is under "if you have an EFI label..." Did you have an EFI label? You weren't trying to do this on a VTOC disk, were you?

                  Doing this for a VTOC label should be similar, but the details would be different.
                  I had a backup and I always do such things on a test machine first, so no damage occurred. But I don't know exactly what to do on a production machine and I can't find an exact description how it works without data loss.
                  The "label" on the disk tells the OS where the data lives. As long as you know the details, you can destroy the label and put a new one in place and point things back to where they are. The relabel doesn't touch the actual filesystem data on the disk. When you're using ZFS and an EFI label, this is very simple. You just have to create one slice that encompasses the entire disk. ZFS will find the ZFS headers at the beginning of the slice and pull in the data.

                  --
                  Darren
                  • 6. Re: zpool expand? how to
                    807567
                    Thanks a lot for the details, I will try it again on my test system at the next opportunity and report my experiences. It was an EFI label (its always EFI when you use zfs isn't it?).
                    • 7. Re: zpool expand? how to
                      user4994457
                      If you give a non-boot disk to ZFS as the whole disk (cxtxdx or cxtx), then yes it will default to putting on an EFI label. This is nice because there's no question of where the data falls. It will always allocate space at the beginning of the data area for ZFS.

                      If you give ZFS an existing partition (cxtxdxsx or cxtxsx), then it won't change the label.

                      --
                      Darren