I have a disk holding half a RAID-1 (mdadm) mirrored ext3 partition bolted into an external enclosure. I wanted to read what was on it. I didn't want to mess up. (I'd lost the other half of the mirror.)
I'm moderately confident I could have created a new RAID device out of it; perhaps ...
mdadm -C /dev/md6 -l 1 -n 2 /dev/sdh6 missing
Or: perhaps I could have changed the partition type for /dev/sdh6
from fd (Linux RAID autodetect) to 83 (plain ol' Linux), and
mounted the partition directly as an ext3 filesystem.
One of those could have gone wrong. (Not sure how, and didn't want to find out.) Instead, I took a copy of the partition...
dd if=/dev/sdh6 of=a-big-file-indeed.img bs=512
... and then played with my now-safe copy through a loopback mount:
mount -t ext3 -o loop,ro /d/a-big-file-indeed.img /mnt/old
This works, by the way, because RAID-1 partitions keep their RAID-y metadata at the end of the partition. Looking at the front of the partition, a Linux system just sees a plain filesystem. (Or so I'm told.)
