磁盤 /dev/sda:53.7 GB, 53687091200 字節(jié),104857600 個扇區(qū)
Units = 扇區(qū) of 1 * 512 = 512 bytes
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
磁盤標(biāo)簽類型:dos
磁盤標(biāo)識符:0x000cef83
設(shè)備 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 41943039 19921920 8e Linux LVM
磁盤 /dev/mapper/centos-root:18.2 GB, 18249416704 字節(jié),35643392 個扇區(qū)
Units = 扇區(qū) of 1 * 512 = 512 bytes
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
磁盤 /dev/mapper/centos-swap:2147 MB, 2147483648 字節(jié),4194304 個扇區(qū)
Units = 扇區(qū) of 1 * 512 = 512 bytes
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
[root@hadoop102 reliable]# pvcreate /dev/sda
Device /dev/sda excluded by a filter.
[root@hadoop102 reliable]# fdisk /dev/sda
歡迎使用 fdisk(util-linux 2.23.2)。
更改將停留在內(nèi)存中,直到您決定將更改寫入磁盤。
使用寫入命令前請三思。
命令(輸入 m 獲取幫助):p
磁盤 /dev/sda:53.7 GB, 53687091200 字節(jié),104857600 個扇區(qū)
Units = 扇區(qū) of 1 * 512 = 512 bytes
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
磁盤標(biāo)簽類型:dos
磁盤標(biāo)識符:0x000cef83
設(shè)備 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 41943039 19921920 8e Linux LVM
命令(輸入 m 獲取幫助):n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
分區(qū)號 (3,4,默認 3):3
起始 扇區(qū) (41943040-104857599,默認為 41943040):41943040
Last 扇區(qū), +扇區(qū) or +size{K,M,G} (41943040-104857599,默認為 104857599):104857599
分區(qū) 3 已設(shè)置為 Linux 類型,大小設(shè)為 30 GiB
命令(輸入 m 獲取幫助):p
磁盤 /dev/sda:53.7 GB, 53687091200 字節(jié),104857600 個扇區(qū)
Units = 扇區(qū) of 1 * 512 = 512 bytes
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
磁盤標(biāo)簽類型:dos
磁盤標(biāo)識符:0x000cef83
設(shè)備 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 41943039 19921920 8e Linux LVM
/dev/sda3 41943040 104857599 31457280 83 Linux
命令(輸入 m 獲取幫助):t
分區(qū)號 (1-3,默認 3):3
Hex 代碼(輸入 L 列出所有代碼):L
0 空 24 NEC DOS 81 Minix / 舊 Linu bf Solaris
1 FAT12 27 隱藏的 NTFS Win 82 Linux 交換 / So c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 84 OS/2 隱藏的 C: c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 85 Linux 擴展 c7 Syrinx
5 擴展 41 PPC PReP Boot 86 NTFS 卷集 da 非文件系統(tǒng)數(shù)據(jù)
6 FAT16 42 SFS 87 NTFS 卷集 db CP/M / CTOS / .
7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux 純文本 de Dell 工具
8 AIX 4e QNX4.x 第2部分 8e Linux LVM df BootIt
9 AIX 可啟動 4f QNX4.x 第3部分 93 Amoeba e1 DOS 訪問
a OS/2 啟動管理器 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad 休 eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
f W95 擴展 (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC
11 隱藏的 FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
12 Compaq 診斷 5c Priam Edisk a9 NetBSD f4 SpeedStor
14 隱藏的 FAT16 <3 61 SpeedStor ab Darwin 啟動 f2 DOS 次要
16 隱藏的 FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
17 隱藏的 HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST 智能睡眠 65 Novell Netware b8 BSDI swap fd Linux raid 自動
1b 隱藏的 W95 FAT3 70 DiskSecure 多啟 bb Boot Wizard 隱 fe LANstep
1c 隱藏的 W95 FAT3 75 PC/IX be Solaris 啟動 ff BBT
1e 隱藏的 W95 FAT1 80 舊 Minix
Hex 代碼(輸入 L 列出所有代碼):L
Hex 代碼(輸入 L 列出所有代碼):8e
已將分區(qū)“Linux”的類型更改為“Linux LVM”
命令(輸入 m 獲取幫助):p
磁盤 /dev/sda:53.7 GB, 53687091200 字節(jié),104857600 個扇區(qū)
Units = 扇區(qū) of 1 * 512 = 512 bytes
扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)
I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)
磁盤標(biāo)簽類型:dos
磁盤標(biāo)識符:0x000cef83
設(shè)備 Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 41943039 19921920 8e Linux LVM
/dev/sda3 41943040 104857599 31457280 8e Linux LVM
命令(輸入 m 獲取幫助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 設(shè)備或資源忙.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
正在同步磁盤。
[root@hadoop102 reliable]# pvcreate /dev/sda3
Device /dev/sda3 not found.
[root@hadoop102 reliable]# pvcreate /dev/sda3
Device /dev/sda3 not found.
[root@hadoop102 reliable]# reboot
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(hadoop102) at 23:01:54.
Type `help' to learn how to use Xshell prompt.
[d:\~]$
Connecting to 192.168.10.102:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Sun Oct 10 22:47:45 2021 from 192.168.10.1
[reliable@hadoop102 ~]$ su root
密碼:
[root@hadoop102 reliable]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created.
[root@hadoop102 reliable]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size <19.00 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4863
Free PE 0
Allocated PE 4863
PV UUID 22vpSH-n99s-ZRrF-H0te-TVY8-x9j5-cQLjPU
"/dev/sda3" is a new physical volume of "30.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sda3
VG Name
PV Size 30.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID GBPZg0-Gqbf-vzmW-3k7G-RwF0-0yKc-bwZ9bo
[root@hadoop102 reliable]# vgextend centos /dev/sda3
Volume group "centos" successfully extended
[root@hadoop102 reliable]# lvextend -l +100%FREE /dev/mapper/centos-root
Size of logical volume centos/root changed from <17.00 GiB (4351 extents) to 46.99 GiB (12030 extents).
Logical volume centos/root successfully resized.
[root@hadoop102 reliable]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=1113856 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=4455424, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 4455424 to 12318720
[root@hadoop102 reliable]# df -h
文件系統(tǒng) 容量 已用 可用 已用% 掛載點
devtmpfs 470M 0 470M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.3M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/mapper/centos-root 47G 15G 33G 32% /
/dev/sda1 976M 142M 768M 16% /boot
tmpfs 98M 8.0K 98M 1% /run/user/42
tmpfs 98M 0 98M 0% /run/user/1000
[root@hadoop102 reliable]#
文章來源:https://www.cnblogs.com/rainbow-1/archive/2021/10/10/15391407.html
聯(lián)系客服