
dd로 이미지를 만들었어요
sudo dd if=/dev/sda of=/path_to_external_drive/backup.img
이제 모든 파티션의 마운트가 순조롭게 진행된 후 시스템을 복구하고 싶었습니다. 내가 만들 때
sudo dd if=backup.img of=/dev/sda
시스템을 부팅하려고 할 때까지 오류 메시지가 표시되지 않습니다.
sudo fdisk -l
BIOS가 파티션을 찾지 못하는 이유를 알고 싶었기 때문에 다음과 같은 오류 메시지가 나타납니다 .
파티션 1이 물리적 섹터 경계에서 시작되지 않습니다.
그래서 내 라이브 스틱에서 Disk Image Writer를 사용해 보았지만 이미지가 41kB가 너무 크다고 합니다.
어떻게 이런 일이 일어날 수 있으며 어떻게 해결할 수 있습니까? 새 SSD를 구입하는 것 외에 시스템을 복원할 수 있는 다른 방법이 있나요?
fdisk -l backup.img:
GPT PMBR size mismatch (976773247 != 976773167) will be corrected by w(rite).
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x635f93a2
Device Boot Start End Sectors Size Id Type
/dev/sda1 1 976773247 976773247 465.8G ee GPT
Partition 1 does not start on physical sector boundary.
gdisk -l /dev/sda:
GPT fdisk (gdisk) version 1.0.1
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8DC2A4AA-C369-4ED8-B876-DCE0418A1BD0
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773214
Partitions will be aligned on 2048-sector boundaries
Total free space is 4157 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 923647 450.0 MiB 2700 Basic data partition
2 923648 1128447 100.0 MiB EF00 EFI system partition
3 1128448 1161215 16.0 MiB 0C01 Microsoft reserved ...
4 1161216 669571071 318.7 GiB 0700 Basic data partition
5 669571072 960290815 138.6 GiB 8300
6 960290816 976771071 7.9 GiB 8200
답변1
이미지 파일은 디스크(976773248 - 976773168 섹터)보다 40KB 더 큽니다. dd
디스크의 전체 이미지 에는 작동하지 않습니다 . 귀하의 dd 명령이 "남은 공간 없음"과 같은 경고를 표시한 것 같습니다.
하지만 당신에게는 행운이 있습니다. 마지막(6번째) 파티션은 스왑 파티션입니다. gdisk and mkswap
마지막 파티션의 크기를 조정하고 파티션 테이블을 수정하는 데 사용할 수 있습니다 .
$ gdisk /dev/sda
- 마지막 파티션 제거
- gpt 파티션 테이블 복구(자동으로 수행되어야 함)
- 마지막 파티션을 다시 만듭니다(이전보다 약간 작습니다).
그런 다음 새 스왑 파티션을 포맷합니다.
$ mkswap /dev/sda6
대화형 사용에 관한 참고 사항 gdisk
:
나는 gdisk /dev/sda
당신에게 무엇을 보여줄지 정말로 예측할 수 없습니다. 도움말을 보려면 "h"를 입력하세요. 마지막 파티션을 제거하려면 "d"를 입력한 다음 "6"을 입력하세요. "n"과 "6"은 마지막 파티션을 다시 생성합니다. 종료하고 "w"를 사용하여 변경 사항을 작성합니다. gdisk는 "w"로 종료하지 않는 한 아무것도 쓰지 않습니다. 확실하지 않은 경우 언제든지 "q" 또는 "ctrl-c"를 사용하여 종료/취소할 수 있습니다.