查看linux 4k对齐,linux查看硬盘4K对齐方法

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

大容量硬盘可能存在4k分区对齐的问题,对于传统MBR分区,可以使用 fdisk -lu 命令查看

[root@localhost ~]# fdisk -lu /dev/sda

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes

255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors

Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 63 102398309 51199123+ fd ext3

/dev/sda2 102398310 106494884 2048287+ fd ext3

/dev/sda3 106494885 2136644999 1015075057+ fd ext3

/dev/sda4 2136645000 3907024064 885189532+ fd ext3

start开始的扇区能不被8整除,就表示没有4k对齐了。

[root@localhost ~]# fdisk -lu /dev/sda

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes

255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors

Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 2048 102398309 51199123+ fd ext3

/dev/sda2 102398310 106494884 2048287+ fd ext3

/dev/sda3 106494885 2136644999 1015075057+ fd ext3

/dev/sda4 2136645000 3907024064 885189532+ fd ext3

start开始的扇区能被8整除,就表示4k对齐了。

早期的Linux下分区命令fdisk或者parted 由于版本较低,不支持4k分区对齐,请使用较新的Linux发行版,比如Linpus Lite 2.1等,

都不存在这个问题。

对于GPT分区,可以使用parted /dev/sda unit s print来查看。

[root@localhost ~]# parted /dev/sda unit s print

Model: ATA WDC WD20EARX-00P (scsi)

Disk /dev/sda: 3907029167s

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Number Start End Size Type File system Flags

1 63s 102398309s 102398247s primary ext3 boot

2 102398310s 106494884s 4096575s primary linux-swap

3 106494885s 2136644999s 2030150115s primary ext3

4 2136645000s 3907024064s 1770379065s primary ext3

start开始的扇区能不被8整除,就表示没有4k对齐了。

[root@localhost ~]# parted /dev/sda unit s print

Model: ATA WDC WD20EARX-00P (scsi)

Disk /dev/sda: 3907029167s

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Number Start End Size Type File system Flags

1 2048s 102398309s 102398247s primary ext3 boot

2 102398310s 106494884s 4096575s primary linux-swap

3 106494885s 2136644999s 2030150115s primary ext3

4 2136645000s 3907024064s 1770379065s primary ext3

start开始的扇区能被8整除,就表示4k对齐了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值