Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Best way to mount an image from inside Nautilus?

  1. #1
    Join Date
    Jun 2005
    Beans
    102

    Best way to mount an image from inside Nautilus?

    I've read about Nautilus-mount-image, but the developer says it's no longer being developed because you can do it with gvfs. I have no idea what that means or how you do that, but I do know that doing it the manual way that I usually do it is tedious, seems to me there should be a more automated method for doing it from within the file manager itself, so any suggestions?

  2. #2
    Join Date
    Mar 2006
    Location
    Devon UK
    Beans
    419

    Re: Best way to mount an image from inside Nautilus?

    put this:
    Code:
    #!/bin/bash
    
    DIRNAME=$(echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g')
    FILENAME=$1
    if [ ! -f "$DIRNAME/$FILENAME" ];then
    	zenity --error --text="$DIRNAME/$FILENAME\nIs Not A File"
    	exit 0
    fi
    
    foo=$(gksudo -u root -k -m "Enter Your Admin Password" /bin/echo "got r00t?")
    sudo mkdir "/media/$FILENAME"
    sudo mount -o loop "$DIRNAME/$FILENAME" "/media/$FILENAME"
    in a file in ~/.gnome2/nautilus-scripts call it somthing like "Mount iso" make it executable then just right click on an iso and select Scripts->Mount iso and roberts your mothers brother!
    In /dev/null no one can hear the kernel panic!
    Don't EVER use sudo rm -rf / . if you don't understand a command check it out first!
    BACK UP YOUR DATA OR YOU WILL LOSE IT!!
    Supergrub - The best thing since sliced bread www.supergrubdisk.org

  3. #3
    Join Date
    Sep 2008
    Location
    Edinburgh, UK
    Beans
    738

    Re: Best way to mount an image from inside Nautilus?

    Gmount-Iso is another nifty way of doing it.
    Code:
    sudo apt-get install gmountiso
    It's basically a front end for the command line way:
    Code:
    sudo mount -t iso9660 -o loop <image> <mount point>

  4. #4
    Join Date
    Jun 2005
    Beans
    102

    Re: Best way to mount an image from inside Nautilus?

    Thanks, the script is working great.

  5. #5
    Join Date
    Nov 2005
    Location
    Leeds, UK
    Beans
    1,634
    Distro
    Ubuntu Development Release

    Re: Best way to mount an image from inside Nautilus?

    Strange, I have a right click option in my nautilus. I can't be any help to you though cos I have no idea how it got there :S

  6. #6
    Join Date
    Sep 2007
    Beans
    350

    Re: Best way to mount an image from inside Nautilus?

    You can check this page out too for a more "complete" treatment of the issue...

    Community Documentation: Manage Disc Images

  7. #7
    Join Date
    Aug 2007
    Beans
    297

    Re: Best way to mount an image from inside Nautilus?

    Quote Originally Posted by Keith Hedger View Post
    put this:
    Code:
    #!/bin/bash
    
    DIRNAME=$(echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g')
    FILENAME=$1
    if [ ! -f "$DIRNAME/$FILENAME" ];then
    	zenity --error --text="$DIRNAME/$FILENAME\nIs Not A File"
    	exit 0
    fi
    
    foo=$(gksudo -u root -k -m "Enter Your Admin Password" /bin/echo "got r00t?")
    sudo mkdir "/media/$FILENAME"
    sudo mount -o loop "$DIRNAME/$FILENAME" "/media/$FILENAME"
    in a file in ~/.gnome2/nautilus-scripts call it somthing like "Mount iso" make it executable then just right click on an iso and select Scripts->Mount iso and roberts your mothers brother!
    Thats pretty sweet thanks man. Only problem, how to unmount? It wont from nautilus because not root.

  8. #8
    Join Date
    Sep 2008
    Location
    Edinburgh, UK
    Beans
    738

    Re: Best way to mount an image from inside Nautilus?

    From within Nautilus, my bad.

    Quote Originally Posted by keypox View Post
    Thats pretty sweet thanks man. Only problem, how to unmount? It wont from nautilus because not root.
    Here's the one I'm using:

    Code:
    #!/bin/bash
    # unmount
    
    gksudo -k /bin/echo "got r00t?"
    
    BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS`
    
    sudo umount "/media/$BASENAME"
    
    sudo rmdir "/media/$BASENAME"
    
    zenity --info --text "Successfully unmounted /media/$BASENAME"
    
    exit 0
    Assuming it's mounted in a folder in /media just right click on that folder and use this script.

  9. #9
    Join Date
    Mar 2006
    Location
    Devon UK
    Beans
    419

    Re: Best way to mount an image from inside Nautilus?

    Same again but call this script:
    Code:
    #!/bin/bash
    
    FULLPATH=$(echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sed 's/\n//g' )
    foo=$(gksudo -u root -k -m "Enter Your Admin Password" /bin/echo "got r00t?")
    sudo umount "$FULLPATH"
    sudo rmdir "$FULLPATH"
    "Eject Disk"
    Right click on the mounted disk ( on the desktop ) select Scripts -> Eject Disk and off it will go!
    P.S. I aint too happy about this script it's a bit of a klutz but seems to work!
    In /dev/null no one can hear the kernel panic!
    Don't EVER use sudo rm -rf / . if you don't understand a command check it out first!
    BACK UP YOUR DATA OR YOU WILL LOSE IT!!
    Supergrub - The best thing since sliced bread www.supergrubdisk.org

  10. #10
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Best way to mount an image from inside Nautilus?

    In karmic there is a right click option "Open with Archive Mounter".

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •