зеркало из https://github.com/microsoft/lsvmtools.git
35 строки
488 B
Bash
Executable File
35 строки
488 B
Bash
Executable File
#!/bin/bash
|
|
|
|
##
|
|
## Check arguments:
|
|
##
|
|
|
|
if [ "$#" != 0 ]; then
|
|
echo "Usage $0"
|
|
exit 1
|
|
fi
|
|
|
|
##
|
|
## Get the block device from /boot path:
|
|
##
|
|
. $(dirname "$0")/blkdev_utils
|
|
path=/boot
|
|
dev=$(mount_to_blkdev $path)
|
|
|
|
##
|
|
## If /dev/mapper path, then convert to underyling partition name:
|
|
##
|
|
|
|
echo $dev | grep /dev/mapper > /dev/null
|
|
|
|
if [ "$?" == "0" ]; then
|
|
part=$(logical_dev_to_physical_dev "$dev")
|
|
if [ "$?" != 0 ]; then
|
|
exit 1
|
|
fi
|
|
else
|
|
part=$dev
|
|
fi
|
|
|
|
echo $part
|