[anaconda root@861767 ~]# lsblk /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 512M 0 part
└─sda2 8:2 0 465.3G 0 part
├─sys-root 253:2 0 10G 0 lvm
├─sys-var 253:3 0 4G 0 lvm
├─sys-tmp 253:4 0 4G 0 lvm
└─sys-home 253:5 0 447.3G 0 lvm
[anaconda root@861767 ~]# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.6
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB 0700
2 1050624 976773119 465.3 GiB 8E00
[anaconda root@861767 ~]# parted -s /dev/sda unit GB print
Model: ATA GB0500EAFYL (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 0.00GB 0.54GB 0.54GB ext4
2 0.54GB 500GB 500GB lvm
[anaconda root@861767 ~]# lsblk和gdisk报告磁盘大小为465.5G
哪一个是真的?为什么会有矛盾呢?
发布于 2016-04-20 23:23:22
磁盘制造商以1000倍的倍数刊登磁盘大小广告。也就是说,"KB“是1000,而不是1024,因为人们习惯于使用软件。
对您来说,似乎lsblk和gdisk使用的是1024值,而parted使用的是1000。
465.5 * 1024 * 1024 * 1024 == 499,826,819,072现在,分开:
499,826,819,072 / (1000 * 1000 * 1000) == 499.826,它映射到500,parted正在报告。
注意,lsblk和gdisk使用GiB,但是您将GB选项交给了parted。使用parted选项尝试GiB
https://serverfault.com/questions/771832
复制相似问题