Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I deleted a xen image using xen-delete-image and was wondering if there's a way in which I can restore this since 'xen-delete-image' only removes it from the list of xen images but doesn't delete the actual image files (disk.img and swap.img). Is there a command to achieve this?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

The folowing procedure has worked for me, provided that the image is not corrupted in any way.

Using the gui, I created a new server, named it differently from the original one, and created a new drive image with the same capacity as the deleted server.

I cancelled the installation at the first chance, leaving a virtual server without a bootable os.

After this I stopped the server, and overwrote the image I just created with the image of the deleted server (naming it identically to the new image).

All I had to reset where the network settings...

share|improve this answer

Probably the best thing to do is to copy the existing disk.img and swap.img out of the way, create a new instance using xen-create-image and move the original img files back over the new ones. You may need to set some config options like the block device names and mac address to to old values before it boots correctly.

share|improve this answer
    
I already tried that but when loading it gets stuck at some point with the message "Waiting for root file system" –  domino Oct 18 '09 at 11:45
    
Sounds like the block device name is wrong. Try changing hd to sd in the xen config file or vis versa. –  David Pashley Oct 18 '09 at 15:32
    
Hey thanks david, tried this as well but still no luck –  domino Oct 20 '09 at 9:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.