Image Restore

Hi, i wanted to know if it is possible to restore an image differently than the restore CD. I have the image on a USB drive and i need to restore from there. There is a command line o similar to do that from restore CD? or a need another software?.
it would be nice to be able to restore from a USB drive when you boot from restore CD.
Thanks in advance.

You can restore an image by ./cserver --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /full/path/to/image.vhd --vhdcopy_out /dev/sda1

You’d need to restore the partition table first, because currently you cannot restore the MBR via command line.

OK, to restored the MBR i must use the Image_C_xxxxxx.vhd.mbr file? or do i need make a backup from the original Disk?

The MBR is in the .mbr file, but it is a special file format only UrBackup can read and unluckily I did not expose this via command line. It would not be much of an issue adding that, but I’d have to rebuild the restore CD, which is a little bit of work. I’ll add it with the next update.

Meanwhile you could:

  • Manually save the partition table and/or MBR with fdisk/dd
  • I can add the command line option and you could update the program via internet.

Hi Martin, i’m sorry bother you with all this questions but i can’t do work the restore part of Urbackup.
This is the scenario, i need to do a preventive replace of a disk in 1 server and i cannot stop this server for long time.
So, my idea is connect the replacement disk in a test PC, restore the image from there and then change the disk in the server.
The test PC has 2 internal SCSI Disks each one has 74GB, and i’ll connect the replacemet disk via USB, the replacement disk has 500GB.
When i boot from restore CD, i see the image disk in the backup sever, but when i want to select the restore destination disk appear 3 disk with Unknow name and size 0.
I select the USB disk (previously i look in the shell which one is the USB Disk in the partition table), the restoration process begins but after a few minutes the progress bar is in 1% or 2% and suddenly goes to 100% and then i get a Wrong size error.
I try a few times wit the same result.
Any suggestion is Welcome.
Thanks in advance

It get’s the drive name and size via “hdparm -I”. I guess I’ll have to change that method, because it seems to not work for all drives.

I looked it up and the “Wrong size” error can also happen when the server cannot open the image file or if it cannot find the image at all, therefore you should look into the server logfile.

Then there are two logfiles in the /root directory after the restore failed: restore_mode.txt and restore_wizard.txt . You could send them to martin@urbackup.org .

Hi Martin, first of all i want ot wish you a Happy New Year. when I return to work, I´ll send you the files that you indicated me a few days ago.I think the problem of restoring the image maybe a conectivity issue, because the last time I tried to restore the disk, a timeout error appeared.
It may be possible to install a Urbackup Server and copy the configuration of the first server? I am going to try to connect the PC with the disck directly to this “copy” of the backup server to see if I can solve the problem
Thanks a lot.

Thanks! To you as well!

I’m currently working on updating the restore image. The current state can be found here https://sourceforge.net/projects/urbackup/files/Restore/1.0%20WIP/ now. Maybe it’ll just work. It’s smaller and based on the Debian live CD now (not KNOPPIX).

The “wrong size error” was definitely wrong as it appeared when the connection to the server was lost and reconnecting failed. I have corrected that (changed the error message).

The MBR can be restored via command line now e.g.

./urbackup_client --plugin ./liburbackupclient.so --restore --restore_cmd write_mbr --mbr_filename Image_C_XXXX.vhd.mbr --out_device /dev/sda

Hi Martin, thank you very much, I could finally restore the disk with the new CD and via command line.
I left a comment and a question.

First of all, to restore the disk, i follow these steps:
1 - Mount the USB disk that contains the MBR and OS images.
Run this commands:
2 - ./urbackup_client --plugin ./liburbackupclient.so --restore --restore_cmd write_mbr --mbr_filename /mnt/Image_C_xxxxxx-xxxx.vhd.mbr --out_device /dev/sda

and

3 - ./urbackup_client --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /mnt/Image_C_xxxxxx-xxxx.vhd --vhdcopy_out /dev/sda1
4 - Reboot the system

Comment: After finishing the restoration, the SO does not boot, so, perform a fixboot and fixmbr from the boot cd, still not boot, do a couple of times the restore process and finally worked ¿¿??.
To get me in case, I made a new disk image, restoring MBR ended well, the image restoration also finished well, but the OS does not boot again.
I took the disk and connect it to another PC, I can see the restored partition appears, but the file type is RAW, so formatting the partition with NTFS, made the process of restoring MBR and OS image again and the SO started normally.

Now the query, I have to also restore another disk, this is a Dynamic Disk, and when I try to restore the image, fails me with the error: VHDCOPY, VHD Info: Size: xx.xxxxGB xxxxxMB. Segmentation fault.
Can i do something to resolve this?
Thanks again and again…

I reviewed it and saw a probable bug, which could cause your corruption. I have updated the image at https://sourceforge.net/projects/urbackup/files/Restore/1.0%20WIP/ Can you try again?

You should also run
partprobe
between step 2. and 3. so the Linux kernel rereads the partition table in the MBR.

[quote=“yarara”]
Now the query, I have to also restore another disk, this is a Dynamic Disk, and when I try to restore the image, fails me with the error: VHDCOPY, VHD Info: Size: xx.xxxxGB xxxxxMB. Segmentation fault.
Can i do something to resolve this?
Thanks again and again…[/quote]

I’ve hardened that tool a little. Can you try it with the above image and report back?

Hi Martin, today i tried the new restore image CD with the dynamic disk, the process of MBR restore was good, then when i try to restore the image disk i got the error “Couldn’t open output file”.
So, i run partprobe /dev/sda, like you suggested me, then i tried to restore the image again and the restoration process finished good. If i mount /dev/sda1 i can view the files in the disk. Still, the SO fail to start, i get a BSOD (is a Windows 2003 Server SBS) but may need try it in the original server (the server that i used to restore the image is similar but is not the same as the original).
However, for that you consider, the two server that i have to change the disks are identical in hardware and the first disk that i restored (it was another Windows 2003 Server Standar, with basic disk), boot and started well in this test server.
I’m gonna do some more tests and i’ll let you know the results.
I hope not to confuse you with my comments.
Thank you so much.

I tried this method on windows 8 64 and XP. In windows 8 method does not work, but in windows xp working
on windows 8 system is not is loaded. Even when restoring boot from the Windows CD download is still not working

First of all, to restore the disk, i follow these steps:
1 - Mount the USB disk that contains the MBR and OS images.
Run this commands:
2 - ./urbackup_client --plugin ./liburbackupclient.so --restore --restore_cmd write_mbr --mbr_filename /mnt/Image_C_xxxxxx-xxxx.vhd.mbr --out_device /dev/sda

and

3 - ./urbackup_client --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /mnt/Image_C_xxxxxx-xxxx.vhd --vhdcopy_out /dev/sda1
4 - Reboot the system

Do you have a system reserved volume on the windows 8 64bit? If yes you need to copy Image_C to sda2 and SYSVOL to sda1.

Still does not work. tried to do it this way:
Windows 8 64
First of all, to restore the disk, i follow these steps :
1 - Mount the USB disk that contains the MBR and OS images.
Run this commands:
2 - ./urbackup_client --plugin ./liburbackupclient.so --restore --restore_cmd write_mbr --mbr_filename /mnt/Image_C_xxxxxx-xxxx.vhd.mbr --out_device /dev/sda

3 partprobe /dev/sda

4 - ./urbackup_client --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /mnt/Image_C_xxxxxx-xxxx.vhd --vhdcopy_out /dev/sda2

5 ./urbackup_client --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /mnt/Image_SYSVOL_xxxxxx-xxxx.vhd --vhdcopy_out /dev/sda1

6 - Reboot the system

I realized my mistake, this method works on windows 8, but if you try it on VirtualBox not forget to enable IO APIC

First of all, to restore the disk, i follow these steps :
1 - Mount the USB disk that contains the MBR and OS images.
Run this commands:
2 - ./urbackup_client --plugin ./liburbackupclient.so --restore --restore_cmd write_mbr --mbr_filename /mnt/Image_C_xxxxxx-xxxx.vhd.mbr --out_device /dev/sda

3 partprobe /dev/sda

4 - ./urbackup_client --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /mnt/Image_C_xxxxxx-xxxx.vhd --vhdcopy_out /dev/sda2

5 ./urbackup_client --no-server --plugin ./libfsimageplugin.so --vhdcopy_in /mnt/Image_SYSVOL_xxxxxx-xxxx.vhd --vhdcopy_out /dev/sda1

6 - Reboot the system

Martin thanks for the help

Thanks, for the update. IO-APIC must only be enabled, if it was enabled in the system you backed up, I think.

Updated the wiki with the SYSVOL info ( https://urbackup.atlassian.net/wiki/display/US/How+to+restore+via+command+line ).

A post was split to a new topic: Combining image backups to disk VHD