Firstboot-growfs does not growfs after touching /firstboot

29 views
Skip to first unread message

Andrew Villano

unread,
May 27, 2019, 2:07:24 PM5/27/19
to Vagrant
I've used Firstboot-growfs a few times and it usually goes without a snag. I touch /firstboot, reboot the box and when it comes back up it resizes the partition and resizes the filesystem.

I've just spun up a FreeBSD 12 box, 
[vagrant@freebsd ~]$ freebsd-version
12.0-RELEASE-p5

I was able to resize the VMDK (by converting it to a VDI.. etc)

3. Name: ada0p3
   Mediasize: 32212254720 (30G)
<snip>
   type: freebsd-ufs
   index: 3
   end: 65011837
   start: 2097278
Consumers:
1. Name: ada0
   Mediasize: 157286400000 (146G)
   Sectorsize: 512
   Mode: r2w2e5

but I can't seem to get past this point. Nothing shows up in /var/log/messages or in dmesg to indicate that there was a failure. Strangely enough on reboot, the triggerfile /firstboot is gone as if to indicate something was done.


Thanks.

Dennis Chang

unread,
May 27, 2019, 2:36:01 PM5/27/19
to Vagrant
Hi Andrew,

Correct me if I'm wrong, but you expanded the VMDK to VDI from 30 GB to 146 GB using VBoxManage?
And then you wanted to use firstboot-growfs to reboot and reconfigure the disk (inside the OS) so that
FreeBSD can see the expanded disk?

I haven't used FreeBSD in a while but, if I'm not mistaken, if FreeBSD installer creates MBR partitions
on your disk, then FreeBSD also creates UFS slices within a partition. In this case, GrowFS would need
to expand both the partition (whether primary or logical) and the slices within it. If FreeBSD installer creates EFI
partitions, similarly, GrowFS would need to expand the EFI partition and the slices within it.

Given that you don't see anything in /var/log/messages, I would confirm the size of the partitions (through fdisk/sgdisk, or similar tools).

Andrew Villano

unread,
May 28, 2019, 9:51:16 AM5/28/19
to vagra...@googlegroups.com
That's correct, I expanded the VMDK to VDI using vboxmanage and I would like firstboot-growfs to reconfigure the disk inside the OS.

I confirmed that the size of the partitions is still 30GB using fdisk.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/uPBPVKz4CZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a064607c-fa5f-40b0-a6d6-dee9b440206b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dennis Chang

unread,
May 28, 2019, 11:25:02 AM5/28/19
to Vagrant
I don't know firstboot-growfs (or BSD very well), but my guess is that it applies to BSD slices and not partitions.

My advice to you is to investigate how to expand a partition in BSD. BSD uses similar tools as Linux (which I'm more familiar with),
for instance fdisk (for MBR partitions), or sgdisk (for EFI partitions). There should be a way to expand the partition (in a safe way).


Andrew Villano

unread,
May 29, 2019, 5:18:55 PM5/29/19
to vagra...@googlegroups.com
The way to grow a partition is to use growfs, however you cannot enlarge the root partition while it is in use. Usually this means going down to single user mode via a usb rescue image or the sort while having the root filesystem unmounting, resizing the partition with gparted/fdisk and then enlarging the filesystem with growfs. As these boxes are headless and do not have a console, it is not possible to do this. This is why the firstboot- packages exist, to do this on boot before the filesystem is mounted. However, it doesn't appear they are working as intended.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/uPBPVKz4CZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Dennis Chang

unread,
May 29, 2019, 5:26:07 PM5/29/19
to Vagrant
Vagrant may be headless, but you can get a console screen through Virtualbox.
Why not use Virtualbox to boot from an ISO and then you can make changes to the partitions?

Andrew Villano

unread,
May 30, 2019, 10:18:10 AM5/30/19
to vagra...@googlegroups.com
I connect to the machine in question over ssh. It is not local and does not run an X server AFAIK.

On Wed, May 29, 2019 at 5:26 PM Dennis Chang <dennis...@gmail.com> wrote:
Vagrant may be headless, but you can get a console screen through Virtualbox.
Why not use Virtualbox to boot from an ISO and then you can make changes to the partitions?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/uPBPVKz4CZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Dennis Chang

unread,
May 30, 2019, 10:48:42 AM5/30/19
to Vagrant
There is a way in Linux which allows you to rescan the scsi disk and modify the partition table while having booted from the disk/partition.
There might be a way to do the same in FreeBSD.


But I should state the obvious, this is not a vagrant problem.

Good luck
Reply all
Reply to author
Forward
0 new messages