This is a problem that I’ve wanted to tackle for quite some time. Since I’m using SCSI2SD and also messing around with a few different logic analyzers, I’ve got several HDD images that include both data files and operating system files. When they are sitting on my machine, they are just these huge masses of data, essentially HDD-sized chunks. Of 4GB, 16GB, 32GB and so on. Sometimes, I want to peer into them, or compare contents…..or literally any other manipulation beyond just coping/moving them around.
To capture a disk image,I use a SCSI card inside my linux box. The support for these older parallel SCSI cards is actually quite good, despite falling out of favor to newer interfaces. You should be able to find either a used one or NOS(new old stock) on ebay for under $30 shipped, I’d think.
While dd is quite useful, any time I deal with old disk drives, you never know when your next read is your last read. I highly suggest using ddrescue, which is a tool that allows for smart recovery of corrupted, compromised drives. It will allow you to recover the good parts quickly, skipping over the bad parts in order to retrieve the bulk(hopefully) of the disk first. Then it makes multiple trimming, scraping, and retrying passes until you tell it to stop. My most recent 16700A HDD was damaged, so I elected to make (10) passes on each unreadable sector(or group of sectors) before truly declaring it unreadable. I recovered 99.99%, losing only 500kb on a 4.55GB drive. Really amazing and smart software!
HPUX 10.20 uses a few different file system types, not unlike modern linux systems. It uses both HFS for /stand, which contains the kernel. And VxFS, the Veritas File System for some other logical volumes.
This is the logical volume layout for an HP 16700A logic analyzer :
LVM_DISK “SEAGATE ST34520N ” /dev/dsk/c0t6d0 8/16/5.6.0 4340 /dev/vg00
LVM_LAYOUT /dev/vg00: ” ” ” ” ” ”
LVM_LAYOUT /dev/vg00/lvol1 /stand 48 hfs
LVM_LAYOUT /dev/vg00/lvol2 swap 1536 ” ”
LVM_LAYOUT /dev/vg00/lvol3 / 800 vxfs
LVM_LAYOUT /dev/vg00/lvol4 /hplogic 1948 vxfs
LVM_LAYOUT /dev/vg00/lvol5 /home 4 vxfs
You have physical volumes (PVs) which are disks, usually SCSI. You’ve got VG’s, which are volume groups, which house the logical volumes (LVs).
You can mount those last three, lvol3, lvol4, and lvol5 easily on a modern Ubuntu box.
You need two things:
- a copy of linux-vxfs, which a standard user application that looks inside the entire disk image, and separates the logical volumes. It uses dmsetup to set starting and ending blocks of each logical volume. This is distributed as source-only, but compiles using make/gcc easy enough.
- the native built-in-to-many-kernels support for freevxfs in Ubuntu. (modprobe freevxfs; lsmod | grep vxfs) Note that certain distributions DO NOT (Manjaro based on Arch, and Fedora 30/32 do not!) include support any longer for VXFS, but even the latest Debian-based ones do. I’ve tested this on Ubuntu 18.04 LTS, and that would be my suggestion to ensure compatibility.
- Download linux-vxfs, and untar it into a folder.
There’s a slight modification required for the linux-vxfs-160607.tgz version to run on Ubuntu. See the PATCH section below.
- Ensure that you have the latest version, linux-vxfs-200324.tgz.
- “make” and ignore the warning about pxspace being unused
- “./hpux_dmsetup create <fulldiskimagegoeshere>.bin
- It should list out several volumes and then say “VG VG%d Activated succesfully with %d lvols.”
- You should see a series of entries in /dev/mapper, which are symlinks to /dev/dm-0, /dev/dm-1, etc
- Next mount the image: “mount -t vxfs /dev/mapper/blahfromsteps5and6 <insert mountpoint here>”
Note that vxfs has read-only support — so you cannot write to these mounts!
PATCH to hpux_dmsetup.c. There’s a minor bug/compatibility issue with linux-vxfs in a modern Ubuntu environment. While we’re not sure the exact mechanism for the problem, this small fix handles it. You need to find and edit simply two lines — replace the top line with the bottom line: 75c75,76
< n = snprintf(cmd, 255, “echo -e \””);
> n = snprintf(cmd, 255, “echo \””);
< n += snprintf(cmd + n, sizeof(cmd) – n – 1, “%d %d linear %s %d\n “,
> n += snprintf(cmd + n, sizeof(cmd) – n – 1, “%d %d linear %s %d”, Note that none of this would be possible without the hard work of Krzysztof Błaszkowski and Christoph Hellwig before him. Great work guys!
UPDATE: I’m working with the developer to increase the robustness and reliability of the userspace tool linux-vxfs. I’ve tested the changes successfully, and it will be published soon. The patch above will work until a newer version is released.