📚 Encyclopedia

Linux Desktop · updated 2026-10-13

Mounting a full-disk image read-only to recover old projects

losetuploop-devicedisk-imagerecoveryext4data-recovery

A raw image of a whole disk (dd-style, with a partition table) can be browsed like the original machine by attaching it to a loop device with partition scanning, then mounting the root partition read-only. This is how two old DCTI products (Phone Manager and EdgeLink) were recovered years later from a 2023 image of an old Ubuntu dev machine.

Procedure

sudo mkdir -p /mnt/img
LOOP=$(sudo losetup -f --show -r -P "/media/$USER/DRIVE/Disk Image of sda.img")
lsblk "$LOOP"                         # shows ${LOOP}p1, p2, p3 ...
sudo mount -o ro "${LOOP}p3" /mnt/img # pick the rootfs partition (here p1=EFI, p2=swap, p3=rootfs)
# done:
sudo umount /mnt/img && sudo losetup -d "$LOOP"

Gotchas

See also

Linked from

Sources: home memory reference_rav_drive, project_trunkline, project_call_accounting