Emergency -- Need to Restore File from Clonezilla image

Discussion in 'HOWTO-Related Questions' started by jkrell, Apr 21, 2009.

  1. jkrell

    jkrell New Member

    So back in February I made a backup image of my Fedora 10 server machine using the howto on this site. The setup of my server is that I have 3 250Gb HDDs setup as one disk using LVM. The backup process went smoothly and I have my backup stored on an external 1Tb HDD.

    Last week, I accidentally erased a file using command line. I was just absent-mindedly doing stuff and what is weird is I don't remember being asked to confirm deletion. In any event, the file is gone and I need it back. I have checked everywhere and the only place it exists is in the Clonezilla live image (normally I have redundancies, but I did not want this file in my other backup spots, which are not as secure as the external HDD I use for my Clonezilla images.

    Needless to say, I do not just want to restore the image because now months have gone by and other files have changed, which I do not want to lose by restoring the image. One thing I could do is just backup my /home and /var/www/ folders and then restore the image, and then restore the /home and /var/www/ folders. But this would be risky as I am not sure what else might have changed in the interim.

    I have done some research and found the following regarding how to mount a Clonezilla image and pull files from it:

    http://ubuntuforums.org/showthread.php?t=872832

    Unfortunately, this does not work for me, mostly because I cannot figure out how to reference my image. Like I said above, I made an image of the entire disk, which is set up using LVM, so I do not have a file ending in -img in the subfolder for my backup. I cannot post my directory structure of the backup now because I am at work, but I can do so later and I can also post the output of my attempts at mounting the image.

    For now, though, I wanted to ask a question. Is there a way I can simply restore the Clonezilla image to my 1Tb external HDD? Once restored, I could pull the file I need out, and wipe the drive clean. The problem is, as I mentioned above, that my image is of an LVM setup, whereas my external HDD is a single 1Tb drive.

    Do you think I could use GParted to create 3 drives the same sizes as my three existing 250Gb drives, and restore the image to those? Would that work?
     
  2. tebokkel

    tebokkel New Member

    If you have enough space to restore a unzipped image (let's say, about the size of all space you used up in February), I'ld much rather go that way.
    It's a lot easier than nearly erasing your system to restore an image. If you can restore the image, I would think you can also mount it as an image.

    So, what do you mean with "referencing" your images? Is it not on the same machine?

    Any output/screendump or script that you can post?

    Paul
     
  3. jkrell

    jkrell New Member

    I am not sure I understand what you are talking about.

    First, if you click on the link I posted, it tells you to type in 'cat [name of image] | gzip -d -c | ntfsclone ... etc., etc.

    Where it says [name of image] is what I mean by "referencing" my image. Everything is on the same computer (which I thought was pretty clear from my OP).

    You say that if I have space to restore an image you'd much rather go that way. What way? As opposed to what other way? This is where I get confused by your message.

    Also, I never said I was going to erase my system. That is the whole point.

    Finally, as noted in my OP, I am at work and cannot access the machine. I'll post more about the backup file folder structure and output when I try mounting when I can mess around with the computer at home.

    For now, I am really looking for people's thoughts on the very simple question at the end of my OP.
     
  4. tebokkel

    tebokkel New Member

    I wasn't trying to get you pissed.. :)

    The answer to your question: no, that's not possible. You have only one image, so creating three partitions is probably not neccesary.

    What I meant, is that it's preferable to restore the image in another location and move the file you need to it's original location. Waaaaay more convinient than backing up /var/www, /home, restoring your whole system and then restoring /var/www and /home. That's simply not needed.

    Awell.. you got my thoughts on your simple question.. :p

    Paul
     
  5. jkrell

    jkrell New Member

    Thanks. I am not pissed, just confused.

    Please note that the image that is backed up is LVM and includes three separate drives. Therefore, SDA1, SDB1, and SDC1 are all part of my logical volume that I backed up.

    When I try to restore the image to a blank 500Gb partition on my external hard drive, it says something like it cannot do it because there are multiple devices in the image. That is why I thought I should maybe set up three separate partitions (SDE1, SDE2 and SDE3) for the backup.

    That will not work?
     
  6. jkrell

    jkrell New Member

    Additional Information

    So I promised additional information. Here is the contents of my Clonezilla backup directory:

    Code:
    [----@----------- 2009-02-22-21-img]$ ls
    disk                 sda-mbr        sdc-pt.sf
    Info-dmi.txt         sda-pt.parted  sdd1.dd-img
    Info-lshw.txt        sda-pt.sf      sdd1-size
    Info-packages.txt    sdb-chs.sf     sdd-chs.sf
    lvm_logv.list        sdb-mbr        sdd-mbr
    lvm_vg_dev.list      sdb-pt.parted  sdd-pt.parted
    lvm_VolGroup00.conf  sdb-pt.sf      sdd-pt.sf
    parts                sdc-chs.sf     swappt-VolGroup00-LogVol01.info
    sda1                 sdc-mbr        VolGroup00-LogVol00
    sda-chs.sf           sdc-pt.parted
    I believe the backup file is 'VolGroup00-LogVol00' but it is confusing because it does not end with 'img' -- but maybe that means nothing.

    If I type 'file VolGroup*', here is what I get:

    Code:
    VolGroup00-LogVol00: gzip compressed data, from Unix, last modified: Sun Feb 22 14:58:30 2009, max speed
    
    So then, per the Clonezilla FAQ (referenced at the Ubuntu forum I linked to in my OP), I enter 'cat VolGroup* | gzip -d -c | ntfsclone --restore-image -o /home/partimag/sde2/test.img -', I get:

    Code:
    ntfsclone v2.0.0 (libntfs 10:0:0)
    ERROR: Input file is not an image! (invalid magic)
    
    But it has to be the image because that is the largest file in the directory. Anyone have any ideas?
     
  7. tebokkel

    tebokkel New Member

    This is a difficult one.. The basic volumes of an LVM-group are not very useful for recovery of a single file. Basically you should be able to restore the images as you proposed, and then restore the file. But it probably takes a lot of tinkering.

    Good luck!

    Paul
     

Share This Page