Data recovery from an image
October 5, 2024 ยท View on GitHub
Data recovery from an image
If something goes wrong (or for some other reason), you might want to recover data from a linux loop image while booting from another Linux install, a Linuxloops image or from a Linux live usb.
Recover data from an unencrypted Linuxloops image
- Run the following commands to mount the Linuxloops rootfs:
mkdir -p ./linuxloops_root
image=$(losetup -fP --show <path_to_the_linuxloops_image>)
mount "$image"p3 ./linuxloops_root
-
Recover your data from the ./linuxloops_root folder
-
Unmount the Linuxloops rootfs:
umount ./linuxloops_root
losetup -d "$image"
Recover data from an encrypted Linuxloops image
- Run the following commands to mount the Linuxloops rootfs:
mkdir -p ./linuxloops_root
image=$(losetup -fP --show <path_to_the_linuxloops_image>)
cryptsetup luksOpen "$image"p3 recovery_root
mount /dev/mapper/recovery_root ./linuxloops_root
-
Recover your data from the ./linuxloops_root folder
-
Unmount the Linuxloops rootfs:
umount ./linuxloops_root
cryptsetup luksClose recovery_root
losetup -d "$image"