File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,21 @@ is_dev_part_of_vg() {
411
411
return 1
412
412
}
413
413
414
+ is_block_dev_partition () {
415
+ local bdev=$1
416
+
417
+ [ ! -b " $bdev " ] && bdev=" /dev/${bdev} "
418
+ if ! disktype=$( lsblk -n --nodeps --output type ${bdev} ) ; then
419
+ Fatal " Failed to run lsblk on device $bdev "
420
+ fi
421
+
422
+ if [ " $disktype " == " part" ]; then
423
+ return 0
424
+ fi
425
+
426
+ return 1
427
+ }
428
+
414
429
# Make sure passed in devices are valid block devies. Also make sure they
415
430
# are not partitions.
416
431
check_block_devs () {
@@ -423,7 +438,7 @@ check_block_devs() {
423
438
Fatal " $dev is not a valid block device."
424
439
fi
425
440
426
- if [[ $ dev =~ . * [0-9]$ ]] ; then
441
+ if is_block_dev_partition ${ dev} ; then
427
442
Fatal " Partition specification unsupported at this time."
428
443
fi
429
444
done
You can’t perform that action at this time.
0 commit comments