Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22
I'm using Ubuntu 12.04.2 LTS, how can I mount a .IMG file so I can access the files and folders inside? Thanks...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2013
    Posts
    10

    Linux Mount Image File


    I'm using Ubuntu 12.04.2 LTS, how can I mount a .IMG file so I can access the files and folders inside?

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,173
    How was the image file created? Is it a full file system image? In any case, you need to use the loop option with mount. Assuming that the image file is a full file system that your computer supports (ext2/3/4, fat, etc), then you can do this: mount -o loop filename.img mountpoint
    or this: mount -t fstype -o loop filename.img mountpoint
    where fstype is the file system type such as ext2, ext3, etc.

    Your files and directories would then be accessible via the mount point.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jul 2013
    Posts
    10
    I haven't installed Ubuntu, just running it, what would be the Ubuntu Desktop path? As that's where my file is

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,173
    Are you running off of a hard drive, or a live cd/dvd/usb device? In any case, as root (or using sudo), make a directory in /mnt, such as /mnt/imagedrive, then cd into ~/Desktop and run the command "sudo mount -o loop filename /mnt/imagedrive".
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Jul 2013
    Posts
    10
    Quote Originally Posted by Rubberman View Post
    Are you running off of a hard drive, or a live cd/dvd/usb device? In any case, as root (or using sudo), make a directory in /mnt, such as /mnt/imagedrive, then cd into ~/Desktop and run the command "sudo mount -o loop filename /mnt/imagedrive".
    I'm running off a Live CD, what command do I type first?

    Sorry I'm a newbie at this, I'm used to Windows

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,173
    Ok. How did you generate the image file that is on the Desktop?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,173
    So, try this from a command-line window:
    Code:
    cd ~/Desktop
    mkdir imagedrive
    sudo mount -o loop filename.img imagedrive
    ls imagedrive
    You should see your files and directories there.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #8
    Just Joined!
    Join Date
    Jul 2013
    Posts
    10
    Quote Originally Posted by Rubberman View Post
    Ok. How did you generate the image file that is on the Desktop?
    The .IMG file on the Desktop is a Android .IMG file which I transfered using a USB

  9. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,173
    Well, assuming it wasn't encrypted or compressed and it is a file system and not a full disc image, the commands I showed in my last post should work. If it is a full disc image, then we will need to alter our mount command to skip to the start of the partition we want. Again, how did you create the file in the first place? Is it from an SD storage card you had mounted on the android system?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #10
    Just Joined!
    Join Date
    Jul 2013
    Posts
    10
    Quote Originally Posted by Rubberman View Post
    So, try this from a command-line window:
    Code:
    cd ~/Desktop
    mkdir imagedrive
    sudo mount -o loop filename.img imagedrive
    ls imagedrive
    You should see your files and directories there.
    It says I need to specific a filetype system

    Quote Originally Posted by Rubberman View Post
    Well, assuming it wasn't encrypted or compressed and it is a file system and not a full disc image, the commands I showed in my last post should work. If it is a full disc image, then we will need to alter our mount command to skip to the start of the partition we want. Again, how did you create the file in the first place? Is it from an SD storage card you had mounted on the android system?
    I didn't create the IMG file, I downloaded it from a website

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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