Mount and Extract files from images
-
@Sebastian-Roth @Wayne-Workman @Junkhacker @george1421 @x23piracy @pr1m0
Sorry to dredge up an old topic, but I went back and tried to redo the steps that I had originally done to restore an image using purely the server. While the steps I listed will work, I did originally mention it, but didn’t specifically include the steps to restore the image on the server. Here is the current working 100% steps to make this all work properly.
Without the touch command below it will error out. So otherwise this works as expected.
cd /images/IMAGENAME/ touch d1p2_extracted.img cat d1p2.img | pigz -d -c | partclone.restore -C -s - -O d1p2_extracted.img mount -t ntfs-3g d1p2_extracted.img /mnt
-
@BedCruncher Very interesting…
Thank you for the additional clarity on making this work smoothly.
-
#wiki worthy because this has use cases. All the components needed are in this thread - but I’ll approach it from a workstation perspective - don’t want to monkey around too much on potentially a production fog server.
-
In my case I actually did the following so that I didn’t mess up the working directory or it’s file contents
touch /tmp/d1p2_extracted.img cat d1p2.img | pigz -d -c | partclone.restore -C -s - -O /tmp/d1p2_extracted.img mount -t ntfs-3g /tmp/d1p2_extracted.img /mnt
just dumped it to /tmp so that it would be deleted during normal system processes and not fill up my images directory with double images.
-
@BedCruncher This is only an FYI note for those who may find this thread in the future.
The developers have added a new and faster compression/decompression tool in the current release of fog (1.3.5 and later). This is the zstd compression tool instead of the pigz tool. You just have to be aware of this. The zstd tool should read pigz compressed files no problem. But pigz can not read zstd compressed files. -
I will look into modifying those instructions to work with the new compression method. Not sure when I will get that accomplished, but I am sure I can get it done within the next little bit. Thanks for letting me know.
-
I have tested using the
Partclone Zstd
image compression method on an image under Centos 7 and was able to get it working with one small thing. I had to download ZSTD as it wasn’t native to the base OS.yum install zstd -y
I was then able to extract and mount the image using the commands
touch /tmp/d1p2_extracted.img cat d1p2.img | zstd -dcf | partclone.restore -C -s - -O /tmp/d1p2_extracted.img mount -t ntfs-3g /tmp/d1p2_extracted.img /mnt/
I also added the
-f
flag to zstd to force it. I don’t think this is necessary, but as a testing scenario it worked.