Menu

Extracting single file from ext3 backup image

Help
2009-01-13
2013-04-05
  • divine-shadow

    divine-shadow - 2009-01-13

    Hi everyone i have been trying to extract files from a backup i made of a ubuntu ext3 OS and i have not been able to restore it using clonezilla and i need the files from this backup i have on my USB External 500 GIG in the top directory but clonezilla will find my backup when it list all the backups to restore but when i finish the backup menu at the end it said no backup found in directory but i saw it in the menu when it asked what backup to use.

    I read this post

    http://drbl.sourceforge.net/faq/fine-print.php?path=./2_System/43_read_ntfsimg_content.faq#43_read_ntfsimg_content.faq 

    But this is to mount a ntfs format image file backup. I would like to know how would i do this for a backup of a ubuntu filesysem like ext3.

    I have tried a few thing but get errors all the time when i enter the above links directions in a terminal.

    Please anyone i need my files back and this on back up i have is the only on and i can get them by restoring with clonezilla or mounting a image .

    Thanks so much for all you help and time.

     
    • divine-shadow

      divine-shadow - 2009-01-13

      Hi everyone this is my issue I used Clonezilla to backup My hole drive to a image on my My Book 500 gig. Now when I use Clonezilla to restore the image it says I don't have a backup but I do I have my backup located here.

      /media/My Book/2008-12-03-04-img

      Clonezilla is not able to read it there and I cant get it to recognize it at all no matter what I try. I have booted with 3 different cds.

      clonezilla-sysresccd-full-mod-2.6.0.iso
      gparted-clonezilla-2.3.iso
      clonezilla-live-1.2.1-17.iso

      Also I am trying to restore it to a Virtual Box PC with the live CD because I only need the home directory not the hole system so I was going to restore the clonezilla backup on the Virtual Box machine and when it booted to the restored ubuntu system I was going to back up just the home directory to my external My Book and do a reinstall of ubuntu on my main system.

      I also read on a post that you can mount the clonezilla backup image in ubuntu and extract files you need but have not been successful.

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

      Here are the directions I got from the post.

      1. Prepare a large disk in Linux
      2. Say if your image is /home/partimag/YOURIMAGE/, and the image is /home/partimag/YOURIMAGE/hda1.ntfs-img.aa, hda1.ntfs-img.ab...
      run
      "file /home/partimag/YOURIMAGE/hda1.ntfs-img.aa"
      to see it's gzip, bzip or lzop image. Say it's gzip, then you can run
      cat /home/partimag/YOURIMAGE/hda1.ntfs-img.* | gzip -d -c | ntfsclone --restore-image -o hda1.img -
      Then you will have a "hda1.img" which you can mount it by
      mount -o loop -t ntfs hda1.img /mnt

      Then all the files are in /mnt/

      My goals are to get my home directory back from this clonezilla backup either by mounting the image or getting the restore to work the clonezilla restore has not been working I have been trying to do it for 2 weeks now and no luck so I am thinking the best way would be to mount the image and browse it and get the files back from my home directory.

      I don't understand the mounting direction above for my layout.

      My backup is in my My Book here: /media/My Book/2008-12-03-04-img

      In the 2008-12-03-04-img folder i have these file there

      /media/My Book/2008-12-03-04-img/parts
      /media/My Book/2008-12-03-04-img/sda1.aa
      /media/My Book/2008-12-03-04-img/sda1.ab
      /media/My Book/2008-12-03-04-img/sda1.ac
      /media/My Book/2008-12-03-04-img/sda1.ad
      /media/My Book/2008-12-03-04-img/sda1.ae
      /media/My Book/2008-12-03-04-img/sda1.af
      /media/My Book/2008-12-03-04-img/sda1.ag
      /media/My Book/2008-12-03-04-img/sda1.ah
      /media/My Book/2008-12-03-04-img/sda1.ai
      /media/My Book/2008-12-03-04-img/sda1.aj
      /media/My Book/2008-12-03-04-img/sda1.ak
      /media/My Book/2008-12-03-04-img/sda-chs.sf
      /media/My Book/2008-12-03-04-img/sda-mbr
      /media/My Book/2008-12-03-04-img/sda-pt.parted
      /media/My Book/2008-12-03-04-img/sda-pt.sf

      I am pretty sure that it is gziped and the I backedup is filesytem is ext3.

      I ran this command in ubuntu terminal "file /home/partimag/YOURIMAGE/hda1.ntfs-img.aa"

      but like this "file /home/partimag/2008-12-03-04-img/sda1.aa"

      I got this error "ERROR: cannot open `/home/partimag/2008-12-03-04-img/sda1.aa' (No such file or directory)"

      so I tried this command "file /media/My Book/2008-12-03-04-img/2008-12-03-04-img/sda1.aa"

      I got this error "/media/My: ERROR: cannot open `/media/My' (No such file or directory)
      Book/2008-12-03-04-img/2008-12-03-04-img/sda1.aa: ERROR: cannot open `Book/2008-12-03-04-img/2008-12-03-04-img/sda1.aa' (No such file or directory)"

      I was also wondering how I would run these command to my system specs since I am not using ntfs I did a backup of ext3 filesytem

      Example command:
      cat /home/partimag/2008-12-03-04-img/sda1.* | gzip -d -c | ext3clone --restore-image -o hda1.img -

      mount -o loop -t ext3 hda1.img /mnt

      Please if any on could help my I really need these file to get up and running for my work. I am stuck now just trying to get these files back.

      Please Please very much appreciated.

      Thanks for your time eveyone.
      Divine-shadow

       
      • Steven Shiau

        Steven Shiau - 2009-01-14

        Divine-shadow,
        Some messages for you:

        1. The image "2008-12-03-04-img" which you created is for partitions image only. Make sure you choose "restore-parts", not "restore-disk" when you use clonezilla to restore the image. Otherwise Clonezilla won't find the disk image.

        2. Before do anything about the image, BACKUP THEM RIGHT NOW to avoid any other mistake. Then you can run the command like:
        cat /home/partimag/2008-12-03-04-img/sda1.* | gzip -d -c  > mysda1.img
        (Make sure the working dir has enough space, if not, mount a large partition and use it as a working dir)

        Once mysda1.img is created, you can mount it by:
        mount -o loop mysda1.img /mnt

        Then all your data are inside /mnt.

        Good luck.

        Steven.

         
        • Steven Shiau

          Steven Shiau - 2009-02-13

          Oops... My bad.
          Because the image file is partimage format, you can not mount it directly. You have to find a partition (block device, e.g. /dev/sdb1) to restore the data on it by partimage.
          You can run:
          /opt/drbl/sbin/partimage
          choose the target partition and enter source image (/home/lordoshko-mike/mysda1.img) to restore it.
          ///WARNING/// The data on your target partition will be overwritten. Make sure you know what you are doing.

           
    • divine-shadow

      divine-shadow - 2009-02-12

      Hi all just want to say thanks so much for the help I got the backup converted to a .img file
      it was created in this location /home/username/mysda1.img.

      so I tried to use the following mount command

      sudo mount -o loop mysda1.img /mnt

      And this message poped up  you must specify the filesystem type

      So i did file info command on mysda1.img and got this.

      PartImage file version 0.6.1 volume 0 type ext3fs device /dev/sda1, original filename stdout, not compressed.

      So it tells me the file is ext3fs so i added this to the mount command.

      sudo mount -o ext3fs loop mysda1.img /mnt

      I ran the above command and got this message.

      Usage: mount -V                 : print version
             mount -h                 : print this help
             mount                    : list mounted filesystems
             mount -l                 : idem, including volume labels
      So far the informational part. Next the mounting.
      The command is `mount [-t fstype] something somewhere'.
      Details found in /etc/fstab may be omitted.
             mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
             mount device             : mount device at the known place
             mount directory          : mount known device here
             mount -t type dev dir    : ordinary mount command
      Note that one does not really mount a device, one mounts
      a filesystem (of the given type) found on the device.
      One can also mount an already visible directory tree elsewhere:
             mount --bind olddir newdir
      or move a subtree:
             mount --move olddir newdir
      One can change the type of mount containing the directory dir:
             mount --make-shared dir
             mount --make-slave dir
             mount --make-private dir
             mount --make-unbindable dir
      One can change the type of all the mounts in a mount subtree
      containing the directory dir:
             mount --make-rshared dir
             mount --make-rslave dir
             mount --make-rprivate dir
             mount --make-runbindable dir
      A device can be given by name, say /dev/hda1 or /dev/cdrom,
      or by label, using  -L label  or by uuid, using  -U uuid .
      Other options: [-nfFrsvw] [-o options] [-p passwdfd].
      For many more details, say  man 8 mount .

      No files were mounted in the /mnt folder I dont know what to do I am new to commands in linux but i was thinking about it and my .img file is in my username folder so i change the command like this to see if it worked.

      sudo mount -o ext3fs loop /home/username/mysda1.img /mnt

      I ran it and got the same message as above

      I also tried these commands and get the above message.

      sudo mount -o ext3fs loop /dev/hda1 /home/lordoshko-mike/mysda1.img /mnt

      &

      sudo mount -o ext3fs loop /dev/sda1 /home/lordoshko-mike/mysda1.img /mnt

      Nothing I do works I have looked on the net to read up on how to mount stuff and mount .img files and nothing I found or did work or help please anyone help me

       
    • Robert J Townley

      Instead of ext3fs, you may try ext2 with journaling.

      You need to find the exact file system type that  mount will take.  Even though i have ext3 filesystems, ext2 is what i had to pass.  Do a where mount, and in that directory, you will find mount.cifs, mount.ext2, mount.reiserfs.  Then do "man mount.cifs" but for the equivalent for ext3 which from memory is actually just ext2 with -j for journaling.  To be safest, mount -t ext2 and READ ONLY so that you don't accidentally muck up the image.

       
      • Steven Shiau

        Steven Shiau - 2009-03-19

        Robert,
        Great! Thanks for sharing your experience with us.

        Regards,
        Steven.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.