Fix offline and online operations for encrypted disks
Steps to reproduce using the new web interface:
- Setup 4 drives in an encrypted raidz2 storage pool
- Storage > Pool > Pool Operations (Gear) > Status > Offline any of the disks
- Storage > Pool > Pool Operations (Gear) > Status > Online the offlined disk
Error: Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/tastypie/resources.py", line 219, in wrapper response = callback(request, *args, **kwargs) File "./freenasUI/api/resources.py", line 886, in online_disk notifier().zfs_online_disk(obj, deserialized.get('label')) File "./freenasUI/middleware/notifier.py", line 1064, in zfs_online_disk assert volume.vol_encrypt == 0 AssertionError
The pool status in the shell looks like:
root@freenas[~]# zpool status storage pool: storage state: DEGRADED status: One or more devices has been taken offline 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: resilvered 37.8M in 0 days 00:00:39 with 0 errors on Wed Jan 30 00:23:55 2019 config: NAME STATE READ WRITE CKSUM storage DEGRADED 0 0 0 raidz2-0 DEGRADED 0 0 0 gptid/7afeb39f-1e8f-11e9-9423-080027323634.eli ONLINE 0 0 0 12034077341320501396 OFFLINE 0 0 0 was /dev/gptid/d41df718-241c-11e9-8b42-080027323634.eli gptid/1351f31c-1fdd-11e9-a5f1-080027323634.eli ONLINE 0 0 0 gptid/7ce8fda5-1e8f-11e9-9423-080027323634.eli ONLINE 0 0 0 errors: No known data errors
zpool online storage 12034077341320501396 in the shell, the device is online again.
My original post in forums.freenas.org: https://forums.freenas.org/index.php?threads/offline-online-of-encrypted-disk-does-not-work.73340/#post-508290
#4 Updated by Robert Peters almost 3 years ago
Looks like there is one
/dev/ added where it already was there.
Jan 30 18:37:15 freenas uwsgi: [middleware.notifier:178] Popen()ing: /sbin/zpool offline storage /dev/gptid/157b7104-247e-11e9-9f0d-080027323634.eli Jan 30 18:37:16 freenas uwsgi: [middleware.notifier:131] Executing: /sbin/geli detach /dev//dev/gptid/157b7104-247e-11e9-9f0d-080027323634.eli Jan 30 18:37:16 freenas uwsgi: [middleware.notifier:152] Executed: /sbin/geli detach /dev//dev/gptid/157b7104-247e-11e9-9f0d-080027323634.eli -> 1
#6 Updated by Vladimir Vinogradenko almost 3 years ago
Note to Dru: 11.3 fix not needed, this has been rewritten and is functioning properly
Robert, thank you for your report. Problem will be fixed in 11.2-U3. However, you still won't be able to online disk in encrypted pool, you'll just get more clear error message. This is not supported yet even in 11.3.
With described pool configuration, offlining one of the disks of encrypted pool using New UI should be done completely: offlined disk should not be visible in
Attempt to bring this disk back online should result in "Disk cannot be set to online in encrypted pool." error message.
#7 Updated by Robert Peters almost 3 years ago
May I add some questions for clearance?
Just so that I understand completely: When using encrypted pools, drives may only be replaced by new ones. It is not possible to offline a drive and put it back in (for whatever reason).
Is that an ZFS issue or related to the FreeNAS interface? If it is UI related, is there some documentation how the command line can be used to recover from such scenarios?
While quickly searching though the documentation, I found no note about being unable to online an offlined drive. I think I was also unable to wipe it which should have enabled me to "replace" it.
Can test it again tuesday and file another ticket if it don't work and you don't mind. That would be the only way to make the drive usable again if I am correct.