A script for loop mounting .iso files

8 Oct 2010

Every time I go to loop mount an iso file, it’s long enough since I last did it that I have to “re-google”.

Hence, a quick little script. No rocket science.

% cat isomount

if [ $# -eq 0 -o $# -gt 2 ] ; then
 echo "Usage: isomount foo.iso mountdir [defaults to /mnt]"
 exit 1


if grep -q "$target.*iso9660" `mount` ; then
 echo "$target already mounted - unmounting"
 sudo umount "$target"

sudo mount -o loop -t iso9660 $1 "$target"
comments powered by Disqus

  « Previous: Next: »