2026-03-12 20:51:59

This commit is contained in:
support committed 2026-03-12 21:51:59 +01:00
1 parent 92a93d2634
commit 4c51d00919
35 files changed
+1925

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# usage: qemu-mount {imagefile}
# 1st argument: QEMU raw image file
if [ $# -ne 1 ] ; then
echo 'usage: qemu-mount imagefile'
echo 'Mounts a QEMU raw image file to /mnt/temp'
exit 1
fi
start=$( fdisk -l -o Device,Start ${1} | grep "^${1}1" | gawk '{print $2}' )
sectors=$( fdisk -l ${1} | grep '^Units: sectors of' | gawk '{print $(NF-1)}' )
offset=$(( $start * $sectors ))
[ -d /mnt/temp ] || mkdir /mnt/temp
sudo mount -o loop,offset=$offset ${1} /mnt/temp