Often people take an image of a hard dive with dd
, for example, and then mount the partitions within using kpartx
or losetup
. It's a common way to make the partitions on an image file mountable and look like a filesystem.
I'm wondering if it's possible to do the reverse; that is make a device like /dev/sda
look like a file. Note: my purpose in asking this is in relation to a raid0 data recovery.
In my case, I could dd
the two 2TB drives I'm working on to some other storage container and operate on the image files. But that is painful, so I'm trying to avoid taking images.
Any ideas how to make a drive like /dev/sda
look like a file?
Edit to add more info.
The tool I'm trying to use for recovery is FUSE based, http://pyraid.googlecode.com If I run it against image files it works fine. If I run it against block devices (/dev/sdx) it does not work.
file /dev/sda
/dev/sda: block special
file sda.img
sda.img: data
So to ask my question another way, how can I make a block special device look like data?