调整创建磁盘、挂载磁盘及卸载磁盘的脚本

This commit is contained in:
hwzzy666
2022-07-06 08:21:46 +08:00
parent 9bf52cf2ab
commit 339570a2f3
5 changed files with 19 additions and 22 deletions

12
tools/mount_virt_disk.sh Normal file → Executable file
View File

@ -1,4 +1,8 @@
sudo losetup -P /dev/loop1 --show ../bin/disk.img
lsblk
mkdir -p ../bin/disk_mount/
sudo mount /dev/loop1p1 ../bin/disk_mount/
LOOP_DEVICE=$(sudo losetup -f --show -P ../bin/disk.img) \
|| exit 1
echo ${LOOP_DEVICE}p1
sudo mkfs.vfat -F 32 ${LOOP_DEVICE}p1
mkdir -p ../bin/disk_mount/
sudo mount ${LOOP_DEVICE}p1 ../bin/disk_mount/
lsblk