How to access my backup from Autoboot- VM

Bummer, the dreaded power outage hit me and now I am at Autoboot. I have backups but just cannot get at them from the new Hyper-V VM I created. First off, I am not strong with Linux but have tried a number of things:

  • attached the VHDx to the host - Windows does not understand the disk format
  • installed cifs-utils and libguestfs-tools on an Ubuntu VM and tried to mount the VHDx - cannot find an appropriate kernel when I run guestmount
  • attached the bad VHDx to a working HA VM so now both disks are attached
  • attempted to use commands in homeassistant cli and in UI to access backup - not found
  • pressed “j” at Autoboot with both disks attached, got into the shell, mounted both data partitions and attempted to copy backup files from the data partition on the bad disk to the data partition on the new good disk - I thought this would work, but the HAOS mount command apparently only mounts read-only so I cannot write the file.

Maybe there is an easy way to get the backup data off the bad VHDx, but I have not found it. If I could mount the partition as RW I would be home free.

Can anyone give me a nudge how I can get my old backups to the new VM?

Thanks

I don’t understand this. What kind of backup did you create? VM level, HAOS Level, etc…?

I created backups in the homeassistant UI. I do not have VMDk host level backups or snapshots.

I meant I do not have VHDx snapshots or backups. This is on a Hyper-V not on a VMWare host.

I think you are in trouble If you stored those backups inside the VM.

I think so too. It is so frustrating that I can mount the partition in HAOS and can see the supervisor/backup files but have no way to copy them anywhere. If I could just mount the new partition in RW mode I can do this. Is there a hidden switch on the mount command in HAOS to allow RW? I tried -rw, no joy… Somehow HA knows how to make the data partition RW. Of if I could install the HAOS kernel in my Ubuntu VM, then maybe I could mount the VHDx in there with guestmount where I have many capabilities that HAOS does not have.

Thanks for the reply.

Way, way above my ‘pay grade’. Hopefully someone will come along and offer some help.

Once you do get back up and running, first thing I would do is create a 2 method system for backing up the entire VM and one for HAOS; all stored outside the VM.

After “learning linux” yesterday I think I will be using a Samba backup method as well as scheduled Hyper-v checkpoints for the whole VM.

Thanks for the info.

I tried something else but am still running into an issue - maybe someone can help solve this. Here is what I did:

  • installed the Terminal and SSH add-on on a working HA instance running in a Hyper-V VM
  • attached the VHDx to the working VM - I can see the sda and sdb disks in /dev
  • ran mkdir /tmp/sdb8
  • ran chmod 777 /tmp/sdb8
  • ran mount /dev/sdb8 /tmp/sdb8
  • got the following error:
    mount: mounting /dev/sdb8 on /tmp/sdb8 failed: Permission denied
  • ran chmod 777 /dev/sdb8
  • got the following error:
    chmod /dev/sdb8: Read-only file system

Anyone know how I can mount sdb8?

So, when using the terminal add-in I can see the partition but cannot mount it. When I am directly on the HAOS console I can mount disk8/disk15 and can see files but I cannot copy files to anywhere useful since all disks are read-only.

I have been dealing with the same issue, I finally have access to the drive now with the help of this post (I am running on a ubuntu linux host with vbox vm of hassio).

I was able to get access into the file system using the testdisk tool after converting the VDI to a raw image. Now I just need to figure out how to find the backup files! No idea where the backups are or what they are called to extract them.

If I understand your question, the .tar files are in the /backup directory on a working HA instance. If you are mounting the /dev/sdb? volume in another VM I recall they are in the mountpoint directory in the supervisor/backup directory.

My HA instance got corrupted today and I found that my backups were not being copied to Google drive by the excellent Google drive backup add-on as I’d run out of space on the drive.

Here’s the sequence of steps I followed to recover HA, retrieve the most recent backup from the corrupt VDI file, and recover back, only losing half a day of data.

I use the free Oracle VM virtualisation software running HA as a VM under Windows 10. If you use a pi or other approach the steps will be different.

  1. Download the latest VirtualBox HASS software and create a brand new HA virtual server
    Windows - Home Assistant
  2. Start the virtual machine and let HA set itself up. http://homeassistant:8123
  3. Get to the point where you are ready to start the onboarding Onboarding Home Assistant - Home Assistant
  4. If you have a backup on a NAS drive, Google drive or wherever, download the backup onto the Windows PC, select ‘restore from backup’ and HA will restore the backup and you’ll only have lost the data after the last backup point.
  5. In my case I did this OK and HA was now running but had lost 3 days of data. I realised that there was more recent backups locked inside the old (corrupt) HA VDI file. Process to get these out is as follows.
  6. Download and install the free DiskInternals Linux Disk Reader Access to Ext 2/3/4, HFS and ReiserFS from Windows | DiskInternals (you don’t need the pro version)
  7. Run Linux Disk Reader. First step is to open the (corrupt) old virtual disk. Drives/Mount Image/Containers, select Virtalbox virtual disks (worth noting that Linux reader does support other virtual disk types).
    Click Next, navigate to where your corrupted HASS VDI is, select it and click Open
  8. You’ll now see a number of additional volumes for the Linux disks within the VDI. The one you want is the one that contains hassos-data - /mnt/data in my case
  9. Double click the hassos-data volume, then navigate through the supervisor and single click the backup folder. We’re going to extract all the HA backups as we can’t tell which is the latest
  10. Click Commands/Save, choose where to save the files to, and then let it extract all the backups to the Windows PC.
  11. Having got the most recent HA backups on the PC you can restore that into HA by following step 4 above (or if HA is already running, go to System / Backups, three dots in the top corner, Upload and upload the backup into HA and you can restore it from there).

Hope this helps someone else. I only lost half a day of data as a result of being able to restore from the backup from within the VDI disk