이 페이지의 일부 또는 모든 정보는 Trusted Cloud by S3NS에 적용되지 않을 수 있습니다. 자세한 내용은
Google Cloud와의 차이점을 참조하세요.
손상되었거나 전체 디스크가 있는 VM 복구
VM에 액세스할 수 없거나 손상된 경우 VM 또는 전체 부팅 디스크를 복구할 수 있습니다.
액세스할 수 없는 VM 또는 전체 부팅 디스크 복구
인스턴스에 연결할 수 없거나 부팅 디스크가 가득 찼지만 크기를 조절할 수 없는 경우 새 인스턴스를 만들고 스냅샷에서 부팅 디스크를 다시 만들어 크기를 조절해야 합니다. 다시 만들고 있는 부팅 디스크의 크기를 알아야 합니다.
이 태스크에 필요한 권한
이 태스크를 수행하려면 다음과 같은 권한이 있어야 합니다.
- 프로젝트에 대한
compute.instances.create
권한(새 인스턴스를 만드는 데 필요)
- 프로젝트에 대한
compute.disks.create
권한(새 디스크를 만드는 데 필요)
- 디스크에 대한
compute.disks.createSnapshot
권한
- 새 VM 인스턴스에 대한
compute.instances.attachDisk
권한
- 연결할 디스크에 대한
compute.disks.use
권한
Trusted Cloud 콘솔에서 VM 인스턴스 페이지로 이동합니다.
VM 인스턴스로 이동
- 인스턴스 이름을 클릭하여 VM 인스턴스 세부정보 페이지를 엽니다.
- stop 중지를 클릭하여 VM을 중지합니다. 중지 옵션이 없으면 more_vert 작업 더보기 > stop 중지를 클릭합니다.
- 부팅 디스크 섹션에서 부팅 디스크의 크기와 이름을 확인합니다.
Trusted Cloud 콘솔에서 스냅샷 만들기 페이지로 이동합니다.
스냅샷 만들기로 이동
- 스냅샷 이름을 입력합니다.
- 소스 디스크 드롭다운 목록에서 부팅 디스크를 선택합니다.
- 만들기를 클릭합니다.
Trusted Cloud 콘솔에서 인스턴스 만들기 페이지로 이동합니다.
인스턴스 만들기로 이동
인스턴스 세부정보를 입력합니다.
이전 부팅 디스크의 스냅샷에서 새 부팅 디스크를 만듭니다.
- 부팅 디스크에서 변경을 선택합니다.
- 스냅샷을 선택합니다.
- 스냅샷 드롭다운 목록에서 이전 부팅 디스크의 스냅샷을 선택합니다.
- 부팅 디스크 유형을 선택합니다.
- 새 디스크 크기를 입력합니다.
- 선택을 클릭하여 디스크 옵션을 확인합니다.
만들기를 클릭합니다.
손상된 VM 복구
VM의 OS가 손상된 경우 VM을 복구하기 위해 부팅 디스크 데이터를 검색할 수 있습니다. 부팅 디스크를 복구하려면 소스 VM의 스냅샷이 손상되었을 수 있기 때문에 먼저 Google 제공 이미지를 사용하여 임시 VM을 만들어야 합니다.
VM에서 데이터를 검색하려면 다음 단계를 따르세요.
- 소스 VM의 부팅 디스크에서 스냅샷을 만듭니다.
- 공개 이미지를 사용하여 임시 VM을 만듭니다.
- SSH를 사용하여 임시 VM에 연결할 수 있는지 확인합니다.
다음 단계에 따라 임시 VM에 추가 디스크를 추가합니다.
Trusted Cloud 콘솔에서 VM 인스턴스 페이지로 이동합니다.
VM 인스턴스로 이동
만든 임시 VM을 선택합니다.
edit 수정을 클릭합니다.
추가 디스크에서 새 디스크 추가를 클릭한 후 다음을 수행합니다.
- 디스크 이름을 추가합니다.
- 소스 유형에서 스냅샷 탭을 선택합니다.
- 소스 스냅샷 드롭다운 메뉴에서 이 단계에서 이전에 만든 소스 VM의 스냅샷을 선택합니다.
- 완료를 클릭합니다.
저장을 클릭합니다.
SSH를 사용하여 VM에 연결합니다.
VM에서 디스크 및 파티션을 선택하고 디스크 이름을 기록해 둡니다(예: /dev/sdb1
).
lsblk
출력은 다음과 비슷합니다.
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
/mnt/newdisk
에 마운트 지점을 만듭니다.
sudo mkdir /mnt/newdisk
추가 디스크 파티션을 마운트 지점 /mnt/newdisk
에 마운트합니다.
sudo mount -o discard,defaults DISK_NAME /mnt/newdisk
DISK_NAME을 이전 단계에서 기록한 디스크 이름(예: /dev/sdb1
)으로 바꿉니다.
스냅샷의 파일 시스템이 /mnt/newdisk
에 마운트됩니다. 디렉터리를 탐색하고 데이터를 검색할 수 있습니다.
복구된 부팅 디스크로 VM을 만들려면 다음 단계를 수행합니다.
- 임시 VM의 디스크에서 이미지를 만듭니다.
- 임시 VM의 이미지로 VM을 만듭니다.
VM이 생성된 후 복구된 데이터를 VM으로 전송할 수 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-30(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-30(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."]]