sudo gdisk /dev/vdb
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries.
Command (? for help): ?
b back up GPT data to a file
c change a partition's name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition's type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)? print this menu
Command (? for help): n
Partition number (1-128, default 1): 1First sector (34-10485726, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-10485726, default = 10485726) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/vdb.
The operation has completed successfully.
❯ sudo vgdisplay test-pv-1
--- Volume group ---
VG Name test-pv-1
System ID
Format lvm2
Metadata Areas 1 Metadata Sequence No 1 VG Access read/write
VG Status resizable
MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 4.98 GiB
PE Size 16.00 MiB
Total PE 319 Alloc PE / Size 0 / 0 Free PE / Size 319 / 4.98 GiB
VG UUID 1LkB0A-Perm-1vIV-NsMr-DjSc-Cww0-BB7XsY
❯ sudo lvdisplay
--- Logical volume ---
LV Path /dev/test-pv-1/test-lv
LV Name test-lv
VG Name test-pv-1
LV UUID T0V5dm-tnLT-EpyZ-LnWM-FSfL-u2r1-xzZ2cs
LV Write Access read/write
LV Creation host, time pollochangVM, 2022-09-20 23:37:16 +0800
LV Status available
# open 0 LV Size 4.98 GiB
Current LE 319 Segments 1 Allocation inherit
Read ahead sectors auto
- currently set to 256 Block device 253:0
執行分割
1
sudo mkfs.ext4 /dev/test-pv-1/test-lv
執行結果
1
2
3
4
5
6
7
8
9
10
11
$ sudo mkfs.ext4 /dev/test-pv-1/test-lv
mke2fs 1.44.5 (15-Dec-2018)Creating filesystem with 1306624 4k blocks and 327040 inodes
Filesystem UUID: 9d305794-a97f-46a8-b484-6a59748915d7
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736Allocating group tables: doneWriting inode tables: doneCreating journal (16384 blocks): doneWriting superblocks and filesystem accounting information: done