You're provided with an E01 of a VMDK from a RedHat Enterprise Linux system, which is formatted using XFS and is part of an LVM group.
We created a RedHat Linux (RHEL) v9.2 virtual machine with a single 10GB virtual disk, formatted with XFS, and part of an LVM. We created a file called 'files.txt' on the user's desktop.
We have the following file; RHEL-9.2-LVM-XFS.E01
The following will provide two examples of how to mount an E01 file and inspect its contents.
My preference is to use a combination of xmount, kpartx, and lvscan. This will provide you with the ability to mount the E01 (either single file or split segments), create/map partitions using kpartx, scan for LVM segments using lvscan, and then mount it using mount.
The second method is to use ewfmount, and guestfish.
$ sudo fdisk -l /mnt/RHEL/ewf1
Disk /mnt/RHEL/ewf1: 10 GiB, 10737418240 bytes, 20971520 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: 0xa35043bb
Device Boot Start End Sectors Size Id Type
/mnt/RHEL/ewf1p1 * 2048 2099199 2097152 1G 83 Linux
/mnt/RHEL/ewf1p2 2099200 20971519 18872320 9G 8e Linux LVM
We can see the above partition (p2) is an LVM member.
$ sudo losetup -r -o $((512*2099200) /dev/loop0 /mnt/RHEL/ewf1
$ cd /mnt/RHEL
$ mount /dev/loop0 /mnt/rhel-mount
mount: /mnt/RHEL2: unknown filesystem type 'LVM2_member
Now, since ewfmount doesn't support write overlay, I always seem to run into errors with XFS filesystems (even mounting using the -ro option). Probably PEBKAC, tbh.
Run vgscan to see volume group objects
$ vgscan
Found volume group "rhel" using metadata type lvm2
$ vgchange --activate y rhel
$ lvscan
ACTIVE '/dev/rhel/root' [<8.00 GiB] inherit
ACTIVE '/dev/rhel/swap' [1.00 GiB] inherit
Try and mount /dev/rhel/root (which is just a symlink back to /dev/mapper/dm-*)
mount /dev/rhel/root /mnt/rhel2
mount: /mnt/rhel2: can't read superblock on /dev/rhel/root.
Run dmesg to see a stack of I/O read/write errors;
$ dmesg
[ 801.785731] XFS (dm-0): log recovery write I/O error at daddr 0x35b2 len 4096 error -5
[ 801.785737] XFS (dm-0): failed to locate log tail
[ 801.785738] XFS (dm-0): log mount/recovery failed: error -5
[ 801.786364] XFS (dm-0): log mount failed
[ 864.069403] XFS (dm-0): Mounting V5 Filesystem
[ 864.074516] Trying to write to read-only block-device loop0
[ 864.074551] Trying to write to read-only block-device loop0
[ 864.074709] blk_update_request: I/O error, dev loop0, sector 8400354 op 0x1:(WRITE) flags 0x5800 phys_seg 20 prio class 0
[ 864.074718] blk_update_request: I/O error, dev loop0, sector 8402914 op 0x1:(WRITE) flags 0x1800 phys_seg 12 prio class 0
[ 864.074728] XFS (dm-0): log recovery write I/O error at daddr 0x35b2 len 4096 error -5
So we can mount /dev/rhel/root using the -ro and loop options;
$ mount -o ro,loop /dev/rhel/root /mnt/rhel2
$ ls /mnt/rhel2/home/username/Desktop/
files.txt
$ cat /mnt/rhel2/home/username/Desktop/files.txt
all the secrets!
Another way is to mount using guestfish
$ guestfish --ro -a /mnt/RHEL/ewf1
Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.
Type: ‘help’ for help on commands
‘man’ to read the manual
‘quit’ to quit the shell
><fs> run
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
><fs> list-filesystems
/dev/sda1: xfs
/dev/rhel/root: xfs
/dev/rhel/swap: swap
><fs> mount /dev/rhel/root /
><fs> mount-local /mnt/rhel-mount readonly:true
><fs> mount-local-run
In another terminal/tab
$ cat /mnt/rhel-mount/home/username/Desktop/files.txt
all the secrets!