online resizing NVME drives?

John Nielsen lists at jnielsen.net
Tue Apr 2 20:10:31 UTC 2019


Hi all-

Obviously this wouldn't make sense for physical NVME hardware, but when running on e.g. bhyve or AWS EC2 it's nice to be able to resize volumes and filesystems without needing to reboot the (virtual) system. I'm pretty sure that's do-able with SCSI, AHCI SATA and virtio-block devices but I don't see a way to do it with NVME. Am I missing something or do we need to implement something along the lines of "nvmecontrol rescan"?

I'm experimenting with FreeBSD 12.0-RELEASE on a c5n.large AWS ec2 instance. Like most (all?) of the c5 instance types the disks are all presented as NVME devices even if they are actually backed by EBS. I started one instance with a 10GB root volume but then decided I wanted to make it bigger. I grew the volume on the AWS side no problem. When I did so I got this kernel message:
nvme0: async event occurred (type 0x2, info 0x00, page 0x00)

Thereafter running "nvmecontrol devlist" correctly showed the increased size of the parent device:
# nvmecontrol devlist
 nvme0: Amazon Elastic Block Store
    nvme0ns1 (25600MB)

However I couldn't see a way to update the size of the nvd0 block device without rebooting. Pointers appreciated. Thanks!

JN



More information about the freebsd-hackers mailing list