Mount ISO images easily under Nautilus

I had purchased Lenovo y410 series laptop few months back , the laptop worked flawlessly for few months but well sadly few weeks back optical drive stopped working. I had downloaded an iso from which i wanted to run few files, now as the DVD drive on my laptop was not working and well repairs will take time so i was in a fix , about how to extract files from this ISO and run them . Searching Google , Ubuntu forums etc i found a very simple and easy way of mounting ISO's under nautilus which i am trying to document here in this article.


Open the terminal window(Applications -> Accessories -> Terminal ) and issue the following commands in the terminal window :

wget http://www.debianadmin.com/images/iso/mount.sh
and
wget http://www.debianadmin.com/images/iso/unmount.sh

Now we need to change the file permissions , to make the above script executable. Which we could do by issuing the following command in the terminal window :

sudo chmod +x mount.sh

sudo chmod +x unmount.sh

Finally we move the above scripts to nautilus directory by issuing the following command in the terminal window ;

sudo mv mount.sh ~/.gnome2/nautilus-scripts/

sudo mv unmount.sh ~/.gnome2/nautilus-scripts/

Now open nautilus and inside nautilus open directory containing ISO image you want to mount. Right Click on the ISO image and you will find menu similar to one shown below :


Click on the mount.sh file , if ISO file mounts properly you will find two dialog boxes similar to one shown below :

Also on the desktop you should find the icon of the mounted DVD/CD ISO file .
Now if you want to unmount the ISO volume , right click on the icon of the mounted ISO and click on the unmount.sh as shown in figure below :
Tutorial Written by : Ambuj Varshney (blogambuj@gmail.com)
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney

Comments

  1. Anonymous12:56 PM

    Brilliant tip, thanks

    http://tnetech.net

    ReplyDelete
  2. I loved your post on APTonCD, but I have used up several discs keeping my standalone PC updated. Now I can bypass the CD, and even use DVD images without a DVD reader!

    Your Blog has been the best source of the tips I actually can use!

    ReplyDelete
  3. Anonymous9:07 AM

    Great Tip
    Ive been recently looking into an A120/Dtools type program or a simple way to RIGHT Click on an ISO/CUE
    and choose Mount/UNmount

    Is there a method to extend your tutorial so the user does NOT have to go into the Scripts section instead in the same area that it gives the user the choice down the bottom to Burn or extra it , put Mount or Unmount ISO along in that area ?

    ReplyDelete
  4. i'm not getting that option in nautilus. i did as described above but i'm not getting anything.

    any ideas?

    ReplyDelete
  5. NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER NEVER
    NEVER NEVER NEVER EVER run ANY shell script without first reading it all the way through.

    I mean no offense to Ambuj, but on the internet anything can change. Whose to know that this site hasn't been compromised.
    Regardless of how much you trust someone, NEVER run ANY script that you've acquired from the internet without first reading
    every single line.

    Of all the security holes, backdoors and so on that compromises our systems, the one thing that compromises the security of
    a computer more than anything else, is the user.
    I realize that some scripts can get a bit lengthy and are too large to post the entire text on the site, but when you can't do
    a copy/paste script written on the site PLEASE advise that everyone read the script before you do anything else.

    ReplyDelete
  6. Anonymous5:09 AM

    Great tutorial, thanks. Just FYI, you shouldn't need to use sudo for these commands :)

    ReplyDelete
  7. Update scripts to allow iso files names with white spaces:

    #!/bin/bash
    # mount

    gksudo -k /bin/echo "got r00t?"

    BASENAME=`basename "$(echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS)" .iso`

    sudo mkdir "/media/$BASENAME"

    zenity --info --title "ISO Mounter" --text "$BASENAME in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"

    if sudo mount -o loop -t iso9660 "$(echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS)" "/media/$BASENAME"
    then
    if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted. Open Volume?"

    then
    nautilus /media/"$BASENAME" --no-desktop
    fi

    exit 0
    else
    sudo rmdir "/media/$BASENAME"

    zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"

    exit 1
    fi

    -------------------------------------------------------------------------------

    #!/bin/bash
    # unmount

    gksudo -k /bin/echo "got r00t?"

    BASENAME=`basename "$(echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS)" .iso`

    sudo umount "/media/$BASENAME"

    sudo rmdir "/media/$BASENAME"

    zenity --info --text "Successfully unmounted /media/$BASENAME"

    exit 0

    ReplyDelete

Post a Comment

Amazon Ads