Last active
July 24, 2022 00:26
-
-
Save DestyNova/c089f0204c8446358732b76dd6d63d8d to your computer and use it in GitHub Desktop.
Mount PC-98 hard disk image (.hdi) in ./mnt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Commands taken from this very helpful guide: | |
# https://github.com/drojaazu/pc98_disks_in_linux/blob/main/README.md#mounting-hard-disks | |
set -euo pipefail | |
IMAGE=$1 | |
mkdir mnt | |
OFFSET=$(expr `grep -Ebaom 1 "FAT1[2|6]" ${IMAGE} | sed -E 's/:FAT1[2|6]//g'` - 54) | |
LO_DEVICE=$(sudo losetup --show -fL -o ${OFFSET} ${IMAGE}) | |
sudo mount -o rw $LO_DEVICE mnt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment