Can I rebuild array after my action? (Solved)

fleg

Dabbler
Joined
Mar 13, 2019
Messages
10
I have older FreeNAS 9.3 at home with 2 data disks in ZFS pool.
One disk failed and I remove it from pc.
Unfortunately then I made offline and detach failed disk with zpool and now I have this situation.
zpool status
pool: Backup
state: ONLINE
scan: scrub repaired 0 in 1h1m with 0 errors on Sun Feb 6 01:01:09 2022
config:

NAME STATE READ WRITE CKSUM
Backup ONLINE 0 0 0
gptid/75d491d5-8ce5-11eb-800c-009c02abdcba ONLINE 0 0 0

errors: No known data errors
It`s ZFS.
mount
freenas-boot/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
tmpfs on /etc (tmpfs, local)
tmpfs on /mnt (tmpfs, local)
tmpfs on /var (tmpfs, local)
freenas-boot/grub on /boot/grub (zfs, local, noatime, nfsv4acls)
Backup on /mnt/Backup (zfs, local, nfsv4acls)
Backup/Public on /mnt/Backup/Public (zfs, local, nfsv4acls)
Backup/Test on /mnt/Backup/Test (zfs, local, nfsv4acls)
Backup/.system on /var/db/system (zfs, local, nfsv4acls)
Backup/.system/cores on /var/db/system/cores (zfs, local, nfsv4acls)
Backup/.system/samba4 on /var/db/system/samba4 (zfs, local, nfsv4acls)
Backup/.system/syslog-5ece5c906a8f4df886779fae5cade8a5 on /var/db/system/syslog-5ece5c906a8f4df886779fae5cade8a5 (zfs, local, nfsv4acls)
Backup/.system/rrd-5ece5c906a8f4df886779fae5cade8a5 on /var/db/system/rrd-5ece5c906a8f4df886779fae5cade8a5 (zfs, local, nfsv4acls)
Backup/.system/configs-5ece5c906a8f4df886779fae5cade8a5 on /var/db/system/configs-5ece5c906a8f4df886779fae5cade8a5 (zfs, local, nfsv4acls)
I think I made mistake because now pool working with only 1 disk and I try to add another disk it will be stripe array not mirror.
Am I right?
Question is if I`m able to rebuild mirror array without data lost.,,,maybe via zpool?
I know, I can backup data, destroy pool and make another one with Volume manager via web....this is my last possible way, but I`d like to try rebuild array with more sophisticated.....is it possible?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Do NOT add another disk to the pool. That will result in a stripe of two nonredundant disks, which is NOT what you want.

Instead, go to Pool, and then to Pool Status. From there, in the list of drives, select the drive, and in the three-dots menu at the end of the line, "Extend". Adding another disk will cause it to transform into a mirror. If you want to complain that that's nonobvious, we agree.

As discussed just yesterday in

 

fleg

Dabbler
Joined
Mar 13, 2019
Messages
10
Instead, go to Pool, and then to Pool Status.
This can be helpful fromFreeNAS 11, I have 9.3 version, there is no pool in the web gui, only Volume manager. I can import disk via web but there are 2 issues...
First one
  • The selected disks were not verified for these import rules. Filesystem check failed

2nd one I think this create strip, not mirror array.

Probably there is already stripe array becase I detached 2nd disk from array and I can see it on volume status via web gui.

This is zpool history.

2022-02-13.12:50:48 zpool import -c /data/zfs/zpool.cache.saved -o cachefile=none -R /mnt -f 18216575941159810719
2022-02-13.12:50:48 zpool set cachefile=/data/zfs/zpool.cache Backup
2022-02-13.13:16:20 zpool offline Backup /dev/gptid/74d6ea66-8ce5-11eb-800c-009c02abdcba
2022-02-13.13:32:59 zpool detach Backup 13432333589196633107
2022-02-13.13:55:28 zpool import -c /data/zfs/zpool.cache.saved -o cachefile=none -R /mnt -f 18216575941159810719
2022-02-13.13:55:28 zpool set cachefile=/data/zfs/zpool.cache Backup
I can see via web gui volume status stripe, not mirror.

I think there is only one way via shell...maybe zpool command? Maybe I can convert stripe to mirror?.
I`m affraid if I try to use zpool attach 2nddisk it makes stripe pool? And what about data? Now I have no backup, I`m careful.
 

fleg

Dabbler
Joined
Mar 13, 2019
Messages
10
My howto.

1. Backup data;o).
2. gpart create -s gpt ada0 (ada0 is my new disk)
3. gpart add -t freebsd-ufs ada0
4. newfs /dev/ada0p1
5. glabel status (show disk`s id)
6. zpool attach Backup gptid/75d491d5-8ce5-11eb-800c-009c02abdcba gptid/202b4eef-8d9c-11ec-856a-009c02abdcba

1st disk is old good disk, 2nd one is new good disk.
Now it`s look fine.

[root@freenas] ~# zpool status Backup
pool: Backup
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Mon Feb 14 14:52:52 2022
26.9G scanned out of 319G at 78.4M/s, 1h3m to go
26.9G resilvered, 8.43% done
config:

NAME STATE READ WRITE CKSUM
Backup ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
gptid/75d491d5-8ce5-11eb-800c-009c02abdcba ONLINE 0 0 0
gptid/202b4eef-8d9c-11ec-856a-009c02abdcba ONLINE 0 0 0 (resilvering)

errors: No known data errors


SOLVED
 
Top