Skip to content

Instantly share code, notes, and snippets.

@ayuLiao
Created January 3, 2019 01:59
Show Gist options
  • Select an option

  • Save ayuLiao/bc35362c8080397255b3a2f3142d3607 to your computer and use it in GitHub Desktop.

Select an option

Save ayuLiao/bc35362c8080397255b3a2f3142d3607 to your computer and use it in GitHub Desktop.
Linux查看分区、磁盘空间大小
# 查看磁盘的使用情况以及文件系统被挂载的位置
df -lh
Filesystem 容量 已用 可用 已用% 挂载点
/dev/hda8 11G 6.0G 4.4G 58% /
# 列出机器中所有磁盘的个数,也能列出所有磁盘分区情况
fdisk -l
# 磁盘信息
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xacc9d575
# 该磁盘对应的分区信息
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 2115 16777216 82 Linux swap / Solaris
/dev/sda3 2115 36405 275438592 8e Linux LVM
# 分区的具体信息
Disk /dev/mapper/VolGroup-LogVol00: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-LogVol01: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-LogVol02: 121.0 GB, 120984698880 bytes
255 heads, 63 sectors/track, 14708 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment