我的 GRUB 分区大小为 1 MB,起始于第 2049 块。我的 BIOS 无法识别它,因此我决定使用以下命令将其移动到磁盘的开头
dd if=/dev/sda5 of=/dev/sda bs=512 count=2048
现在我根本看不到分区。操作前,前 2048 个段(1MB)根本没有格式化,parted 无法识别。
我在其他磁盘 dev/sdc 中创建了一个映像,并在映像上运行了 gdisk
sudo gdisk -l /dev/sdc
GPT fdisk (gdisk) version 0.8.8
Caution: invalid main GPT header, but valid backup; regenerating main header from backup!
Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table!
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: damaged
Found invalid MBR and corrupt GPT. What do you want to do? (Using the GPT MAY permit recovery of GPT data.)
1 - Use current GPT
2 - Create blank GPT
Your answer: 1
Disk /dev/sdc: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 6FEB1F15-70D6-42F9-A4B8-6E960B8C65F5
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 3437 sectors (1.7 MiB)
Number Start (sector) End (sector) Size Code Name
1 4096 1887105023 899.8 GiB 8300
2 1887105024 1920333823 15.8 GiB 8300
3 1920333824 1944627199 11.6 GiB 8300
4 1944627200 1953523711 4.2 GiB 8200
5 2048 4095 1024.0 KiB EF02
sfdisk -l /dev/sdc 输出仍然是
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util sfdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdc: 121601 cylinders, 255 heads, 63 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature /dev/sdc: unrecognized partition table type
No partitions found
fsck -y /dev/sdc 说
sudo fsck -y /dev/sdc
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superbloque es inválido, intentando los bloques de respaldo...
fsck.ext2: Bad magic number in super-block mientras se intentaba abrir /dev/sdc
The superbloque could not be read or does not describe a valid ext2/ext3/ext4
sistema de ficheros. If the dispositivo is valid and it really contains an ext2/ext3/ext4
sistema de ficheros (and not swap or ufs or something else), then the superbloque
is corrupt, and you might try running e2fsck with an alternate superbloque:
e2fsck -b 8193 <dispositivo>
or
e2fsck -b 32768 <dispositivo>
有没有办法恢复我的分区或至少我的数据?我想在这些第一段中写一些其他内容应该可行。
最好的,
朱利安
答案1
使用实时 USB 中的 gdisk 解决
sudo gdisk /dev/sda
1 选项 b 将 USB 磁盘上的分区表保存为 sda.gpt 文件
2 选项 r
3 选项 l 从 USB 驱动器加载保存的 sda.gpt 文件
3 选择 w 完成
瞧!
在此之前,我使用 gddrescue 进行了备份
sudo apt-get install gddrescue
sudo ddrescue -f -r3 /dev/sda /dev/sdc PATH$/mapfile
并在 /dev/sdc 上试验性地执行上述步骤。