🆕 更改为创建硬盘镜像

This commit is contained in:
fslongjin
2022-07-28 13:03:36 +08:00
parent 0761daec0b
commit b57d362c15
4 changed files with 69 additions and 48 deletions

View File

@ -1,8 +1,15 @@
LOOP_DEVICE=$(sudo losetup -f --show -P ../bin/disk.img) \
# ======检查是否以sudo运行=================
uid=`id -u`
if [ ! $uid == "0" ];then
echo "请以sudo权限运行"
exit
fi
LOOP_DEVICE=$(losetup -f --show -P ../bin/disk.img) \
|| exit 1
echo ${LOOP_DEVICE}p1
mkdir -p ../bin/disk_mount/
sudo mount ${LOOP_DEVICE}p1 ../bin/disk_mount/
mount ${LOOP_DEVICE}p1 ../bin/disk_mount/
lsblk