[root@localhost ~]# partx --help
Usage:
partx [-a|-d|-s|-u] [--nr <n:m> | <partition>] <disk>
Options:
-a, --add add specified partitions or all of them
-d, --delete delete specified partitions or all of them
-s, --show list partitions
-u, --update update specified partitions or all of them
-b, --bytes print SIZE in bytes rather than in human readable format
-g, --noheadings don't print headings for --show
-n, --nr <n:m> specify the range of partitions (e.g. --nr 2:4)
-o, --output <type> define which output columns to use
-P, --pairs use key="value" output format
-r, --raw use raw output format
-t, --type <type> specify the partition type (dos, bsd, solaris, etc.)
-v, --verbose verbose mode
-h, --help display this help and exit
-V, --version output version information and exit
Available columns (for --show, --raw or --pairs):
NR partition number
START start of the partition in sectors
END end of the partition in sectors
SECTORS number of sectors
SIZE human readable size
NAME partition name
UUID partition UUID
TYPE partition type hex or uuid
FLAGS partition flags
SCHEME partition table type (dos, gpt, ...)
For more details see partx(8).
1234
partx命令:
-a 设备: 登记某块盘上的所有分区信息。如果分区信息有记录,则报错。
-d 设备: 删除内核中关于某磁盘的所有分区的记录。(不是卸载)
-s 设备 :显示磁盘的分区信息
通过partx工具让内核重读磁盘分区表信息:
1234567
partx -d /dev/sdb #因为内核中存在部分未调整磁盘的信息,故先将所有信息清零
partx -a /dev/sdb #添加调整后的磁盘分区信息
partx -s /dev/sdb #显示磁盘分区信息
NR START END SECTORS SIZE NAME UUID
1 2048 2099199 2097152 1G
2 2099200 419430399 417331200 199G