[OpenIndiana-discuss] retrieve individual files from snapshot of vbox virtual disc

Jim Klimov jimklimov at cos.ru
Thu Dec 25 10:16:43 UTC 2014


25 декабря 2014 г. 10:50:17 CET, Harry Putnam <reader at newsguy.com> пишет:
>Geoff Nordli <geoffn at gnaa.net> writes:
>
>> On 14-12-24 01:36 PM, Harry Putnam wrote:
>>> Build 151_a9
>>> I have the time slider running on a zfs-fs that covers the area
>where my
>>> virtual box guests live.
>>>
>>> I need some files from a gentoo linux guest.
>>>
>>> I have snaps of the vms OS v-discs.  How to get an individual file
>out of
>>> there?
>>>
>>> Is there any way to get at the files in that vm virtual disc, or do
>I
>>> have to make whole new gentoo vm and use the disc as one of that
>>> guests disc.  That is, copy the snapshotted disc to a directory
>named
>>> appropriately. Then create a new vm which uses that disc instead of
>>> creating a new blank disk.
>>>
>>> Has anyone here done something like that?
>>>
>>> Before I make a really big mess of things I'd like to hear from
>>> someone with a bit of experience on something like this?
>>>
>>> Maybe there is someway to mount it as loop-back mount on
>>> openindiana?.  Its formated as linux ext4
>>>
>>>
>>
>>
>> Hi Harry.
>>
>> Not sure if this is a zvol or a zfs filesystem.
>>
>> If it is a zvol, then I normally create a clone of snapshot and
>> directly attach it to the running vbox guest (not on the same sata
>> port as the existing disk).   You can attach the clone to the VM
>while
>> the VM is running.
>
>I'm not sure what a zvol is.  What I'm working with is one of several
>zfs-fs on a zpool.
>
>This attaching you speak of, again I don't know what you are talking
>about there.  Where can I read up on that?
>
>> Inside the guest, you can then mount it and retrieve the files you
>> need to recover, you can then unmount it and remove the zvol from the
>> running guest.
>
>Sound great... but don't think is going to work here.
>
>> If it is a zfs filesystem, then you should be able to directly access
>> the snapshot using the hidden zfs directory.
>
>Yes, of course I can access the snapshot directory and the snaps.  The
>trouble is, the snap is of a virtual disc... I see no way to open the
>disc.
>
>I can't just add it to the vm to be mounted because its the same name
>as one already there.  And the meta data kept by vbox is identical to
>an existing disc.
>
>Maybe there is some way to edit that meta data?  But all I can see is
>to create a new vm and mount it with that.  Quite a lot of trouble to
>get a single file. (In this particular case)
>
>> Go to the root of the filesystem and cd .zfs/snapshot.  You will see
>> the list of snapshots for the dataset.  You can then go in there and
>> copy the files out.
>
>No, what is in there is a virtual disc with linux fs on it, not loose
>files.  It needs to be mounted somewhere.... but I see no way to mount
>it on the virtual machine it comes from for the reasons above.
>
>
>_______________________________________________
>openindiana-discuss mailing list
>openindiana-discuss at openindiana.org
>http://openindiana.org/mailman/listinfo/openindiana-discuss

If you have file-based disk images, you can:

1) clone the snapshot you are interested in (maybe also rename it, so that time-slider's cleanup does not try to kill it)
2) Use the virtualbox cli command to change the uuid of the disk image file; specific commands changed between releases so rtfm your virtualbox version manual
3) follow earlier suggestions to mount the disk into the vm, extract data, remove, cleanup, etc.

Hth,
Jim

--
Typos courtesy of K-9 Mail on my Samsung Android



More information about the openindiana-discuss mailing list