ZFS分区扩容

ZFS分区扩容

使用虚拟机时需要进行磁盘的动态扩容

  1. 扩容本地分区
# 查看磁盘分区情况
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0   120G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/grub
│                                /boot/efi
├─sda2   8:2    0     2G  0 part [SWAP]
├─sda3   8:3    0     2G  0 part 
└─sda4   8:4    0 65.5G  0 part 
# 扩容sda4
# parted /dev/sda resizepart 4 100%
# partprobe
  1. 扩容zpool
    查看zpool状态,得到zpool名称以及加入到zpool的硬盘名称:
root@mint-vm:/home/mint# zpool status
  pool: bpool
 state: ONLINE
config:

	NAME                                    STATE     READ WRITE CKSUM
	bpool                                   ONLINE       0     0     0
	  c93fe93f-09d3-6245-aafb-7d6ad98fbd05  ONLINE       0     0     0

errors: No known data errors

  pool: rpool
 state: ONLINE
config:

	NAME                                    STATE     READ WRITE CKSUM
	rpool                                   ONLINE       0     0     0
	  4af7ba7e-639e-b841-9306-c7edb9c55c0a  ONLINE       0     0     0

errors: No known data errors

得到zpool的名称为rpool, 当前挂载的硬盘为4af7ba7e-639e-b841-9306-c7edb9c55c0a.

然后执行扩容命令:

# zpool online -e rpool 4af7ba7e-639e-b841-9306-c7edb9c55c0a
posted @ 2022-08-28 23:34  main_c  阅读(622)  评论(0编辑  收藏  举报