Is it possible to reconstruct a BTRFS RAID from disk images?

I had a server running a 6 disk BTRFS RAID configuration. Now my server refuses to start because of (likely) PSU issues. I have a new NAS box that I want to use for this purpose but I would like to get my data off the old setup.

So while I could go about and buy a new PSU and try to get the old system back on its feet I'd really like not having to spend the money on that since I'm just going to retire it anyway as soon as I get the data from there.

So I had an idea which may not be possible but that's why I'm here asking.

Would you think that there is any way to take these 6 individual disks, create an image of all of them, then mount the images and reconstruct the BTRFS filesystem that way?

I have a computer that I might be able to fit one large drive in and then connect the 6 individually to create the images of the 6 RAID drives but I do not have a computer which would fit all the 6 drives in.

Another issue would be how to create these disk images. Would I have to just use dd or is there some way to create image files that are smaller than the full size of the disks? It might be problematic if I have to have 6 x 4TB disk image files.

Hope somebody can help with this... either by pointing me in some (hopefully right) direction or just by saying that it can't be done.


Yes, this is possible and often used approach.

It is best to take the images with dd utility, so that full hard disk contents are in the image.

After you have the images, for example diskN.img, we'll use the losetup to create loop device for each disk image, which makes the image appear as a device on the system.

losetup /dev/loop0 disk1.img
losetup /dev/loop1 disk2.img
...

Now each disk image is accessible via /dev/loopN device.

Then one can use btrfs device scan to scan for filesystems from all block devices.