I have a disk image file I'm trying to mount locally using a loop device. Using parted I can see the image has two partitions, however, I'm not able to mount the first partition and losetup
thinks the second partition doesn't exist. Anyone know how I can mount the second partition?
/m/sf_VMShare ❯❯❯ sudo losetup /dev/loop0 ./imm_image-2017-05-28.img
/m/sf_VMShare ❯❯❯ sudo losetup -a
/dev/loop0: [0023]:99 (/media/sf_VMShare/imm_image-2017-05-28.img)
/m/sf_VMShare ❯❯❯ sudo parted /dev/loop0 print
Model: Loopback device (loop)
Disk /dev/loop0: 1206MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 10.5MB 360MB 349MB primary ext4
2 361MB 1205MB 844MB primary ext4
/m/sf_VMShare ❯❯❯ sudo mount -t ext4 /dev/loop0p2 /tmp/vdisk
mount: special device /dev/loop0p2 does not exist
/m/sf_VMShare ❯❯❯ sudo mount -t ext4 /dev/loop0p1 /tmp/vdisk
mount: wrong fs type, bad option, bad superblock on /dev/loop0p1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
/m/sf_VMShare ❯❯❯ mount | grep /tmp/vdisk
/m/sf_VMShare ❯❯❯
/m/sf_VMShare ❯❯❯ ls /dev/loop*
/dev/loop0 /dev/loop1 /dev/loop3 /dev/loop5 /dev/loop7
/dev/loop0p1 /dev/loop2 /dev/loop4 /dev/loop6 /dev/loop-control
/m/sf_VMShare ❯❯❯ lsblk -f
NAME FSTYPE LABEL MOUNTPOINT
sda
├─sda1 /
├─sda2
└─sda5 [SWAP]
sdb
└─sdb1 /home/foo/workspace
sr0
loop0
└─loop0p1
ls /dev/loop*
show?lsblk -f
?