jas*_*nes 53 partitioning gparted hard-drive
我的笔记本电脑上有一个硬盘驱动器,有两个分区(一个安装了 Ubuntu 12.04 的 ext3 和一个交换分区)。
fdisk
给我以下警告:
Partition 1 does not start on physical sector boundary
Run Code Online (Sandbox Code Playgroud)
是什么原因,我需要修复它吗?如果是这样,如何?
这是sudo fdisk -l
:
Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 testine, 63 settori/tracce, 91201 cilindri, totale 1465149168 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Identificativo disco: 0x5a25087f
Dispositivo Boot Start End Blocks Id System
/dev/sda1 * 63 1448577023 724288480+ 83 Linux
Partition 1 does not start on physical sector boundary.
/dev/sda2 1448577024 1465147391 8285184 82 Linux swap / Solaris
Run Code Online (Sandbox Code Playgroud)
这是sudo lshw
相关结果:
*-disk
description: ATA Disk
product: WDC WD7500BPKT-0
vendor: Western Digital
physical id: 0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: 01.0
serial: WD-WX21CC1T0847
size: 698GiB (750GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=5a25087f
*-volume:0
description: EXT3 volume
vendor: Linux
physical id: 1
bus info: scsi@0:0.0.0,1
logical name: /dev/sda1
logical name: /
version: 1.0
serial: cc5c562a-bc59-4a37-b589-805b27b2cbd7
size: 690GiB
capacity: 690GiB
capabilities: primary bootable journaled extended_attributes large_files recover ext3 ext2 initialized
configuration: created=2010-02-27 09:18:28 filesystem=ext3 modified=2012-06-23 18:33:59 mount.fstype=ext3 mount.options=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered mounted=2012-06-28 00:20:47 state=mounted
*-volume:1
description: Linux swap volume
physical id: 2
bus info: scsi@0:0.0.0,2
logical name: /dev/sda2
version: 1
serial: 16a7fee0-be9e-4e34-9dc3-28f4eeb61bf6
size: 8091MiB
capacity: 8091MiB
capabilities: primary nofs swap initialized
configuration: filesystem=swap pagesize=4096
Run Code Online (Sandbox Code Playgroud)
这些是相关的/etc/fstab
线路:
UUID=cc5c562a-bc59-4a37-b589-805b27b2cbd7 / ext3 errors=remount-ro,user_xattr 0 1
UUID=16a7fee0-be9e-4e34-9dc3-28f4eeb61bf6 none swap sw 0 0
Run Code Online (Sandbox Code Playgroud)
ish*_*ish 54
这一行解释了警告:
扇区大小(逻辑/物理):512 字节/ 4096 字节
lshw
显示它是西部数据驱动器,第一家切换到AF的公司。他们有一个广泛的页面,上面有很多信息,您可能希望查看。因此,出现警告是因为分区 1 从逻辑扇区 63 = 字节 32256 开始,这是一个不能被 4096 整除的数字;事实上,它接近第 7 个物理扇区的末尾(准确地说是位置 7.875 :)
理论上,这种分区可能会影响读/写 IO 速率,具体取决于驱动器的固件。如果您对现在的性能感到满意,请忽略警告,无需执行任何操作。如果没有,先备份所有重要数据,然后使用Gparted移动分区,使其从4096字节扇区开始;将起始边界设置为1 MiB是一种简单的方法。
小智 7
对于您的新硬盘,首先根据您的意愿使用 gparted 创建分区。
然后,使用sudo fdisk device_name访问您的硬盘。 fdisk 中的m命令将打印帮助菜单。
npcompete@npcompete-desktop:~$ sudo fdisk /dev/sda 设备呈现的逻辑扇区大小小于 物理扇区大小。与物理扇区对齐(或最佳 I/O) 大小边界是推荐的,否则性能可能会受到影响。 命令(m 寻求帮助):p 磁盘 /dev/sda:1000.2 GB,1000204886016 字节 255 个磁头,63 个扇区/磁道,121601 个柱面,总共 1953525168 个扇区 单位 = 1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节 / 4096 字节 I/O 大小(最小/最佳):4096 字节 / 4096 字节 磁盘标识符:0x0008e009 设备引导开始结束块 Id 系统 /dev/sda1 2048 209717247 104857600 83 Linux /dev/sda2 209717248 1953525167 871903960 5 扩展 /dev/sda5 600349113 795667319 97659103+ 83 Linux 分区 5 不在物理扇区边界上开始。 /dev/sda6 795667383 990985589 97659103+ 83 Linux 分区 6 不在物理扇区边界上开始。 /dev/sda7 990985653 1953520064 481267206 83 Linux 分区 7 不在物理扇区边界上开始。 /dev/sda8 209719296 600349112 195314908+ 83 Linux 分区表条目不按磁盘顺序排列 命令(m 寻求帮助):d 分区数 (1-8):5 命令(m 寻求帮助):p 磁盘 /dev/sda:1000.2 GB,1000204886016 字节 255 个磁头,63 个扇区/磁道,121601 个柱面,总共 1953525168 个扇区 单位 = 1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节 / 4096 字节 I/O 大小(最小/最佳):4096 字节 / 4096 字节 磁盘标识符:0x0008e009 设备引导开始结束块 Id 系统 /dev/sda1 2048 209717247 104857600 83 Linux /dev/sda2 209717248 1953525167 871903960 5 扩展 /dev/sda5 795667383 990985589 97659103+ 83 Linux 分区 5 不在物理扇区边界上开始。 /dev/sda6 990985653 1953520064 481267206 83 Linux 分区 6 不在物理扇区边界上开始。 /dev/sda7 209719296 600349112 195314908+ 83 Linux 分区表条目不按磁盘顺序排列 命令(m 寻求帮助):w 分区表被修改了! 调用 ioctl() 重新读取分区表。 同步磁盘。 npcompete@npcompete-desktop:~$ sudo fdisk /dev/sda 设备呈现的逻辑扇区大小小于 物理扇区大小。与物理扇区对齐(或最佳 I/O) 大小边界是推荐的,否则性能可能会受到影响。 命令(m 寻求帮助):n 分区类型: p 主要(1 个主要,1 个扩展,2 个免费) l 逻辑(从 5 开始编号) 选择(默认 p):l 添加逻辑分区 8 第一扇区(600351161-1953525167,默认600352768): 使用默认值 600352768 最后一个扇区,+扇区或+size{K,M,G}(600352768-795667382,默认795667382): 使用默认值 795667382 命令(m 寻求帮助):p 磁盘 /dev/sda:1000.2 GB,1000204886016 字节 255 个磁头,63 个扇区/磁道,121601 个柱面,总共 1953525168 个扇区 单位 = 1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节 / 4096 字节 I/O 大小(最小/最佳):4096 字节 / 4096 字节 磁盘标识符:0x0008e009 设备引导开始结束块 Id 系统 /dev/sda1 2048 209717247 104857600 83 Linux /dev/sda2 209717248 1953525167 871903960 5 扩展 /dev/sda5 795667383 990985589 97659103+ 83 Linux 分区 5 不在物理扇区边界上开始。 /dev/sda6 990985653 1953520064 481267206 83 Linux 分区 6 不在物理扇区边界上开始。 /dev/sda7 209719296 600349112 195314908+ 83 Linux /dev/sda8 600352768 795667382 97657307+ 83 Linux 分区表条目不按磁盘顺序排列 命令(m 寻求帮助):w 分区表被修改了! 调用 ioctl() 重新读取分区表。 同步磁盘。
现在使用fdisk 中的d选项删除发出警告的分区。
首先是命令d,然后是分区号(在警告中提到)。
现在使用w命令将更改写入磁盘。它将退出 fdisk。
第二次使用sudo fdisk device_name访问您的硬盘。
现在使用fdisk 中的n命令使用可用空间(之前我们删除了一个分区,即可用空间或未分配空间)创建一个新分区。
在 New partition 命令中,不要为 First 和 Last Sector 输入任何值,只需按Enter 即可。它将采用默认值。
现在使用w命令将更改写入磁盘。它将退出 fdisk。
对所有分区执行上述步骤。完成此格式后,使用gparted格式化新创建的分区。(这就是我为我所做的工作。 fdisk -l 输出中没有警告。)
小智 5
正如izx所指出的:
您的硬盘具有高级格式 4096 字节扇区,分区未完全对齐。
本文很好地解释了高级格式规范及其对用户端硬盘驱动器分区实践的影响。
要解决此问题,您必须备份数据,然后:
要使用称为 GParted 的图形硬盘驱动器分区软件来完成此操作,您可以:
以超级用户权限启动 Gparted 应用程序;小心行事!
gksudo gparted
Run Code Online (Sandbox Code Playgroud)从 GParted 菜单右上角的下拉菜单中选择包含错误大小分区的存储设备。
.
小智 5
通过切换“u”单位。创建分区时将显示默认扇区大小。如果您开始对新磁盘进行分区并收到此错误,则可以。
Command (m for help): p
Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-72937, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-72937, default 72937):
Using default value 72937
Command (m for help): p
Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5
Device Boot Start End Blocks Id System
/dev/sdb1 1 72937 585866421 83 Linux
Partition 1 does not start on physical sector boundary.
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders, total 1171743836 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5
Device Boot Start End Blocks Id System
/dev/sdb1 63 1171732904 585866421 83 Linux
Partition 1 does not start on physical sector boundary.
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders, total 1171743836 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 8
Value out of range.
Partition number (1-4): 1
First sector (63-1171743835, default 1024):
Using default value 1024
Last sector, +sectors or +size{K,M,G} (1024-1171743835, default 1171743835):
Using default value 1171743835
Command (m for help): p
Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders, total 1171743836 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5
Device Boot Start End Blocks Id System
/dev/sdb1 1024 1171743835 585871406 83 Linux
Command (m for help): w
The partition table has been altered!
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
257534 次 |
最近记录: |