general/other How to have FreeBSD recognize an increased drive size on GCE

Hello.

I have installed FreeBSD 12.2 on GCE using the template. For some reason, I could not make any adjustments to the server configuration without it returning a JSON error. So I created the standard configuration and swapped out the boot drive for a larger SSD drive (https://stackoverflow.com/questions...e-compute-cloud-server-to-ssd-persistent-disk).

Inspecting this new drive it does not show the actual size.

[FONT=courier new]df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/gpt/rootfs 20G 7.0G 12G 37% /
devfs 1.0K 1.0K 0B 100% /dev[/FONT]

The GCE console shows the drive state

Boot disk​

NameImageSize (GB)Device nameTypeEncryptionModeWhen deleting instance
freebsd-12-2-ssd-server-10-30freebsd-12-2-server-10SSD persistent diskGoogle managedBoot, read/writeKeep disk

Anyone know how I can get FreeBSD to recognize the new drive specs?
 

So, I've followed the instructions there, and have been thwarted at the last step!


[FONT=courier new]$ sudo growfs /dev/da0p4
It's strongly recommended to make a backup before growing the file system.
OK to grow filesystem on /dev/da0p4 from 21GB to 29GB? [yes/no] yes
growfs: /dev/da0p4: Operation not permitted

$ gpart show da0
=> 3 62914549 da0 GPT (30G)
3 111 1 freebsd-boot (56K)
114 1600 2 efi (800K)
1714 2097152 3 freebsd-swap (1.0G)
2098866 60815686 4 freebsd-ufs (29G)

$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/gpt/rootfs 20G 7.0G 12G 37% /
devfs 1.0K 1.0K 0B 100% /dev[/FONT]

[FONT=arial]Any ideas?[/FONT]
 
Awesome! Thank you for the link.

[FONT=courier new]sudo growfs /[/FONT]

worked!

[FONT=courier new]$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/gpt/rootfs 28G 7.0G 19G 27% /
devfs 1.0K 1.0K 0B 100% /dev[/FONT]
 
Back
Top