Forum Stats

  • 3,751,824 Users
  • 2,250,415 Discussions
  • 7,867,600 Comments

Discussions

Is there a way to remove a mirror from a ZFS pool without using snapshots?

User_1CPQU
User_1CPQU Member Posts: 4 Green Ribbon

Hello everyone!

I added incorrect disks to a mirror in a zfs pool. Is it possible to removethis mirror from pool without creating snapshots or stopping the applications? I would like to remove mirror-1 from rpool_db below:


    NAME        STATE    READ WRITE CKSUM

       rpool_db    ONLINE      0    0    0

         mirror-0  ONLINE      0    0    0

           c1t2d0  ONLINE      0    0    0

           c1t3d0  ONLINE      0    0    0

         mirror-1  ONLINE      0    0    0

           c1t10d0 ONLINE      0    0    0

           c1t13d0 ONLINE      0    0    0


Thanks!

Answers

  • Nik
    Nik Member Posts: 2,796 Bronze Crown

    Hi.

    1. Are You have ZFS storage appliance or general Solaris with ZFS ( what version) ?
    2. You need just remove mirror-1 from this pool or replace disks on other in this mirror?

    You can remove online mirror-1 on Solaris 11.4

    ( https://docs.oracle.com/cd/E37838_01/html/E61017/remove-devices.html)


    On Solaris 10, Solaris 11 before 11.4 - You can online detach disk from mirror, replace disk by other, but can not remove top level virtual data device.

    In case You require it : You should backup data, destroy pool, create new and restore data.

    In any case you should have backup.

    Regards,

    Nik

  • User_1CPQU
    User_1CPQU Member Posts: 4 Green Ribbon

    Thanks a lot for answer.

    I have Solaris 10. This ZFS pool has multiple mirrors. I would like to remove one mirror entirely (2 disks). They should be added to another ZFS tool. I run the wrong command and added them to this pool erroneously... Just one command and this big trouble.

    In my case is there something I can do? Can I move the data from this mirror to other disks to take them off?

  • Nik
    Nik Member Posts: 2,796 Bronze Crown

    Hi.

    Solaris 10 do not allow delete mirror from pool.

    You should backup data; destroy pool and create it again with correct configuration; restore data.

    All this require stop application.

    You can try optimize this process in case have some unused disks. ( Or agree that lost 2 disks).

    Regards,

    Nik

  • User_1CPQU
    User_1CPQU Member Posts: 4 Green Ribbon

    OMG....

    Today this pool has 12 disks (6 mirrors) and should have 8 disks (4 mirrors). Its the application pool and I dont have other disks or backup systems....

  • User_1CPQU
    User_1CPQU Member Posts: 4 Green Ribbon

    Maybe I can move some disks from each mirror (not the entire mirror) to another pool and move data from this pool to there before I destroy it. Is that possible?


    Imagine in thie scenario above I move disks c1t3d0 and c1t13d0 to another mirror. Is that possible?

    If yes, Can I move everything in the old pool to this new pool?

  • Nik
    Nik Member Posts: 2,796 Bronze Crown

    Hi.

    You can detach any one disk from any submirrors. ( c1t3d0 and c1t13d0)

    https://docs.oracle.com/cd/E19253-01/819-5461/gcfhe/index.html

    After you can attach this disk to another pool. But its' not move data. You just move free space.

    For move data You should use general file-copy commands (сp; cpio; tar) or zfs send / zfs recive.


    You can split mirrored pool and got 2 independent pools with same data.

    https://docs.oracle.com/cd/E19253-01/819-5461/gjooc/index.html


    Plan all steps.

    Zpool very easy make grow, but big problem shrink it.


    Regards,

    Nik