df -h
-a, --all include dummy file systems
-B, --block-size=SIZE scale sizes by SIZE before printing them; e.g.,
‘-BM‘ prints sizes in units of 1,048,576 bytes;
see SIZE format below
--direct show statistics for a file instead of mount point
--total produce a grand total
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
-H, --si likewise, but use powers of 1000 not 1024
-i, --inodes list inode information instead of block usage
-k like --block-size=1K
-l, --local limit listing to local file systems
--no-sync do not invoke sync before getting usage info (default)
--output[=FIELD_LIST] use the output format defined by FIELD_LIST,
or print all fields if FIELD_LIST is omitted.
-P, --portability use the POSIX output format
--sync invoke sync before getting usage info
-t, --type=TYPE limit listing to file systems of type TYPE
-T, --print-type print file system type
-x, --exclude-type=TYPE limit listing to file systems not of type TYPE

fdisk -l
Usage:
fdisk [options] <disk> change partition table
fdisk [options] -l <disk> list partition table(s)
fdisk -s <partition> give partition size(s) in blocks
Options:
-b <size> sector size (512, 1024, 2048 or 4096)
-c[=<mode>] compatible mode: ‘dos‘ or ‘nondos‘ (default)
-h print this help text
-u[=<unit>] display units: ‘cylinders‘ or ‘sectors‘ (default)
-v print program version
-C <number> specify the number of cylinders
-H <number> specify the number of heads
-S <number> specify the number of sectors per track

新增拓展磁盘


查看磁盘分区状态
fdisk -l

说明:
第一块磁盘叫sda
有两个分区 sda1和sda2
s:接口,例如ssd,scsi,sata d代表disk磁盘 a:第一块 123:第几个分区
fdisk /dev/sda


虚拟机新增硬盘:




系统内添加磁盘
fdisk -l
fdisk /dev/sdb

shell mkfs.ext4 /dev/sdb1 
mkdir -p /opt/sdb1
mount /dev/sdb1 /opt/sdb1
查看挂载情况

卸载
umount /opt

原文:https://www.cnblogs.com/yin1361866686/p/11685282.html