Menu

save partition hda1, restoring it to hda2

dominik
2010-02-12
2013-04-05
  • dominik

    dominik - 2010-02-12

    hello,

    i saved the partition from hda1 in an image. now i want to restore this image to hda2.

    if i chose the image and start restoreparts it doesnt runs.

    why not??

    please help me :-)

     
  • dominik

    dominik - 2010-02-12

    appendix:

    i thinkt clonezilla looks for hda2 in that image and cant find it. but i dont sure.

    ps: sorry for my bad english. i hope someone can understand what i mean ;)

     
  • nai7

    nai7 - 2010-02-12

    dominik321,

      Thanks for using Clonezilla! Do you know if the image saved was a drive image or a partition image? As I understand things, if it was a drive image you cannot restore a single partition from that image. You would have to make a partition image then restore it to hda2.

    I hope this helps!

    Alan

     
  • dominik

    dominik - 2010-02-12

    hanks for your reply… i am going to be concrete..

    - i have an IDE-harddisk (hda) with two partitinos (hda1 and hda2)
    - i have installed windows xp on hda1
    - i have maked an partition-image (saveparts) only from hda1 and saved it on sda1
    - i can restore the partition (restoreparts) from sda1 to hda1
    - but i cant restore the partition (resotreparts) from sda1 to hda2

    the only i can see is the message in red: "Failed to restore partition image file /home/partimage/WinXP_SP2/hda2* to /dev/hda2! Maybe this image is corrupt! Press enter to continue…"

    conclussion: i have saved partition hda1 and want it restore to hda2. but clonezilla looks for hda2 in that image. please help me.

    thank you very much!!!

    greets, domi

     
  • nai7

    nai7 - 2010-02-12

    domi,

      Sounds like you are on the right path, but something may have gone wrong in image creation. I've read recommendations on this forum about running various repairs and checks on the source prior to image creation. Do you still have access to the original drive, can you see if it's okay?

    Steven or others may have other suggestions about what to check or other causes of the "image corrupt" message. In some circumstances I know it is possible to ignore the errors and restore anyway, but that may cause other problems. You may want to review the advanced mode flags for the ignore errors one, I've never tried it so, I don't know which one it is. Make sure to back up important data before experimenting! :)

    Hopefully we can get the tool to the point where one can tell a problematic image is being created before getting to the restore point.

    Let us know if you try something else, thanks!

    Alan

     
  • dominik

    dominik - 2010-02-12

    hello adavidson,

    i dont think that something is wrong while the image creation, because i can restore (and boot..) on hda1, but not on hda2.

    why does clonezilla search for a file beginning with hda2 in the imagefolder?
    the only partition i did save is hda1, so there cant be something with hda2…!

    i have access to the original disk.
    the windows-integrated error-checking results 0 errors/0 bad blocks.

    and i tested it with two different source and destination drives.

    i am very interested in solving the problem, because the tool is very nice.

    any concrete ideas? could it be a bug?

    ps: i dont have any important data on the system…

    please help me :)

    with best recards, domi

     
  • nai7

    nai7 - 2010-02-12

    Domi,

      Oh! I see. Interesting. I'm not sure why you would get that message under those conditions. Can you tell us what version of Clonezilla you are using and/or try you situation against the latest live version?

    Thanks!

    Alan

     
  • dominik

    dominik - 2010-02-12

    i use clonezilla 1.2.2-31 and it is my first version.

    i havent used any other versions before…

    greetz domi

     
  • Michael

    Michael - 2010-02-12

    OKAY!  I'm so glad I found this topic!

    I've got exactly the same problem as dominik321.  Here's the situation in full:

    I purchased a netbook (specifically the Toshiba nb205) last october, and promptly got fed up with windows and installed the Ubuntu Netbook Remix fell in love with it, and continued on my merry way.  Last week, I realized I needed to use a particular Windows application that I had no satisfactory replacement for in Ubuntu, so I went to go boot up into my Windows partition (which had been preserved by Ubuntu, or so I thought.)  Sadly, the windows partition had been corrupted when I installed Ubuntu.  No big deal, I thought, I'll just reinstall windows and carefully go through the process of setting up a dual boot this time.  Since I didn't want to go through the pain of re-tweaking and configuring everything I had done on the Ubuntu-side, I nabbed Clonezilla and made a backup image of the Ubuntu partition (which was on /dev/sda5 at the time) to an external hard disk I had lying around.

    After struggling a while I finally got Windows XP installed on the freshly partitioned and formatted hdd in the netbook.  Rather than trust UNR to resize the windows partition, I used gparted to create the two partitions before hand.  So on my netbook right now are two partitions, one of which has XP installed to it (/dev/sda1) and /dev/sda2 which is currently empty and I formatted to ext3  (not really familiar with linux file systems, I'm afraid.)

    I figured I could just specify to restore the image of my UNR install from my external hdd to the new /dev/sda2 partition, but I get the same error as domini321.  Clonezilla tells me the image file is corrupt, but careful examination of the error message reveals that it is searching the specified image of the partition for one from /sda2/ (which is the new partition I'm trying to move the old image to) instead of using the /dev/sda5 partition image that is actually there.

    I've thought about simply renaming everything within the clonezilla folder to match the new partition letter/number, but I figured I'd look for help.  That was yesterday.  And, lo and behold, this topic appears here today!

    So, any more description or things you would like me to test, just let me know and I shall do them.  I'm monitoring the thread.  Hopefully this will help dominik too!

    -Michael

     
  • Steven Shiau

    Steven Shiau - 2010-02-13

    "I've thought about simply renaming everything within the clonezilla folder to match the new partition letter/number" -> Definitely you can. Just remember to backup important data before you restore the image to the destination disk.
    Here I do not have the whole procedure to do so, but you can try:
    1. Rename the image name of partition, e.g. sda1.ntfs-ptcl-img.gz.aa -> sda2.ntfs-ptcl-img.gz.aa
    2. When you want to restore the image, choose "restoreparts", and choose to not recreate the partition table (i.e. -k, this is by default when you choose restoreparts).

    BTW, you have to make sure the destination partition size is equal or larger than the source one.
    Let me know the results if you make it. After we collect all the right procedure, we can put it on the FAQ/Q&A.
    Thanks.

    Steven.

     
  • Michael

    Michael - 2010-02-13

    I have just barely enough space on the external to make a backup copy of the partition image, I am doing so now.

    Then I will try renaming it.  My partition seems to be in several parts ending in .aa .ab etc., I assume I need to rename all of them from sda5 to sda2.

    And yes, the old sda5 partition was ~30GB smaller than the new sda2 partition it will be on, so I don't think that will be a problem.

    Will let you know how it goes.

    -Michael

     
  • dominik

    dominik - 2010-02-13

    thank you steven.

    after renaming ….. IT WORKS :-)

     
  • Michael

    Michael - 2010-02-14

    Alrighty, I'm currently 53% of the way through restoring the partition, and feel confident that everything is working as it is supposed to.  (Now I just need to figure out how to repair GRUB to make both partitions bootable. >_<)  So here's the process I used.

    Assuming you are working in disk-image mode, saved the partition to an external USB HDD, and are booting from a Clonezilla live usb key.

    -Load the external HDD in a functioning OS.  I used an UNR 9.10 Karmic Live USB Key, in lieu of a separate functioning linux box.

    -Open a terminal and navigate to the external HDD, and backup the directory of the image.  I simply renamed my 2010-02-08-20-img-UNR directory to 2010-02-08-20-img-UNRBAK.

    -cd into the image directory, the directory contents include a variety of files, the important ones will be titled something like "sda5.ext4-ptcl-img.gz.aa" .ab, .ac, etc.  Rename them all to have the correct disk letter and partition number for the new position it will be restored to.  I used the following line:

    $  sudo rename -v 's/sda5*/sda2/' sda5*

    I think that's the right perl expression, it took me some experimenting to get it just right.  Of course, you will need to use the right partition letter/number for your setup.  (sda2, sdb1, etc etc.)  The -v flag will show you every file that got renamed.  If you aren't quite sure you got it right, use the -n flag to just test it, without actually changing anything.

    -After you've done that, boot into clonezilla and run it in diskparts mode, choose to restore, mount to the external hdd that has the newly renamed image, choose expert mode.  I removed all of the flags related to writing the mbr and the space after the mbr to the disk.  Then choose the -k flag (as Steven so helpfully pointed out above)

    Everything should restore fine then!

    Thanks for the help!
    -Michael

     
  • nai7

    nai7 - 2010-02-14

    Steven,

      I'm not sure I understand why this is happening. Shouldn't it be possible to restore any source partition to any target partition (given proper sizes)? It's cool this can be resolved with a manual step, but it seems to cause some confusion. Is there a way the manual step could be avoided?

    Thanks!

    Alan

     
  • Yavor Nikolov

    Yavor Nikolov - 2010-02-14

    In fact seems since a while clonezilla is supposed to support restoring images to partitions with names different than original ones. There are some bugs however and this doesn't always work.

    I can see several problems here:
    1) Restore partition command looks like that:
    /opt/drbl/sbin/ocs-sr -c -t -r -k -p true restoreparts "2010-02-13-23-img" "hda2"
    Well, what if we have multiple partitions saved in that image folder!? How does it know which exactly partition from the image directory to restore to target?

    2) Looking at clonezilla's messages - here is what it tries to do when executing above-mentioned command:
      Figures out hda2 is part of disk hda
      Tries to find info about disk hda in image folder ("2010-02-13-23-img")
      If disk hda is not found in the image folder - then:
       - a message is printed on console sa
       - a temporary folder is created named something like tmp-cnvt + original name: and renames happen there.
       - !! However seems this doesn't work properly since sdb1 is renamed to hda1 instead of to hda2.!!!
      If disk hda is found there in the image folder: NO renaming happens at all!!! Clonezilla tries to find hda2 files there:
       - if hda2 is found in the image folder: then restore it (In case of multi-partition-image this could be a wrong partition restored!)
       - if hda2 is not there: aborts with error!

    In summary:
    - Regarding multi-partition-images: it could be said that that's not supported yet. It would be nice feature if we can restore multiple partitions to different names than original ones. (Even swapping names like: hda1 -> hda2 and hda2 -> hda1).

    - If we have specified different partiton name than original one: clonezilla should be able to restore from the specified source image (no matter if it resides on same disk name as target one or not).

    - Renaming (if such is used to remap partition names) should be done properly. Currently it either attempts to change just disk name (and not partition) or is doing something else wrongly.

    Regards,
    Javor

     
  • chris

    chris - 2010-02-15

    My problem seems to fit in this category as well. I am trying to restore a partitionimage of sda2 to sda8, both of typ ext3 on a multiboot system with SuSe Linux, Kubuntu karmic koala and win XP prof. The important partition is the main SuSe partition which was damaged by an installation of sound system. Thank god I did an image of this sda2 before installation. I want to write back to sda8 an empty and bigger one than sda2. The advantage is that damaged SuSe system is running on sda2 stable but without sound  and isnt overwritten by the restore of the non-damaged Suse image to sda8. When SuSe 10.3 is back on sda8, sda2 will be used for a new SuSe 11.2.
    The error message is "can't read the following volume file /stdin.001, pbzip2 data integrity (CRC) error in data, skipping". Before I tried the trick with renaming. I copied the whole folder to a different file name and renamed sda2.aa within the folder to sda8.aa. Furthermore a text file with content "sda2" was changed to "sda8". Your Software sucessfully changed the filesystem of sda8 to fit different i-nodes and partition size. After that I tried to restore again without option resize partition, but program stopped with 4%. Next time I used that option again and saw the mentioned error message. I can't believe my image is really corrupt. It seems its caused by something else. The image is written from a new WD HDD to an new external USB Maxtor HDD. Filesystem of the external HDD is ntfs with maximum filesize of about 9 GB.
    I'd appreciate every hint, thanks in advance, regards chris 

     
  • Steven Shiau

    Steven Shiau - 2010-02-18

    Alan,
    Yes, it's possible to restore an image of partition to another one, however, some modifications might have to be done in the restored OS, too:
    1. /etc/fstab
    2. grub config

    For modern GNU/Linux, the /etc/fstab and grub config use UUID, so the modifications are not required.

    Javor,
    Yes, ideally Clonezilla should work like what you mentioned. However, it will become complicated for multiple partitions to multiple destination partitions. I think one to one is acceptable. We will try to make it in the future.

    Abacus31,
    It the problem occurs randomly, maybe you'd better to check the hardware, especially RAM. You can do a memtest first to make sure it's OK or not.

    Steven.

     
  • chris

    chris - 2010-02-19

    Hallo Steven, thank you for the reply. I did check my RAM with memtest about 3 weeks ago and its ok. I assume the problem is related to the resize of the partition or the structure of the target partition itself. The error occurs always exactly after 1 min and 9secs or when finishing 4% of transmission. At that point the software normally starts the resize of the filesystem and aparently finishes sucessfully after a huge number of errors on i-nodes, blocksize etc. corrected by resize. After that I have to start over because the program finishes after resize. I tried option with or without resize, but on the next run the target partition should be prepared to receive the image, but it stops again at 4%. There appear different error messages e.g. "can't read the following volume file /stdin.001, pbzip2 data integrity (CRC) error in data, skipping." or "no cciss related disk was detected, skip cciss related actions."
    I would like to stop checksumming by option, whats the apropriate switch? I found rescue switch for restoreclone, but not for restoreparts. I tried different tricks from the forum e.g. renaming sda2.aa to sda8 .aa but did not succeed. Clonezilla is installed in prog. version 13.02.2010 karmic for dual processor on an Dell XPS 1530.
    The program reports "unicast restore sucessfully finished" when it interrupts. And it has changed something on sda2 the origin partition for the image. It does not find the kernel or initrd when booting from grub2. The sda2 related preferences within grub seem to be ok and the kernel is present at normal place. Perhaps the link to the kernel has changed, I am checking it at the moment.
    I'd appreciate every hint. Regards Chris

     
  • Steven Shiau

    Steven Shiau - 2010-02-21

    "pbzip2 data integrity (CRC) error" -> There is a memory issue about pbzip2, so in Clonezilla l1.2.4-3 we have switched to lbzip2. Could you give clonezilla live 1.2.4-3 a try?

    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.