WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

RE: [Xen-users] HELP PLEASE !! How to Recover deleted img file?

To: "Henning Sprang" <henning_sprang@xxxxxx>, "Radu Stanescu" <radukn@xxxxxxxxx>
Subject: RE: [Xen-users] HELP PLEASE !! How to Recover deleted img file?
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Fri, 2 Feb 2007 14:27:31 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 02 Feb 2007 05:27:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <5bb00b3f0702020515x547e15acr28c3b4aa06886366@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdGzGB4F0EHuAkPR2Wp3jJOK4NjVwAAHheA
Thread-topic: [Xen-users] HELP PLEASE !! How to Recover deleted img file?
 

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Henning Sprang
> Sent: 02 February 2007 13:16
> To: Radu Stanescu
> Cc: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Xen-users] HELP PLEASE !! How to Recover 
> deleted img file?
> 
> On 2/2/07, Radu Stanescu <radukn@xxxxxxxxx> wrote:
> > Hy today I accidentaly delete the img file of one of my 
> domU. The guest is
> > still up and running.
> 
> Interesting, can you even login, and the system still works?
> Then Xen is saving the file from being deleted totally until the vm is
> shut down. After that, it will probably free the open file, and it
> will be gone.
> 
> So don't stop the vm, and do a full rsync backup ASAP.

That seems like good solution to me. 

You could even attach another disk-device and copy to that (xm
block-attach DomID BackDev FrontDev Mode [BackDomain] is the command to
use). Of course, you can't save things that aren't files, but at least
if you have some important data on file(s) in the domain, you can save
those. Anything else should be salvagable by re-installing the OS +
apps. 
> 
> >How can i recover the img file from which it was
> > loaded?
> > I tried lsof but i don't see any open file by xen regarding my domU
> 
> This is a generic linux problem and has nothing to do with Xen.

Yes. Linux (like all Unix versions) will keep the file alive but
invisible until the last user of the file closes it. Since it's an image
file, there's most likely only one user of the file, and that's the VM
itself (or more precisely, the  part of Dom0 that manages your
image-file to disk translation for the DomU). 

> 
> I think, if you once stop the vm and have not done an rsaync backup as
> said above, you have  not much chances, but at very first, you should
> stop the machine completely and not use the harddisk where the lost
> image resided.
> 
> Go to linux recovery mailing lists and read about that.
> 
> As far as I know, when you don't use special techniques in advance,
> (there is some libraray that makes rm not really delete stuff, AFAIK,
> and for sure we all have backups, at least _after_ we lost important
> data the first time, right?!), it's absolitely not easy to recover
> lost files.

Indeed. It used to be very easy in the old days with DOS (as long as new
data wasn't added to the disk), but modern file-systems aren't quite so
trivially designed, and to modify the right places to recover files
within the filesystem gets very hairy very quickly. Best way is to save
what you can from inside the VM, and recreate what you can't save -
you'll waste much more time trying to recover the file itself, for no
real value. 

--
Mats
> 
> Heninng
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
> 
> 
> 



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users