mdadm assemble raid5 with loopback mounted disk images
I have an old RAID 5 array that was comprised of three 320 GB IDE Western Digital drives. Currently one of the old drives is completely toast, an another is questionable. I have a full image of the questionable drive (299 GiB) that I dd'd, and I have the third drive that is still working. My goal is to get mdadm to assemble the array in a degraded state, long enough for me to copy all the data that is still on there somewhere else.
I started with dd'ing an full image of the questionable drive to an image file: Quote:
Quote:
Quote:
Quote:
Quote:
Thanks in advance for any help |
Offset
Sorry to rez an old thread, just wanted to post some info as I was playing with this today.
The Linux raid autodetect partition (0xfd) in the image may be at an offset so you need to use losetup with the offset. 1. Find the offset: Code:
# parted drive.img Code:
# losetup -o 1048576 /dev/loop0 drive.img |
Thanks!
Thank you int0x80! It's very usefull for me!
|
Another way is to run "kpartx -av drive.img", which will map loop devices /dev/loop0 and /dev/loop0p1, with the latter being your RAID member.
"kpartx -dv drive.img" will unmap those loop devices. |
All times are GMT -5. The time now is 05:55 PM. |