Adding a swap partition to the March 5 snapshot image
Carl Johnson
carlj at peak.org
Fri Mar 6 17:19:31 UTC 2020
bob prohaska <fbsd at www.zefox.net> writes:
> I've been trying for a while to set up an armv7 RPI2 with a single
> root partition plus a swap partition at the end of mmcsd0. Letting
> firstboot invoke growfs seems not to help, since growfs leaves no
> space for swap.
>
> Attempts using gpart in single-user give the appearance of
> working, but on reboot the machine stops at the mountroot prompt.
> This method worked well in July of 2018. Seemingly, no more.
>
> Has something changed?
>
> Mounting the armv7 card on a second Freebsd box and making the changes
> appears to work also, but on the initial boot (firstboot disabled) the
> machine stops at the mountroot prompt on initial boot.
>
> If there's a better way to pursue the same end I'd be grateful for
> a hint. Perhaps giving a swap size parameter to firstboot?
What I usually do is to use a USB SD card adapter on another computer to
add a swap partition. I usually now add it as da0s2b, but I have
previously used da0s3 also. I just use gpart from the other computer
and use something like:
gpart resize -i2 da0s2
gpart add -t freebsd-swap -b56G -a16M da0s2
The resize expands the da0s2 partition to fill the card, and then add
the swap partition at the end of it. I was using a 64G card, so the 56G
needs to be changed to give the desired size on whatever size card you
are using, and da0 may need to be changed for your system. The growfs
in the first boot will expand the file system on da0s2a to fill the
available space.
I hope this helps, but ask if you need more information.
--
Carl Johnson carlj at peak.org
More information about the freebsd-arm
mailing list