Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
root@nucklehead:~ # cbsd bstop controller-0
Send SIGTERM to controller-0. Soft timeout is 30 sec. 0 seconds left [..............................]
bstop done in 5 seconds
root@nucklehead:~ # cbsd bhyve-dsk controller-0 mode=list
JNAME DSK_CONTROLLER DSK_PATH DSK_SIZE DSK_SECTORSIZE BOOTABLE
ubuntu-base virtio-blk dsk1.vhd 10g 512/4096 true
controller-0 virtio-blk dsk1.vhd 10g 512/4096 true
controller-1 virtio-blk dsk1.vhd 10g 512/4096 true
controller-2 virtio-blk dsk1.vhd 30g 512/4096 true
worker-0 virtio-blk dsk1.vhd 10g 512/4096 true
worker-1 virtio-blk dsk1.vhd 10g 512/4096 true
worker-2 virtio-blk dsk1.vhd 10g 512/4096 true
root@nucklehead:~ # cbsd bhyve-dsk mode=modify jname=controller-0 dsk_controller=virtio-blk dsk_path=dsk1.vhd dsk_size=30g
resize zroot/ROOT/default/controller-0/dsk1.vhd up to 32212287488
modify_dsk_size: volume size increased by: 20g
dsk_size: changed
root@nucklehead:~ # zfs get volsize zroot/ROOT/default/controller-0/dsk1.vhd
NAME PROPERTY VALUE SOURCE
zroot/ROOT/default/controller-0/dsk1.vhd volsize 30.0G local
root@nucklehead:~ # gpart list | grep dsk1.vhd
Geom name: zvol/zroot/ROOT/default/controller-0/dsk1.vhd
1. Name: zvol/zroot/ROOT/default/controller-0/dsk1.vhdp1
2. Name: zvol/zroot/ROOT/default/controller-0/dsk1.vhdp2
1. Name: zvol/zroot/ROOT/default/controller-0/dsk1.vhd
root@nucklehead:~ # gpart show zvol/zroot/ROOT/default/controller-0/dsk1.vhd
=> 40 62914544 zvol/zroot/ROOT/default/controller-0/dsk1.vhd GPT (30G)
40 2008 - free - (1.0M)
2048 1048576 1 efi (512M)
1050624 19921119 2 linux-data (9.5G)
20971743 41942841 - free - (20G)
root@nucklehead:~ # gpart resize -i 2 zvol/zroot/ROOT/default/controller-0/dsk1.vhd
zvol/zroot/ROOT/default/controller-0/dsk1.vhdp2 resized
root@nucklehead:~ # gpart show zvol/zroot/ROOT/default/controller-0/dsk1.vhd
=> 40 62914544 zvol/zroot/ROOT/default/controller-0/dsk1.vhd GPT (30G)
40 2008 - free - (1.0M)
2048 1048576 1 efi (512M)
1050624 61863936 2 linux-data (29G)
62914560 24 - free - (12K)
root@nucklehead:~ # cbsd bstart controller-0
cloud-init: enabled
VRDP is enabled. VNC bind/port: 192.168.0.9:5901
For attach VM console, use: vncviewer 192.168.0.9:5901
Resolution: 1024x768.
em0
bhyve renice: 1
Execute master script: cloud_init_set_netname.sh
:: /usr/cbsd/jails-system/controller-0/master_prestart.d/cloud_init_set_netname.sh
Waiting for PID.
PID: 78041
CBSD setup: bhyve ipfw counters num: 99/102
root@nucklehead:~ # ssh -i ~cbsd/.ssh/id_rsa ubuntu@controller-0
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-54-generic x86_64)
[...]
ubuntu@controller-0:~$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda2 9738656 9722272 0 100% /
ubuntu@controller-0:~$ sudo resize2fs /dev/vda2
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/vda2 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 4
The filesystem on /dev/vda2 is now 7732992 (4k) blocks long.
ubuntu@controller-0:~$ df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda2 30380996 9730476 19297372 34% /
ubuntu@controller-0:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment