Submitted by mcordas on Tue, 11/09/2010 - 11:25 Pro Licensee
Hi.
We accidently deleted a wrong VM on LVM...
Immediatly after, we ran vgcfgrestore -l VolGroup00 and : vgcfgrestore -vvf /etc/lvm/archive/VolGroup00_00052.vg VolGroup00 lvscan lvchange -tv -ay /dev/VolGroup00/xxx_company_net_img mount -a
The LVM Volume appears again, is active, but when trying to mount or to check filesystem, we get : losetup failed : loop: can't get info on device /dev/VolGroup00/xxx_company_net_img: Inappropriate ioctl for device
Any ideas how to recover the filesystem ?
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Tue, 11/09/2010 - 13:55 Comment #1
I don't think there is any way, sorry .. maybe some LVM experts would know, but I doubt it.
Submitted by mcordas on Tue, 11/09/2010 - 15:59 Pro Licensee Comment #2
Restored from backup. Lost some emails but nothing critical.
Feature wish : would it be possible to implement double confirmation when deleting VD or VM's, like typing Yes, or some other other possibility ?
I feel really dumb about that.... but it could maybe avoid such problem for ither users.
Thanks anyway.
Submitted by JamieCameron on Tue, 11/09/2010 - 22:44 Comment #3
Cool, glad you managed to get it back! I don't know if double-confirmation makes sense, since there is already a confirmation page for VM or disk deletion.
Submitted by mcordas on Wed, 11/10/2010 - 02:14 Pro Licensee Comment #4
Well, experience shows it's easy to misread a statement and to click before "oops".
Having coded myself some client database UI, and after some requests to undelete records from the clients, I saw that a double confirmation forces people to concentrate more and reflect twice before actions that could potentially lead to data loss.
Also, as when we transfer a Virtual Domain from a server to another, it could sometimes be usefull to have a checkbox like "donot delete tha associated iage disk" when deleting or moving a VM from a server to another.
Doing so leaves a "backup" in place, in case something goes wrong.
Having more experience with libvirt, it works like that : when we delete a VM in libvirt, we have to manually delete the image disk. It's a supplementary task, but in our case, it would have been big chance...
Anyway it's up to you I understand it's a matter of opinion.
Submitted by mcordas on Wed, 11/10/2010 - 11:33 Pro Licensee Comment #5
Excuse me to come up again about that incident, but is it possible to have a little bit more information on the way the filesystem is created on the LVM volumes for the KVM virtual machines ?
I realized that it's not possible, even if the VM is down (I tried with a test VM), to mount the LVM volume via standard commands or via webmin's "Hardare / LVM" management features, to access it's filesystem.
Is the ext2 or est3 filesystem inside an image file inside a LVM logical volume ? Is it encrypted ? Is it standard to KVM, or is it particular to the way Cloumin manages VMs ?
Again, thank you for your patience and excellent customer service.
Submitted by JamieCameron on Wed, 11/10/2010 - 12:13 Comment #6
For KVM virtual disks, they are in whole-disk format which includes a partition table. Inside each partition is a standard ext2 or ext3 filesystem. However, you need some trickery to mount those filesystems on the host, as the normal
mount -o loop
command will not work..Cloudmin knows how to do this though, and has API commands that can access files within a down KVM instance's filesystem. See :
http://www.virtualmin.com/documentation/cloudmin/devel/cli
and
http://www.virtualmin.com/documentation/cloudmin/devel/cli/cloudmin_file...
Submitted by mcordas on Fri, 11/12/2010 - 06:34 Pro Licensee Comment #7
Thanks.
What I found is mainly that :
stat-file - Displays information about a file on a managed system. transfer-file - Transfer a file between two systems upload-file - Uploads a file to one or more systems upload-multiple-files - Uploads multiple files to a directory on one or more systems.
But i did not find how to mount the filesystem to be able to navigate in it without attributing it to a VM.
Is it possible ?
Submitted by JamieCameron on Fri, 11/12/2010 - 12:39 Comment #8
Currently there is no command to mount a filesystem, as those other commands mount and un-mount as needed. I chose not to leave a filesystem mounted as this would cause starting the VM to fail, and could break backups..
That said, an API command to mount the filesystem isn't too unreasonable for experienced users. I will look into adding this for Cloudmin 5.1.
Submitted by JamieCameron on Sun, 11/14/2010 - 23:10 Comment #9
Cloudmin 5.1 will add
mount-system
andumount-system
API commands to make access to a VM's filesystem easier..Submitted by mcordas on Mon, 11/15/2010 - 10:13 Pro Licensee Comment #10
Thanks a lot ! That's some good news.
Submitted by Issues on Mon, 11/29/2010 - 10:19 Comment #11
Automatically closed -- issue fixed for 2 weeks with no activity.