我有一台新的 hp g6 笔记本电脑,在尝试安装 ubuntu 时,我遇到了这个问题
Gparted 将整个硬盘视为未分配的磁盘空间,并且 fdisk -lu 的输出为
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 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
Disk identifier: 0xc13cbdc4
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 409599 203776 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 409600 159584255 79587328 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 1208201216 1241939967 16869376 7 HPFS/NTFS
/dev/sda4 159584256 1250260991 545338368 f W95 Ext'd (LBA)
Partition 4 does not end on cylinder boundary.
/dev/sda5 159586304 683874303 262144000 7 HPFS/NTFS
/dev/sda6 683876352 1208201215 262162432 7 HPFS/NTFS
/dev/sda7 1241942016 1250260991 4159488 b W95 FAT32
Partition table entries are not in disk order
那么有没有简单的方法来解决重叠分区问题?
只有磁盘实用程序可以查看分区布局
我也尝试了以下命令
sudo sfdisk -uS -l /dev/sda
并给出以下内容
Disk /dev/sda: 77825 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units = sectors of 512 bytes, counting from 0
Device Boot Start End #sectors Id System
/dev/sda1 * 2048 409599 407552 7 HPFS/NTFS
/dev/sda2 409600 159584255 159174656 7 HPFS/NTFS
end: (c,h,s) expected (1023,254,63) found (717,232,27)
/dev/sda3 1208201216 1241939967 33738752 7 HPFS/NTFS
/dev/sda4 159584256 1250260991 1090676736 f W95 Ext'd (LBA)
start: (c,h,s) expected (1023,254,63) found (717,232,28)
end: (c,h,s) expected (1023,254,63) found (1,37,36)
/dev/sda5 159586304 683874303 524288000 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (717,200,60)
end: (c,h,s) expected (1023,254,63) found (585,116,43)
/dev/sda6 683876352 1208201215 524324864 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (585,85,13)
end: (c,h,s) expected (1023,254,63) found (455,76,5)
/dev/sda7 1241942016 1250260991 8318976 b W95 FAT32
start: (c,h,s) expected (1023,254,63) found (507,208,22)
end: (c,h,s) expected (1023,254,63) found (1,37,36)
那么我该如何修复这些边界?
答案1
为了理解这里的问题,有必要了解磁盘分区的工作原理。经典的 DOS 分区表只能包含四个条目。为了在保持兼容性的同时规避这一限制,一种分区类型被定义为所谓的扩展分区,它本身可以包含额外的“逻辑分区”。
在您的驱动器上,扩展分区中有一个“洞”,其中没有逻辑分区已定义。相反,主分区与扩展分区重叠并准确填补了该空缺。因此没有数据确实存在重叠,且不存在立即的数据丢失危险。
最简单的解决方案是删除有问题的分区 (/dev/sda3)(如果您不需要它)。之后,您可以尝试在同一位置创建一个新的逻辑分区。我建议使用 fdisk 来完成此操作,因为它不会尝试格式化任何内容,因此如果您备份了分区表,您可以简单地恢复它并重试。
警告
这很危险,你应该有一个完整备份在执行此操作之前,请先检查您的驱动器。