mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 12:12:13 +03:00
zdb and inuse tests don't pass with real disks
Due to zpool create auto-partioning in Linux (i.e. sdb1), certain utilities need to use the parition (sdb1) while others use the whole disk name (sdb). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes #6939 Closes #7261
This commit is contained in:
committed by
Brian Behlendorf
parent
0e85048f53
commit
8e5d14844d
@@ -82,19 +82,18 @@ typeset -i i=0
|
||||
|
||||
unset NOINUSE_CHECK
|
||||
while (( i < ${#vdevs[*]} )); do
|
||||
|
||||
for num in 0 1 2 3 ; do
|
||||
eval typeset disk=\${FS_DISK$num}
|
||||
zero_partitions $disk
|
||||
done
|
||||
|
||||
typeset cyl=""
|
||||
for num in 0 1 2 3 ; do
|
||||
eval typeset slice=\${FS_SIDE$num}
|
||||
disk=${slice%${SLICE_PREFIX}*}
|
||||
slice=${slice##*${SLICE_PREFIX}}
|
||||
[[ -z $SLICE_PREFIX ]] && eval typeset disk=\${FS_DISK$num}
|
||||
slice=$(echo $slice | awk '{ print substr($1,length($1),1) }')
|
||||
log_must set_partition $slice "$cyl" $FS_SIZE $disk
|
||||
cyl=$(get_endslice $disk $slice)
|
||||
[[ $num < 3 ]] && cyl=$(get_endslice $disk $slice)
|
||||
done
|
||||
|
||||
if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then
|
||||
@@ -115,7 +114,6 @@ while (( i < ${#vdevs[*]} )); do
|
||||
(( i = i + 1 ))
|
||||
continue
|
||||
fi
|
||||
|
||||
create_pool $TESTPOOL1 ${vdevs[i]} $vdisks spare $sdisks
|
||||
verify_assertion "$rawtargets"
|
||||
destroy_pool $TESTPOOL1
|
||||
|
||||
@@ -92,9 +92,10 @@ done
|
||||
for num in 0 1 2 3 ; do
|
||||
eval typeset slice=\${FS_SIDE$num}
|
||||
disk=${slice%${SLICE_PREFIX}*}
|
||||
slice=${slice##*${SLICE_PREFIX}}
|
||||
[[ -z $SLICE_PREFIX ]] && eval typeset disk=\${FS_DISK$num}
|
||||
slice=$(echo $slice | awk '{ print substr($1,length($1),1) }')
|
||||
log_must set_partition $slice "$cyl" $FS_SIZE $disk
|
||||
cyl=$(get_endslice $disk $slice)
|
||||
[[ $num < 3 ]] && cyl=$(get_endslice $disk $slice)
|
||||
done
|
||||
|
||||
while (( i < ${#vdevs[*]} )); do
|
||||
|
||||
@@ -82,13 +82,19 @@ typeset -i i=0
|
||||
|
||||
while (( i < ${#vdevs[*]} )); do
|
||||
|
||||
for num in 0 1 2 3 ; do
|
||||
eval typeset disk=\${FS_DISK$num}
|
||||
zero_partitions $disk
|
||||
done
|
||||
|
||||
typeset cyl=""
|
||||
for num in 0 1 2 3 ; do
|
||||
eval typeset slice=\${FS_SIDE$num}
|
||||
disk=${slice%${SLICE_PREFIX}*}
|
||||
slice=${slice##*${SLICE_PREFIX}}
|
||||
[[ -z $SLICE_PREFIX ]] && eval typeset disk=\${FS_DISK$num}
|
||||
slice=$(echo $slice | awk '{ print substr($1,length($1),1) }')
|
||||
log_must set_partition $slice "$cyl" $FS_SIZE $disk
|
||||
cyl=$(get_endslice $disk $slice)
|
||||
[[ $num < 3 ]] && cyl=$(get_endslice $disk $slice)
|
||||
done
|
||||
|
||||
if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then
|
||||
|
||||
Reference in New Issue
Block a user