Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.

Summary

The desktop user should be able to mount an ISO image. Furthermore, if the ISO image is a DVD, it should be straightforward or transparent to play the media using the supported video applications.

Rationale

ISO files are commonly manipulated and this requires the command line.

Use cases

Scope

This can be implemented by including Nautilus actions for mount and unmount, and might also include other disk image formats, such as NRG.

Design

Implementation

Code

This code for nautilus actions came from a forum post. It requires sudo, leaves directories in /media, and doesn't prevent deletion or movement of the data files.

Mount

#!/bin/bash # Mount ISO NRG BIN/CUE

# Get filename extension and make it lower-case EXT=echo $1 | sed -e 's/.*\.//' EXT_LOW=echo $EXT | tr 'A-Z' 'a-z'

# Get the filename without the extension BASE="echo "$1" | sed 's/\.[^.]*$//'"

# Mount ISO if [ $EXT_LOW == "iso" ]; then foo=gksudo -u root -k -m "enter your password for root terminal access" /bin/echo "got r00t?" sudo mkdir /media/"$BASE" && sudo mount -o loop,ro,nodev,noexec,nosuid "$1" /media/"$BASE" &&

#ln -s "/media/${BASE}" "/home/$USER/Desktop/${BASE}" && gnome-open "/media/${BASE}" fi

# Mount NRG if [ $EXT_LOW == "nrg" ]; then foo=gksudo -u root -k -m "enter your password for root terminal access" /bin/echo "got r00t?" sudo mkdir /media/"$BASE" && sudo mount -o loop,ro,nodev,noexec,nosuid,307200 "$1" /media/"$BASE" &&

#ln -s "/media/${BASE}" "/home/$USER/Desktop/${BASE}" && gnome-open "/media/${BASE}" fi

# Mount BIN/CUE if [ $EXT_LOW == "cue" ]; then

# Find a free node to mount NODE=$((cdemu -s | cut -f 8 -d " " | grep 0 -n -m 1 | cut -c 1-2))

# If directory is empty, then release cdemu if [ "$(ls -A /media/${BASE})" ]; then echo else cdemu -u $NODE fi

fi

# If directory is empty, then remove empty directory if [ "$(ls -A /media/${BASE})" ]; thenhttp://www.ubuntu.com/ echo else sudo rmdir /media/"${BASE}" fi

Unmount

#!/bin/bash # Unmount ISO NRG BIN/CUE

BASE="$1"

# Get filename extension and make it lower-case # EXT_LOW will be iso, nrg, cue or nonsense EXT=echo $1 | sed -e 's/.*\.//' EXT_LOW=echo $EXT | tr 'A-Z' 'a-z'

# Isolate the the basename without the extension (in case this is not the case already) if [ $EXT_LOW == "iso" -o $EXT_LOW == "nrg" -o $EXT_LOW == "cue" -o $EXT_LOW == "volume" ]; then BASE="echo "$1" | sed 's/\.[^.]*$//'" fi

# Release /dev/cdemu according to whether BIN uses /dev/cdemu0 or /dev/cdemu/0 foo=gksudo -u root -k -m "enter your password for root terminal access" /bin/echo "got r00t?" DEV="mount | grep "$BASE" | cut -f1 -d " ""

if [ ${DEV##/dev/cdemu/} -ge 0 -a ${DEV##/dev/cdemu/} -le 7 ]; then cdemu -u ${DEV##/dev/cdemu/} fi

if [ ${DEV##/dev/cdemu} -ge 0 -a ${DEV##/dev/cdemu} -le 7 ]; then cdemu -u ${DEV##/dev/cdemu} fi

# Unmount foo=gksudo -u root -k -m "enter your password for root terminal access" /bin/echo "got r00t?" sudo umount /media/"${BASE}" sudo rmdir /media/"${BASE}" sudo rm /home/$USER/Desktop/"${BASE}"

Data preservation and migration

Unresolved issues

BoF agenda and discussion


CategorySpec

ImageMounting (last edited 2008-08-06 16:15:14 by localhost)