Closed probonopd closed 1 year ago
The
DEBUG: Checking zroot against zroot
DEBUG: Pool zroot already taken
happens whenever there was previously a zpool with that name on the target disk. Even though the target disk has been formatted, e.g., like this:
sudo -A -E /sbin/gpart destroy -F /dev/ada0
sudo -A -E /sbin/gpart create -s GPT ada0
sudo -A -E /sbin/gpart add -t freebsd-ufs ada0
sudo -A -E newfs -L 'Ohne Titel' /dev/ada0
sudo -A -E /usr/local/sbin/automount ada0 attach
The only workaround I found is to overwrite the whole disk with zeros, which takes a lot of time. Another solution would be greatly preferred.
Code in question seems to be:
pools=$(zpool import | awk '$1 == "pool:" { print $2}')
for pool in ${pools}; do
f_dprintf "Checking ${pool} against ${ZFSBOOT_POOL_NAME}"
if [ "${pool}" = "${ZFSBOOT_POOL_NAME}" ]; then
f_dprintf "Pool ${pool} already taken"
ZFSBOOT_POOL_NAME=$(dialog_zpool_name "${ZFSBOOT_POOL_NAME}")
break
fi
done
And indeed. zpool import | awk '$1 == "pool:" { print $2}'
returns zroot
even though the disk has been formatted (but not overwritten with zeros) using the procedure described above.
So it sees zroot
, lets me not create a new pool with the same name, but also refuses to destroy the old one:
% sudo su
# zpool import | awk '$1 == "pool:" { print $2}'
zroot
# zpool destroy zroot
cannot open 'zroot': no such pool
What gives?
How can I make it forget that there ever was a zpool on the target disk?
# zpool import
pool: zroot
id: 5046784991774597898
state: UNAVAIL
status: One or more devices contains corrupted data.
action: The pool cannot be imported due to damaged devices or data.
see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-5E
config:
zroot UNAVAIL insufficient replicas
diskid/DISK-AA000000000000002088 UNAVAIL invalid label
sudo zpool labelclear -f /dev/adaX
helloSystem 0.8.1, installation stalls on the pulsating ("indeterminate") progress bar forever.
bsdinstall
is quite flaky... and no, there is no pool with that name yet: