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