# Full VM recovery tool

**URL:** <https://forum.threefold.io/t/full-vm-recovery-tool/4152>\
**Category:** ThreeFold Technology\
**Created:** [December 2, 2023, 12:43am UTC](https://forum.threefold.io/t/full-vm-recovery-tool/4152 "2023-12-02T00:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott](https://forum.threefold.io/user_avatar/forum.threefold.io/scott/32/604_2.png) [@scott](https://forum.threefold.io/u/scott)\
**Post date:** [December 2, 2023, 12:43am UTC](https://forum.threefold.io/t/full-vm-recovery-tool/4152/1 "2023-12-02T00:43:46Z")

</div>

Lately we’ve had some questions about whether it’s possible to recover data from full VMs that are unreachable for reasons such as:

- Kernel bug described [here](https://forum.threefold.io/t/issue-detected-after-updating-ubuntu-kernel-action-required/4126)
- Lost SSH keys
- Other failures that prevent a VM from booting

While this is possible with deployments created through Terraform, it has not yet been possible for deployments created in the Playground. So, I decided to whip up a tool that could help users to recover their data.

## Prerequisites

- A full VM deployment on a live node (we can’t help if the node is down)
- Full VM is the old style that uses a raw disk image (the tool will give an error otherwise)
- A Linux environment to run the tool in (it might work on other OS but isn’t tested yet)
- Seed phrase used to deploy the original VM (again, can’t help if the seed is lost)

## Outcome

- A new VM that has the old VMs disk(s) attached as data disks
- Your original VM _will not_ be restored to working condition—this tool is only designed to give a chance to recover data

> Before you continue, please note that this tool is experimental and provided with limited support. It has the potential to affect your deployments in undesired ways if used without caution.
> 
> _If you’re reading this, please also consider backing up any important data you have, whether it’s stored in a VM on the ThreeFold Grid or anywhere else._

## Steps

To start, download, extract, and run the patched `grid-cli` binary from my [fork](https://github.com/scottyeager/tfgrid-sdk-go) of the [tfgrid-sdk-go](https://github.com/threefoldtech/tfgrid-sdk-go) repository:

```bash
wget https://github.com/scottyeager/tfgrid-sdk-go/releases/download/v0.16.0-recovervm2/tfgrid-sdk-go_Linux_x86_64.tar.gz
tar xf tfgrid-sdk-go_Linux_x86_64.tar.gz
./tfcmd recover

```

This will start a series of interactive prompts that will take you through the process of recovering the VM disk. You’ll have a chance to enter a new SSH key if desired.

Once the process is completed, you’ll see the info for your recovery VM on screen. Connect to the new VM and issue the following command:

```bash
mount /dev/vdb1 /mnt

```

After that’s done, you’ll be able to access all files from your original VM under the `/mnt` directory in the new VM. You can continue using the recover VM if you want, with the extra disk attached, or copy the files into a new VM using `scp` for example, if you’d rather not continue paying for the extra disk.

If you have any questions or issues, please respond in this thread or feel free to message me directly on Telegram (@scottyeager). Hope this helps!

---

<div class="post-metadata">

**Author:** ![Mik](https://forum.threefold.io/user_avatar/forum.threefold.io/mik/32/981_2.png) [@Mik](https://forum.threefold.io/u/Mik)\
**Post date:** [December 7, 2023, 5:31pm UTC](https://forum.threefold.io/t/full-vm-recovery-tool/4152/2 "2023-12-07T17:31:22Z")

</div>

Very effective tool! Tried it and it works.

For scp transfer, see the manual: [https://manual.grid.tf/computer\_it\_basics/cli\_scripts\_basics.html#transfer-files-between-local-and-remote-computers-ipv4-and-ipv6-with-scp](https://manual.grid.tf/computer_it_basics/cli_scripts_basics.html#transfer-files-between-local-and-remote-computers-ipv4-and-ipv6-with-scp)
