2

I am running Oracle VirtualBox on a Ubuntu 11.10 64-Bit Host with a Ubuntu Server 12.04 LTS 64-Bit Guest Machine, with many snapshots. After a reboot of the host (while the VM was running) the VM became 'inaccessible.' After poking around and making many gigabytes of backups, I got it to boot to a can't find boot medium screen. Do you have any suggestions or solutions on how to get my data, including the data from the latest snapshot, onto a new VM, or, if possible, fix this one? I'll be happy to provide more information.

EDIT: I think my snapshot chain is broken/corrupt.

EDIT 2: I cannot fix it, I just made a new VM.

2 Answers 2

1

Baring being able to go back to a working snapshot. Boot your VM to a live CD and see if you can access its hard drives. If so the worst case is to build a new vm with a fresh server, add the hard drives from the old vm; then retrieve data from the hard disks.

1
  • The hard drive is inaccessible. The only thing I can access is the first snapshot, which does not have all of my data.
    – Glen
    Commented May 2, 2012 at 13:36
1
  1. Restore the latest snapshot
  2. edit the hard drive info and remove all inaccessible hard drives
  3. add all the hard drives you can find to the VM (this makes them accessible)
  4. boot with a recovery CD, or live CD
  5. decide how to fix it... usually you need to mount the disk, chroot, and install grub

example for #5:

  1. Mount partitions

    mkdir /mnt/fixme
    parted -s /dev/sda print
    (based on output of above, decide which device is your /boot, /, etc., and modify next mount commands accordingly)
    mount /dev/sda2 /mnt/fixme
    mount /dev/sda1 /mnt/fixme/boot
    ... for all your partitions
    
  2. Mount special file systems

    mount | grep "on /proc"
    mount | grep "on /dev"
    (based on the above, decide what the "from" and "type" should be; my example below is correct for openSUSE 12.1)
    mount -t proc proc /mnt/fixme/proc
    mount -t devtmpfs devtmpfs /mnt/fixme/dev
    

    For example, on Ubuntu, it is "none" for the dev type: mount -t none devtmpfs /mnt/fixme/dev

    You might also need to mount /sys. I forget. You will know when you get an error message.

  3. Start the chroot shell (which is like being booted into your hard disk) (Side-note: this works badly if you have another disk on the system, like if you took your broken disk and plugged it into another Linux that is not booted from a CD, but from a disk; it will look in mtab to decide which is your boot disk, and put those guids in the grub config instead of the repaired disk's, so you need to recover with the boot prompt and run grub-install again later)

    chroot /mnt/fixme
    
  4. Install grub

    On openSUSE:
        update-bootloader
    On Ubuntu:
        update-grub2
    Alternate, on most systems, but not openSUSE, use both:
        install stage 1 bootloader:
            grub-install
        install guids and stuff in /boot (change cfg file to whatever you find is the correct one [menu.lst on openSUSE, grub.cfg on Ubuntu, etc.]) (if you skip the -o option, it just prints to standard out and doesn't save it in any files)
            find /boot -name "*grub*" -or -name "*.cfg" -or -name "*menu*"
            grub-mkconfig -o /boot/grub/grub.cfg
    
4
  • I cannot restore the latest snapshot, but thanks fo trying to help!
    – Glen
    Commented May 2, 2012 at 22:37
  • You can't restore, or when you do it says things are inaccessible? What does it say when restoring?
    – Peter
    Commented May 4, 2012 at 15:09
  • When you remove/add disks, the snapshots don't seem to record it in my experience. So the snapshotting just applies to whatever disks are attached, not to the machine itself. So I figured you must have removed or added disks since the snapshot, and restoring them doesn't get those disks back. That is the assumption I was working on.
    – Peter
    Commented May 4, 2012 at 15:10
  • No, I haven't changed the disks mounted.
    – Glen
    Commented May 4, 2012 at 22:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .