Date: Fri, 8 Apr 2016 23:08:52 +0300 From: Anton Sayetsky <vsasjason@gmail.com> To: Sebastian Wolfgarten <sebastian@wolfgarten.com> Cc: freebsd-questions@freebsd.org Subject: Re: Zfs - broken disk - add instead of attach - How to go back to mirrored setup? Message-ID: <CAA2O=b-3YZ3DWdDG8RAtUMsr60AD6Uv1Aqs9NRR4X14UtdYoqA@mail.gmail.com> In-Reply-To: <CAA2O=b-CV3k3td_9PMtXgkJkDTg9o-AJsKw2PjHkkMM2CwUkrg@mail.gmail.com> References: <6ACA8DAA-7D86-4FD0-B08C-2030CFF575C1@wolfgarten.com> <CAA2O=b8B3J9CUt%2BnjQOz=9e7KhK5a9F%2B%2BFtvL1rm41XVonggWw@mail.gmail.com> <CAA2O=b-CV3k3td_9PMtXgkJkDTg9o-AJsKw2PjHkkMM2CwUkrg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
8 =D0=B0=D0=BF=D1=80. 2016 =D0=B3. 22:59 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0= =BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Sebastian Wolfgarten" < sebastian@wolfgarten.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > > Dear all, > > I used to have a ZFS-based mirror and now thanks to a typo I have one big disk of 5.4TB instead of a 2.7T mirror - how do I get back to having a mirror? > > Here is what happened: > > Last week one of my hard drives broke requiring me to detach & replace the disk: > > server1 - ZFS pool - HEALTH fault > > NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROO= T > zroot 2.72T 763G 1.97T 18% - 27% 1.00x DEGRADED - > > pool: zroot > state: DEGRADED > status: One or more devices has been removed by the administrator. > Sufficient replicas exist for the pool to continue functioning in a > degraded state. > action: Online the device using 'zpool online' or replace the device with > 'zpool replace'. > scan: scrub repaired 0 in 3h48m with 0 errors on Fri Mar 25 10:48:35 2016 > config: > > NAME STATE READ WRITE CKSUM > zroot DEGRADED 0 0 0 > mirror-0 DEGRADED 0 0 0 > 5383010007106655398 REMOVED 0 0 0 was > /dev/diskid/DISK-Z1F0LSM7p3 > gpt/zfs1 ONLINE 0 0 0 > > errors: No known data errors > > # zpool detach zroot /dev/diskid/DISK-Z1F0LSM7p3 > > After the provider put in a new disk, I made a mistake (i.e. I added the disk to the zroot pool instead of attaching it) and now I was wondering how to recover from this situation: > > # zpool add zroot ada0 > > Here is what zroot now looks like: > > # zpool status zroot > pool: zroot > state: ONLINE > scan: scrub canceled on Fri Apr 8 21:27:31 2016 > config: > > NAME STATE READ WRITE CKSUM > zroot ONLINE 0 0 0 > gpt/zfs1 ONLINE 0 0 0 > ada0 ONLINE 0 0 0 > > errors: No known data errors > > I tried to remove/disable/offline the second disk but that did not work: > > # zpool offline zroot ada0 > cannot offline ada0: no valid replicas > # zpool remove zroot ada0 > cannot remove ada0: only inactive hot spares, cache, top-level, or log devices can be removed > # zpool detach zroot ada0 > cannot detach ada0: only applicable to mirror and replacing vdevs > > Now my question is: How can I get back to having a mirror without loosing all the data on ada1? Any ideas? Using ZFS split maybe? Unfortunately, it's impossible. You must backup pool data and recreate it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAA2O=b-3YZ3DWdDG8RAtUMsr60AD6Uv1Aqs9NRR4X14UtdYoqA>