Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-26-2004, 04:11 PM   #1
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
How can I attach a compressed file to /dev/loop0 (for filesystem image recovery)?

My old hard disk died a while ago, but I was able to salvage most of the low-level data from it using dd. (In a cold environment… lots of ice and a big copper heatsink.)

I now have an image of a damaged ReiserFS filesystem that is compressed as a gzip file, and a copy as a .bz2. I would like to try running reiserfsck on this file, and possibly write up a tutorial on hard disk recovery.

The problem is that my new hard disk is the same size as the old one, and I can't afford to buy another one; the image is around 100Gb uncompressed. If I try to uncompress the file prior to using losetup to link it to /dev/loop0, then it won't fit. And while losetup does let you specify an encryption filter, a simple gzip uncompression/recompression doesn't seem to exist. I've also tried this:
sh -c 'echo "Yes"; cat oldhdd.gz' | /sbin/reiserfsck /dev/stdin
but this doesn't work because it can't seek in /dev/stdin (it's a character device, not a block device).

I problably could modify reiserfsck to use zlib and accept a regular file but I suspect there has to be an easier way.

My questions are: “How can I get this filesystem ‘into’ reiserfsck” and “How do I access a compressed file as a device, in such a way as to get at the uncompressed data”?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypted Root Filesystem HOWTO and /dev filesystem tmillard Linux From Scratch 0 10-18-2004 03:58 PM
loop: can't open device /dev/loop0: No such device or address miaviator278 Linux - Security 3 06-09-2004 09:24 PM
how can usb-storage device attach to specific /dev/sd* xxie Linux - Hardware 0 05-25-2004 10:14 PM
Read compressed filesystem... Worstje Linux - Newbie 2 05-23-2004 04:36 PM
suse 9 ftp install.... ramdisk: compressed image found at zero jdrots Linux - General 1 03-15-2004 04:15 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration