Skip to content

Instantly share code, notes, and snippets.

@av1d
Created January 26, 2022 05:59
Show Gist options
  • Select an option

  • Save av1d/0321f0d3073f4be05ee2ea7f03b0dfe0 to your computer and use it in GitHub Desktop.

Select an option

Save av1d/0321f0d3073f4be05ee2ea7f03b0dfe0 to your computer and use it in GitHub Desktop.
Mount IMA or IMG floppy disk image in Linux/Bash
#!/bin/bash
# first chmod +x mima.sh
echo -e "Mount IMA or IMG file in Linux/Bash by av1d"
echo -e "Run as root/sudo.\n"
echo -e "Syntax: ./mima.sh LoopDeviceNumber file.ext /mount/path"
echo -e "Example: ./mima.sh loop6677 ./disk.img /media/floppy\n"
if [[ "$1" == "" ]]
then
echo -e "Nothing specified. See syntax."
exit
fi
mkdir $3
/sbin/losetup /dev/$1 $2
mount -t vfat /dev/$1 $3
echo -e "Done.\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment