Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Linux
Windows
Jika VM Anda tidak dapat diakses atau rusak, Anda dapat memulihkan VM atau boot disk lengkapnya.
Memulihkan VM yang tidak dapat diakses atau boot disk yang penuh
Jika Anda tidak dapat terhubung ke instance, atau boot disk Anda penuh dan Anda tidak dapat
mengubah ukurannya, Anda harus membuat instance dan membuat ulang boot disk dari
snapshot untuk mengubah ukurannya. Anda harus mengetahui ukuran boot disk yang
sedang Anda buat ulang.
Izin yang diperlukan untuk langkah ini
Untuk melakukan tugas ini, Anda harus memiliki izin berikut:
compute.instances.create pada project agar dapat
membuat instance baru
compute.disks.create di project agar dapat membuat disk baru
compute.disks.createSnapshot pada disk
compute.instances.attachDisk pada instance VM baru
Izin compute.disks.use pada disk yang akan dilampirkan
Di konsol Google Cloud , buka halaman VM instances.
Pilih snapshot boot disk lama dari menu drop-down Snapshot.
Pilih Boot disk type.
Masukkan ukuran baru untuk disk.
Klik Select untuk mengonfirmasi opsi disk Anda.
Klik Create.
Memulihkan VM yang rusak
Jika OS VM rusak, Anda dapat mengambil data boot disk untuk memulihkan VM. Untuk memulihkan boot disk, Anda harus membuat VM sementara terlebih dahulu menggunakan image yang disediakan Google, karena snapshot VM sumber mungkin rusak.
Untuk mengambil data dari VM, ikuti langkah-langkah berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-18 UTC."],[[["\u003cp\u003eIf 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.\u003c/p\u003e\n"],["\u003cp\u003eTo 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.\u003c/p\u003e\n"],["\u003cp\u003eTo 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.\u003c/p\u003e\n"],["\u003cp\u003eCreating 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.\u003c/p\u003e\n"],["\u003cp\u003eSpecific permissions like \u003ccode\u003ecompute.instances.create\u003c/code\u003e and \u003ccode\u003ecompute.disks.create\u003c/code\u003e are required to create new instances and disks during the recovery process, as well as snapshot and attachment permissions.\u003c/p\u003e\n"]]],[],null,["# Recover a VM with a corrupted or full disk\n\nLinux Windows\n\n*** ** * ** ***\n\nIf your VM is inaccessible or corrupted, you can recover the VM or its full boot\ndisk.\n\nRecovering an inaccessible VM or a full boot disk\n-------------------------------------------------\n\nIf you can't connect to your instance, or your boot disk is full and you can't\nresize it, you must create an instance and recreate the boot disk from a\nsnapshot to resize it. You must know the size of the boot disk you're\nrecreating.\n\n#### Permissions required for this task\n\nTo perform this task, you must have the following\n[permissions](/iam/docs/overview#permissions):\n\n\n- `compute.instances.create` on the project to be able to create a new instance\n- `compute.disks.create` on the project to be able to create a new disk\n- `compute.disks.createSnapshot` on the disk\n- `compute.instances.attachDisk` on the new VM instance\n- `compute.disks.use` permission on the disk to attach\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n 1. Click the instance name to open the **VM instance details** page.\n 2. Click stop **Stop** to stop the VM. If there is no **Stop** option, click more_vert **More actions \\\u003e** stop **Stop**.\n 3. In the **Boot disk** section, note the boot disk's size and name.\n2. In the Google Cloud console, go to the **Create a snapshot** page.\n\n [Go to Create a snapshot](https://console.cloud.google.com/compute/snapshotsAdd)\n 1. Enter a snapshot **Name**.\n 2. Select the boot disk from the **Source disk** drop-down list.\n 3. Click **Create**.\n3. In the Google Cloud console, go to the **Create an instance** page.\n\n [Go to Create an instance](https://console.cloud.google.com/compute/instancesAdd)\n4. Enter the instance details.\n\n5. Create a new boot disk from the snapshot of the old boot disk.\n\n 1. Under **Boot disk** , select **Change**.\n 2. Select **Snapshots**.\n 3. Select the snapshot of the old boot disk from the **Snapshot** drop-down list.\n 4. Select the **Boot disk type**.\n 5. Enter the new size for the disk.\n 6. Click **Select** to confirm your disk options.\n6. Click **Create**.\n\nRecovering a corrupted VM\n-------------------------\n\nIf a VM's OS is corrupted, you can retrieve the boot disk data to recover the\nVM. To recover the boot disk, you must first create a temporary VM using a\n[Google-provided image](/compute/docs/images), because the snapshot of the\nsource VM might be corrupted.\n\nTo retrieve data from the VM, follow these steps:\n\n1. [Create a snapshot](/compute/docs/disks/create-snapshots#creating_snapshots) from the boot disk of the source VM.\n2. [Create a temporary VM using a public image](/compute/docs/images#os-compute-support).\n3. Check if you're able to [connect to the temporary VM](/compute/docs/instances/connecting-to-instance) using SSH.\n4. Add an additional disk to the temporary VM by following these steps:\n\n 1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n 2. Select the temporary VM that you created.\n\n 3. Click edit **Edit**.\n\n 4. Under **Additional disks** , click **Add new disk**, and then do the\n following:\n\n 1. Add the disk name.\n 2. For **Source type** , select the **Snapshot** tab.\n 3. In the **Source snapshot** drop-down menu, select the snapshot of the source VM that you created earlier in these steps.\n 4. Click **Done**.\n 5. Click **Save**.\n\n5. [Connect to the VM](/compute/docs/instances/connecting-to-instance#connecting_to_vms)\n using SSH.\n\n6. Check the disk and partitions in the VM and make a note of the disk\n name---for example `/dev/sdb1`:\n\n \u003cbr /\u003e\n\n ```\n lsblk\n \n ```\n\n \u003cbr /\u003e\n\n The output is similar to the following:\n\n \u003cbr /\u003e\n\n ```\n NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT\n sda 8:0 0 10G 0 disk\n └─sda1 8:1 0 10G 0 part /\n sdb 8:16 0 100G 0 disk\n ├─sdb1 8:17 0 96G 0 part\n ├─sdb2 8:18 0 1K 0 part\n └─sdb5 8:21 0 4G 0 part\n \n ```\n\n \u003cbr /\u003e\n\n7. Create a mount point at `/mnt/newdisk`:\n\n \u003cbr /\u003e\n\n ```\n sudo mkdir /mnt/newdisk\n \n ```\n\n \u003cbr /\u003e\n\n8. Mount the additional disk partition to the mount point `/mnt/newdisk`:\n\n \u003cbr /\u003e\n\n ```\n sudo mount -o discard,defaults DISK_NAME /mnt/newdisk\n \n ```\n\n \u003cbr /\u003e\n\n Replace \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e with the disk name that you noted earlier in\n these steps---for example,\n `/dev/sdb1`.\n\n The snapshot's file system is mounted at `/mnt/newdisk`. You can navigate the\n directories and retrieve data.\n\nTo create a VM with the recovered boot disk, follow these steps:\n\n1. [Create an image from the disk](/compute/docs/images/create-delete-deprecate-private-images#creating_a_custom_image) of the temporary VM.\n2. [Create a VM with the image](/compute/docs/instances/create-start-instance#create_a_vm_from_a_custom_image) of the temporary VM.\n\nAfter the VM is created, you can transfer the recovered data to the VM."]]