Stay organized with collections Save and categorize content based on your preferences.
Linux Windows
If your VM is inaccessible or corrupted, you can recover the VM or its full boot disk.
Recovering an inaccessible VM or a full boot diskIf you can't connect to your instance, or your boot disk is full and you can't resize it, you must create an instance and recreate the boot disk from a snapshot to resize it. You must know the size of the boot disk you're recreating.
Permissions required for this taskTo perform this task, you must have the following permissions:
compute.instances.create
on the project to be able to create a new instancecompute.disks.create
on the project to be able to create a new diskcompute.disks.createSnapshot
on the diskcompute.instances.attachDisk
on the new VM instancecompute.disks.use
permission on the disk to attachIn the Google Cloud console, go to the VM instances page.
In the Google Cloud console, go to the Create a snapshot page.
In the Google Cloud console, go to the Create an instance page.
Enter the instance details.
Create a new boot disk from the snapshot of the old boot disk.
Click Create.
If a VM's OS is corrupted, you can retrieve the boot disk data to recover the VM. To recover the boot disk, you must first create a temporary VM using a Google-provided image, because the snapshot of the source VM might be corrupted.
To retrieve data from the VM, follow these steps:
Add an additional disk to the temporary VM by following these steps:
In the Google Cloud console, go to the VM instances page.
Select the temporary VM that you created.
Click edit Edit.
Under Additional disks, click Add new disk, and then do the following:
Click Save.
Connect to the VM using SSH.
Check the disk and partitions in the VM and make a note of the disk name—for example /dev/sdb1
:
lsblk
The output is similar to the following:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 10G 0 disk └─sda1 8:1 0 10G 0 part / sdb 8:16 0 100G 0 disk ├─sdb1 8:17 0 96G 0 part ├─sdb2 8:18 0 1K 0 part └─sdb5 8:21 0 4G 0 part
Create a mount point at /mnt/newdisk
:
sudo mkdir /mnt/newdisk
Mount the additional disk partition to the mount point /mnt/newdisk
:
sudo mount -o discard,defaults DISK_NAME /mnt/newdisk
Replace DISK_NAME with the disk name that you noted earlier in these steps—for example, /dev/sdb1
.
The snapshot's file system is mounted at /mnt/newdisk
. You can navigate the directories and retrieve data.
To create a VM with the recovered boot disk, follow these steps:
After the VM is created, you can transfer the recovered data to the VM.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["If your VM is inaccessible or its boot disk is full, you can recover it by creating a new instance and recreating the boot disk from a snapshot, ensuring you know the original boot disk size."],["To recover a corrupted VM's data, you can create a snapshot of the boot disk, create a temporary VM with a Google-provided image, and attach the snapshot as an additional disk."],["To access the data from a snapshot, you need to identify the disk name within the temporary VM, create a mount point, and mount the additional disk partition to that mount point."],["Creating an image from the disk of a temporary VM will allow you to create a new VM with the recovered boot disk and then you can transfer your data."],["Specific permissions like `compute.instances.create` and `compute.disks.create` are required to create new instances and disks during the recovery process, as well as snapshot and attachment permissions."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4