Trying to mount all partitions of a disk image.

I can only mount the first partition, but unable to mount the other 2 partitions.

userone@desktop:/media/userone/BACKUP$ sudo fdisk -lu 16-04-desktop.iso 
Disk 16-04-desktop.iso: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x73ce36a2

Device             Boot   Start       End   Sectors  Size Id Type
16-04-desktop.iso1 *       2048    999423    997376  487M 83 Linux
16-04-desktop.iso2      1001470 125044735 124043266 59.2G  5 Extended
16-04-desktop.iso5      1001472 125044735 124043264 59.2G 83 Linux
userone@desktop:/media/userone/BACKUP$ sudo losetup -o 1048576 /dev/loop0 16-04-desktop.iso
losetup: 16-04-desktop.iso: failed to set up loop device: Device or resource busy
userone@desktop:/media/userone/BACKUP$ sudo losetup -o 1048576 /dev/loop20 16-04-desktop.iso
userone@desktop:/media/userone/BACKUP$ sudo losetup -o 512752640 /dev/loop21 16-04-desktop.iso
userone@desktop:/media/userone/BACKUP$ sudo losetup -o 512753664 /dev/loop22 16-04-desktop.iso
userone@desktop:/media/userone/BACKUP$ sudo mount /dev/loop20 ~/Desktop/1
userone@desktop:/media/userone/BACKUP$ sudo mount /dev/loop21 ~/Desktop/2
mount: /home/userone/Desktop/2: wrong fs type, bad option, bad superblock on /dev/loop21, missing codepage or helper program, or other error.
userone@desktop:/media/userone/BACKUP$ sudo mount /dev/loop22 ~/Desktop/3
mount: /home/userone/Desktop/3: unknown filesystem type 'crypto_LUKS'.

How do I mount the other 2 partitions?


Mounting partitions in a cloned image of a drive

  • You should be able to mount all primary and logical partitions, for example with kpartx, in your case it seems to be partition #1 and partition #5.

  • You cannot mount an extended partition. It is a container for logical partitions (inside the extended partition).

  • There is a detailed description in my answer to a similar question,

    Mount dd image for my USB


Unless someone can show how to mount a drive or partition with encryption, for example an Ubuntu 'encrypted disk', LVM with encryption, I can suggest the following workaround.

  • Get a new drive that is big enough, at least as big as the uncompressed image file and clone from the image file to the new drive.
  • If things work well, you can replace the old drive and boot from the new drive.
  • Otherwise you should be able to mount the partitions, even if it is more complicated due to the encryption.

    Booting into an ISO full drive backup

| improve this answer | |
  • @Melebius, You are right. I have not tested mounting file systems in an image of an encrypted drive. I will delete my answer, if you think I should. – sudodus Dec 17 '18 at 14:13
  • @Melebius, I added a work around :-/ – sudodus Dec 17 '18 at 15:43

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.