0

In Linux Mint 18.2 when I choose "Open With Disk Image Mounter" in a right click menu on an .img file I get following error:

Unable to mount OS

Error mounting /dev/loop1 at /media/mint/OS: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999" "/dev/loop1" "/media/mint/OS"' exited with non-zero exit status 21: ntfs-3g-mount: mount failed: Permission denied

("OS" is a label of a drive from which this image was created.) I have another .img file (also with NTFS in it) and I receive similar error when I try to mount it. Both files were created with a built-in Linux Mint "Disks" utility. If it helps, they are both 100Gb+ in size and have brackets in their names.

How do I fix this error? Or maybe there is a way to mount or view their contents with different tools?

  • Are you prompted for authentication when you try to mount it? Have you tried mounting it from the command line as root? – Nasir Riley Jun 10 '18 at 13:24
  • @NasirRiley No, I'm not prompted for authentication. I tried to copy command line from this error message into terminal adding "sudo" before it, but I still get an error: "> Failed to read bootsector (size=0) Failed to sync device /dev/loop1: > Input/output error Failed to mount '/dev/loop1': Invalid argument The > device '/dev/loop1' doesn't seem to have a valid NTFS. Maybe the wrong > device is used? Or the whole disk instead of a partition (e.g. > /dev/sda, not /dev/sda1)? Or the other way around?" – Cint Jun 10 '18 at 17:31
  • Create a mountpoint such as /mnt/img and then try this: mount -o loop /path/to/file.img /mnt/img You may get a message of mounting read-only but it should mount the img file – Nasir Riley Jun 10 '18 at 18:35
  • Is the image of a filesystem or a disk? You can check with file /path/to/image If it's a disk image, you can use kpartx to create block device files from the partitions within the image; Then you can mount the correct block device. You can also use the libguestfs shell to mount a disk image. – Emmanuel Rosa Jun 10 '18 at 21:10
0

It looks like you are trying to mount a disk image (with the image including a partition table and possibly multiple partitions instead of just one partition). Try using the loop module with

sudo losetup -f file.img

The NTFS formatted partition(s) should then show up in the file manager.

You may need to allow partitions on the loop device explicitly (see How to create a formatted partition image file from scratch?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.