mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
ZTS: Cleanup partition tables
The cleanup_devices function should remove any partitions created on the device and force the partition table to be reread. This is needed to ensure that blkid has an up to date version of what devices and partitions are used by zfs. The cleanup_devices call was removed from inuse_008_pos.ksh since it operated on partitions instead of devices and was not needed. Lastly ddidecode may be called by parted and was therefore added to the constrained path. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #9806
This commit is contained in:
parent
33dc49e0c0
commit
581ca28169
@ -132,6 +132,7 @@ export SYSTEM_FILES_LINUX='attr
|
|||||||
blockdev
|
blockdev
|
||||||
chattr
|
chattr
|
||||||
cksum
|
cksum
|
||||||
|
dmidecode
|
||||||
exportfs
|
exportfs
|
||||||
fallocate
|
fallocate
|
||||||
fdisk
|
fdisk
|
||||||
|
@ -2301,10 +2301,11 @@ function cleanup_devices #vdevs
|
|||||||
{
|
{
|
||||||
typeset pool="foopool$$"
|
typeset pool="foopool$$"
|
||||||
|
|
||||||
if poolexists $pool ; then
|
for vdev in $@; do
|
||||||
destroy_pool $pool
|
zero_partitions $vdev
|
||||||
fi
|
done
|
||||||
|
|
||||||
|
poolexists $pool && destroy_pool $pool
|
||||||
create_pool $pool $@
|
create_pool $pool $@
|
||||||
destroy_pool $pool
|
destroy_pool $pool
|
||||||
|
|
||||||
|
@ -107,7 +107,6 @@ while (( i < ${#vdevs[*]} )); do
|
|||||||
create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices
|
create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices
|
||||||
log_must zpool export $TESTPOOL1
|
log_must zpool export $TESTPOOL1
|
||||||
verify_assertion "$rawtargets"
|
verify_assertion "$rawtargets"
|
||||||
cleanup_devices $vslices $sslices
|
|
||||||
|
|
||||||
(( i = i + 1 ))
|
(( i = i + 1 ))
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user