[root@localhost ~]# mdadm -Cv /dev/md0 -l 1 -n 2 /dev/vdb /dev/vdc mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 mdadm: size set to 104791040K Continue creating array [y/N]? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started.
Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
# 查看分区列表,避免操作错误,需要操作的分区为/dev/nvme0n1p3 Command (m forhelp): p Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors Disk model: ZHITAI TiPlus5000 1TB 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: gpt Disk identifier: 3B382909-55C1-4536-8987-4B17033FF653
Device Start End Sectors Size Type /dev/nvme0n1p1 34 2047 2014 1007K BIOS boot /dev/nvme0n1p2 2048 2099199 2097152 1G EFI System /dev/nvme0n1p3 2099200 419430400 417331201 199G Solaris /usr & Apple ZFS
# 删除分区3 Command (m forhelp): d Partition number (1-3, default 3):
Partition 3 has been deleted.
Command (m forhelp): p Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors Disk model: ZHITAI TiPlus5000 1TB 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: gpt Disk identifier: 3B382909-55C1-4536-8987-4B17033FF653
Device Start End Sectors Size Type /dev/nvme0n1p1 34 2047 2014 1007K BIOS boot /dev/nvme0n1p2 2048 2099199 2097152 1G EFI System
# 新建一个500G的分区 Command (m forhelp): n Partition number (3-128, default 3): First sector (2099200-2000409230, default 2099200): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2099200-2000409230, default 2000408575): +500G
Created a new partition 3 of type'Linux filesystem' and of size 500 GiB.
Command (m forhelp): p Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors Disk model: ZHITAI TiPlus5000 1TB 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: gpt Disk identifier: 3B382909-55C1-4536-8987-4B17033FF653
Device Start End Sectors Size Type /dev/nvme0n1p1 34 2047 2014 1007K BIOS boot /dev/nvme0n1p2 2048 2099199 2097152 1G EFI System /dev/nvme0n1p3 2099200 1050675199 1048576000 500G Linux filesystem
# 修改分区类型为 Solaris /usr & Apple ZFS,编号157 Command (m forhelp): t Partition number (1-3, default 3): Partition type or alias (type L to list all): 157
Changed type of partition 'Linux filesystem' to 'Solaris /usr & Apple ZFS'.
Command (m forhelp): p Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors Disk model: ZHITAI TiPlus5000 1TB 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: gpt Disk identifier: 3B382909-55C1-4536-8987-4B17033FF653
Device Start End Sectors Size Type /dev/nvme0n1p1 34 2047 2014 1007K BIOS boot /dev/nvme0n1p2 2048 2099199 2097152 1G EFI System /dev/nvme0n1p3 2099200 1050675199 1048576000 500G Solaris /usr & Apple ZFS
# 保存修改 Command (m forhelp): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
# 检查添加的情况 root@pve:~# zpool status rpool pool: rpool state: ONLINE status: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete. scan: resilver in progress since Tue Dec 24 21:59:17 2024 37.8G / 37.8G scanned, 6.61G / 37.8G issued at 1.65G/s 6.66G resilvered, 17.52% done, 00:00:18 to go remove: Removal of vdev 1 copied 1.41M in 0h0m, completed on Tue Dec 24 21:58:01 2024 936 memory used for removed device mappings config: