CentOS7使用LVM扩容根目录

首先说下步骤,添加硬盘->硬盘分区->LVM->重新挂载

  • 硬盘分区
    gpt分区表使用parted,mbr分区表使用fdisk和parted均可。
  • LVM核心命令

    1
    2
    3
    4
    pvcreate /dev/sdb1 # 将/dev/sdb1创建成物理卷
    vgextend centos /dev/sdb1 # 将/dev/sdb1添加到centos卷组中
    lvextend -L +19.92G /dev/centos/root # 扩容/dev/centos/root逻辑卷19.92G
    lvextend -l +1 /dev/centos/root # 最后1PE(4MB)别浪费
  • 重新挂载

    1
    2
    resize2fs /dev/centos/root  # ext2/ext3/ext4文件系统使用这条命令
    xfs_growfs /dev/centos/root # xfs文件系统使用这条命令

扩容之前

在扩容之前,先查看下当前磁盘状况,只有sda这一块物理磁盘,根目录容量55G,准备添加一块20GB的sdb物理磁盘。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[root@localhost ~]# ls /dev
agpgart crash hugepages mcelog ptmx snapshot tty14 tty25 tty36 tty47 tty58 ttyS2 vcs4 vhost-net
autofs disk initctl mem pts snd tty15 tty26 tty37 tty48 tty59 ttyS3 vcs5 vmci
block dm-0 input midi random stderr tty16 tty27 tty38 tty49 tty6 uhid vcs6 vsock
bsg dm-1 kmsg mqueue raw stdin tty17 tty28 tty39 tty5 tty60 uinput vcsa zero
btrfs-control dmmidi kvm net rfkill stdout tty18 tty29 tty4 tty50 tty61 urandom vcsa1
bus dri log network_latency rtc tty tty19 tty3 tty40 tty51 tty62 usbmon0 vcsa2
centos fb0 loop-control network_throughput rtc0 tty0 tty2 tty30 tty41 tty52 tty63 usbmon1 vcsa3
char fd lp0 null sda tty1 tty20 tty31 tty42 tty53 tty7 usbmon2 vcsa4
console full lp1 nvram sda1 tty10 tty21 tty32 tty43 tty54 tty8 vcs vcsa5
core fuse lp2 oldmem sda2 tty11 tty22 tty33 tty44 tty55 tty9 vcs1 vcsa6
cpu hidraw0 lp3 port sg0 tty12 tty23 tty34 tty45 tty56 ttyS0 vcs2 vfio
cpu_dma_latency hpet mapper ppp shm tty13 tty24 tty35 tty46 tty57 ttyS1 vcs3 vga_arbiter
[root@localhost ~]# fdisk -l

磁盘 /dev/sda:64.4 GB, 64424509440 字节,125829120 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x0009869b

设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 125829119 61864960 8e Linux LVM

磁盘 /dev/mapper/centos-root:59.1 GB, 59051606016 字节,115335168 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节


磁盘 /dev/mapper/centos-swap:4294 MB, 4294967296 字节,8388608 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 55G 41G 15G 75% /
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 152K 3.9G 1% /dev/shm
tmpfs 3.9G 9.0M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 220M 795M 22% /boot
tmpfs 781M 12K 781M 1% /run/user/1000

添加物理磁盘

在VMWare 虚拟机->设置中添加一块20GB的SCSI物理磁盘

重启系统

重启系统后出现了/dev/sdb设备

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[root@localhost ~]# ls /dev
agpgart crash hugepages mcelog ptmx sg1 tty12 tty23 tty34 tty45 tty56 ttyS0 vcs2 vfio
autofs disk initctl mem pts shm tty13 tty24 tty35 tty46 tty57 ttyS1 vcs3 vga_arbiter
block dm-0 input midi random snapshot tty14 tty25 tty36 tty47 tty58 ttyS2 vcs4 vhost-net
bsg dm-1 kmsg mqueue raw snd tty15 tty26 tty37 tty48 tty59 ttyS3 vcs5 vmci
btrfs-control dmmidi kvm net rfkill stderr tty16 tty27 tty38 tty49 tty6 uhid vcs6 vsock
bus dri log network_latency rtc stdin tty17 tty28 tty39 tty5 tty60 uinput vcsa zero
centos fb0 loop-control network_throughput rtc0 stdout tty18 tty29 tty4 tty50 tty61 urandom vcsa1
char fd lp0 null sda tty tty19 tty3 tty40 tty51 tty62 usbmon0 vcsa2
console full lp1 nvram sda1 tty0 tty2 tty30 tty41 tty52 tty63 usbmon1 vcsa3
core fuse lp2 oldmem sda2 tty1 tty20 tty31 tty42 tty53 tty7 usbmon2 vcsa4
cpu hidraw0 lp3 port sdb tty10 tty21 tty32 tty43 tty54 tty8 vcs vcsa5
cpu_dma_latency hpet mapper ppp sg0 tty11 tty22 tty33 tty44 tty55 tty9 vcs1 vcsa6
[root@localhost ~]# fdisk -l

磁盘 /dev/sda:64.4 GB, 64424509440 字节,125829120 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x0009869b

设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 125829119 61864960 8e Linux LVM

磁盘 /dev/sdb:21.5 GB, 21474836480 字节,41943040 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节


磁盘 /dev/mapper/centos-root:59.1 GB, 59051606016 字节,115335168 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节


磁盘 /dev/mapper/centos-swap:4294 MB, 4294967296 字节,8388608 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 55G 41G 15G 75% /
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 152K 3.9G 1% /dev/shm
tmpfs 3.9G 9.0M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 220M 795M 22% /boot
tmpfs 781M 8.0K 781M 1% /run/user/1000

磁盘分区

使用parted对/dev/sdb分区

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
[root@localhost ~]# parted
GNU Parted 3.1
使用 /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a particular
partition
quit exit program
rescue START END rescue a lost partition near START and END
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information of GNU Parted
(parted) select /dev/sdb
使用 /dev/sdb
(parted) print
错误: /dev/sdb: unrecognised disk label
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
(parted) prin all
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system 标志
1 1049kB 1075MB 1074MB primary xfs 启动
2 1075MB 64.4GB 63.3GB primary lvm


错误: /dev/sdb: unrecognised disk label
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-swap: 4295MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system 标志
1 0.00B 4295MB 4295MB linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-root: 59.1GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system 标志
1 0.00B 59.1GB 59.1GB xfs


(parted) mklabel
新的磁盘标签类型? gpt
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name 标志

(parted) mkpart iphpjs 1 21400
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name 标志
1 1049kB 21.4GB 21.4GB iphpjs

(parted) quit
信息: You may need to update /etc/fstab.

分完区后查看信息,出现了/dev/sdb1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[root@localhost ~]# ls /dev
agpgart crash hugepages mcelog ptmx sg0 tty11 tty22 tty33 tty44 tty55 tty9 vcs1 vcsa6
autofs disk initctl mem pts sg1 tty12 tty23 tty34 tty45 tty56 ttyS0 vcs2 vfio
block dm-0 input midi random shm tty13 tty24 tty35 tty46 tty57 ttyS1 vcs3 vga_arbiter
bsg dm-1 kmsg mqueue raw snapshot tty14 tty25 tty36 tty47 tty58 ttyS2 vcs4 vhost-net
btrfs-control dmmidi kvm net rfkill snd tty15 tty26 tty37 tty48 tty59 ttyS3 vcs5 vmci
bus dri log network_latency rtc stderr tty16 tty27 tty38 tty49 tty6 uhid vcs6 vsock
centos fb0 loop-control network_throughput rtc0 stdin tty17 tty28 tty39 tty5 tty60 uinput vcsa zero
char fd lp0 null sda stdout tty18 tty29 tty4 tty50 tty61 urandom vcsa1
console full lp1 nvram sda1 tty tty19 tty3 tty40 tty51 tty62 usbmon0 vcsa2
core fuse lp2 oldmem sda2 tty0 tty2 tty30 tty41 tty52 tty63 usbmon1 vcsa3
cpu hidraw0 lp3 port sdb tty1 tty20 tty31 tty42 tty53 tty7 usbmon2 vcsa4
cpu_dma_latency hpet mapper ppp sdb1 tty10 tty21 tty32 tty43 tty54 tty8 vcs vcsa5


[root@localhost ~]# fdisk -l

磁盘 /dev/sda:64.4 GB, 64424509440 字节,125829120 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x0009869b

设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 125829119 61864960 8e Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sdb:21.5 GB, 21474836480 字节,41943040 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:gpt


# Start End Size Type Name
1 2048 41797631 20G Microsoft basic iphpjs

磁盘 /dev/mapper/centos-root:59.1 GB, 59051606016 字节,115335168 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节


磁盘 /dev/mapper/centos-swap:4294 MB, 4294967296 字节,8388608 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节




磁盘 /dev/mapper/centos-swap:4294 MB, 4294967296 字节,8388608 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 55G 41G 15G 75% /
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 152K 3.9G 1% /dev/shm
tmpfs 3.9G 9.0M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 220M 795M 22% /boot
tmpfs 781M 8.0K 781M 1% /run/user/1000

进行LVM扩容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
[root@localhost ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
[root@localhost ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size <59.00 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 15103
Free PE 0
Allocated PE 15103
PV UUID Q2KYKU-7yJa-N4Qi-0IEL-CFPX-3lBg-EztskM

"/dev/sdb1" is a new physical volume of "<19.93 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size <19.93 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 3opuvn-oU3B-T7x1-kMrG-pt3U-DxR5-Lqge6g

[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <59.00 GiB
PE Size 4.00 MiB
Total PE 15103
Alloc PE / Size 15103 / <59.00 GiB
Free PE / Size 0 / 0
VG UUID z1eVJE-0E2P-8jCe-C0Tm-tIaH-dpnk-TFfBdf

[root@localhost ~]# vgextend centos /dev/sdb1
Volume group "centos" successfully extended
[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 78.92 GiB
PE Size 4.00 MiB
Total PE 20204
Alloc PE / Size 15103 / <59.00 GiB
Free PE / Size 5101 / <19.93 GiB
VG UUID z1eVJE-0E2P-8jCe-C0Tm-tIaH-dpnk-TFfBdf

[root@localhost ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID SeObTH-BF42-XhY1-e53R-NxUt-o1yV-kVeFV9
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2016-10-14 00:43:28 +0800
LV Status available
# open 2
LV Size 4.00 GiB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1

--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID juerks-fiL7-I0FN-BwY5-riNL-kwDY-n3LBkw
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2016-10-14 00:43:28 +0800
LV Status available
# open 1
LV Size <55.00 GiB
Current LE 14079
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0

[root@localhost ~]# lvextend -L +19.92G /dev/centos/root
Rounding size to boundary between physical extents: 19.92 GiB.
Size of logical volume centos/root changed from <55.00 GiB (14079 extents) to <74.92 GiB (19179 extents).
Logical volume centos/root successfully resized.

[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 78.92 GiB
PE Size 4.00 MiB
Total PE 20204
Alloc PE / Size 20203 / <78.92 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID z1eVJE-0E2P-8jCe-C0Tm-tIaH-dpnk-TFfBdf

[root@localhost ~]# lvextend -l +1 /dev/centos/root # 最后1PE(4MB)别浪费
Size of logical volume centos/root changed from <74.92 GiB (19179 extents) to 74.92 GiB (19180 extents).
Logical volume centos/root successfully resized.
[root@localhost ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 78.92 GiB
PE Size 4.00 MiB
Total PE 20204
Alloc PE / Size 20204 / 78.92 GiB
Free PE / Size 0 / 0
VG UUID z1eVJE-0E2P-8jCe-C0Tm-tIaH-dpnk-TFfBdf

LVM扩容完成后,发现逻辑卷已经变大了,但挂载点并没有变大

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[root@localhost ~]# fdisk -l

磁盘 /dev/sda:64.4 GB, 64424509440 字节,125829120 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x0009869b

设备 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 125829119 61864960 8e Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sdb:21.5 GB, 21474836480 字节,41943040 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:gpt


# Start End Size Type Name
1 2048 41797631 20G Microsoft basic iphpjs

磁盘 /dev/mapper/centos-root:80.4 GB, 80446750720 字节,157122560 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节


磁盘 /dev/mapper/centos-swap:4294 MB, 4294967296 字节,8388608 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

重新挂载磁盘

重新挂载磁盘后根分区已经成功扩容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@localhost ~]# xfs_growfs  /dev/centos/root 
meta-data=/dev/mapper/centos-root isize=256 agcount=4, agsize=3604224 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=14416896, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=7039, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 14416896 to 19640320
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 75G 41G 34G 55% /
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 152K 3.9G 1% /dev/shm
tmpfs 3.9G 9.0M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 220M 795M 22% /boot
tmpfs 781M 8.0K 781M 1% /run/user/1000