xref: /DragonOS/tools/umount_virt_disk.sh (revision a1d3af9201c9ad15e5d349087cc7723e06030628)
1# ======检查是否以sudo运行=================
2uid=`id -u`
3if [ ! $uid == "0" ];then
4 echo "请以sudo权限运行"
5 exit
6fi
7
8LOOP_DEVICE=$(lsblk | grep disk_mount|sed 's/.*\(loop[0-9]*\)p1.*/\1/1g'|awk 'END{print $0}')
9
10umount -f ../bin/disk_mount/
11losetup -d /dev/$LOOP_DEVICE
12echo $LOOP_DEVICE