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.
--in ewf specifies input format (can be a range of E01 segments (use E?? instead of E01))
-- out vmdk specifies output format (can be multiple formats, raw, vhd, vmdk, etc)
--cache rhel-cache the output temp cache folder (as a write overlay) for temporary image writes
/mnt/RHEL the location we want to mount our image
Identify partitions from raw (dd) image
We can see from the output of both disktype and fdisk that the second partition (starting at offset 2099200) is a Linux LVM member.
Use kpartx to mount both partitions
Mount root partition to destination mount point
See if we can access the file 'files.txt' on the user's desktop
Second method - using ewfmount and guestfish
We can see the above partition (p2) is an LVM 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
Run lvscan to see logical volumes;
Activate;
Try and mount /dev/rhel/root (which is just a symlink back to /dev/mapper/dm-*)
Run dmesg to see a stack of I/O read/write errors;
So we can mount /dev/rhel/root using the -ro and loop options;
$ vgchange --activate y rhel
$ lvscan
ACTIVE '/dev/rhel/root' [<8.00 GiB] inherit
ACTIVE '/dev/rhel/swap' [1.00 GiB] inherit
mount /dev/rhel/root /mnt/rhel2
mount: /mnt/rhel2: can't read superblock on /dev/rhel/root.
$ 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
$ 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!
$ 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
$ cat /mnt/rhel-mount/home/username/Desktop/files.txt
all the secrets!