[root@node1 ~]# fdisk /dev/sda
Welcome to fdisk(util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m forhelp): n
Partition type
p primary (0 primary, 0 extended, 4free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P}(2048-41943039, default 41943039): +2G
Created a new partition 1 of type'Linux' and of size 2 GiB.
Partition #1 contains a xfs signature.
Do you want to remove the signature? [Y]es/[N]o: YES^H^H^H^H^H^H^H^H^H
The signature will be removed by a write command.
Command (m forhelp): Print
P: unknown command
Command (m forhelp): print
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512=512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x962ab0e1
Device Boot Start End Sectors Size Id Type
/dev/sda1 204841963514194304 2G 83 Linux
Filesystem/RAID signature on partition 1 will be wiped.
Command (m forhelp): n
Partition type
p primary (1 primary, 0 extended, 3free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2):
First sector (4196352-41943039, default 4196352):
Last sector, +sectors or +size{K,M,G,T,P}(4196352-41943039, default 41943039): +3G
Created a new partition 2 of type'Linux' and of size 3 GiB.
Command (m forhelp): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 ~]# mkfs.ext4 /dev/vg02/lv02 mke2fs1.44.3 (10-July-2018)
Creating filesystem with 153600 4k blocks and 38400 inodes
Filesystem UUID: f6b201b7-6674-4a31-ba7a-1e97cf2ed35c
Superblock backups stored on blocks:
32768, 98304
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done[root@node1 ~]#
2.永久挂载
# # /etc/fstab# Created by anaconda on Fri Mar 19 22:21:55 2021## Accessible filesystems, by reference, are maintained under '/dev/disk/'.# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.## After editing this file, run 'systemctl daemon-reload' to update systemd# units generated from this file.#UUID=b7190d80-906f-4b9d-9ab4-5a503ecaea2c / xfs defaults 00UUID=525a30a7-d484-4ed5-9f38-f827f54e29ff /boot xfs defaults 00UUID=e6cf8733-5eec-4942-9429-c3e9087b6ff0 swap swap defaults 00UUID="deff8218-3389-4245-a6bf-1716010fd6d4" /mnt/lv01 xfs defaults 00UUID=7b7937af-408b-4370-9bd9-baa0cb5d1c6b swap swap defaults 00UUID="c4477c1b-5ce7-4257-a44f-5e43e1d2a18e" /mnt/vdb3 xfs defaults 00UUID="f6b201b7-6674-4a31-ba7a-1e97cf2ed35c" /mnt/lv02 ext4 defaults 00
[root@node1 ~]# mount -a[root@node1 ~]# df -h /dev/vg02/lv02
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg02-lv02 575M 912K 532M 1% /mnt/lv02
[root@node1 ~]#
Linux系统之创建逻辑卷一、磁盘分区二、创建PV物理卷三、创建卷组,指定PE大小为12M四、创建逻辑卷,大小50个PE五、格式化逻辑卷,并挂载1.格式化逻辑卷2.永久挂载一、磁盘分区[root@node1 ~]# fdisk /dev/sdaWelcome to fdisk (util-linux 2.32.1).Changes will remain in memory only, until you decide to write them.Be careful before using