# Resizing/shrink FreeBSD partition on RPi



## fiskerendk (Feb 6, 2015)

Hi,

I have FreeBSD installed on a RPi B+ and iI have completed my task of making a "image" ready to be copied to multiple devices.

However iI installed FreeBSD on a 8GB SD card. But want to shrink it to as little as possible and then using the autosize_enable="YES" next time it boots. So it can find also 4GB cards.

Is that possible? At the moment my install only uses about 1.5GB of the total volume.

Best Regards
Thomas Nissen


----------



## junovitch@ (Feb 8, 2015)

growfs(8) only lets you make things bigger.  Are you using the SD card on another system?

If so, you can make a file backed memory disk with mdconfig(8).
See:  https://www.freebsd.org/doc/handbook/disks-virtual.html

Then you can use dump(8)/restore(8) to put all the data from the 8 GB SD card into the 4 GB file backed image.
See:  http://www.wonkity.com/~wblock/docs/html/backup.html

You can then use dd(1) to write that file backed image to any other card you are working on.


----------



## rpereyra (Feb 18, 2015)

Hi

From NetBSD port, maybe help to FreeBSD users:

https://wiki.netbsd.org/ports/evbarm/raspberry_pi/


> Growing the root file-system
> During the partitioning process, do not delete or format the first MSDOS (FAT) partition, as the Raspberry pi firmware is hard coded to boot on the SDCAD / 1st MSDOS partition / Firmware updates and boot loader.
> Copy /boot/cmdline.txt to /boot/cmdline.txt.orig
> Edit /boot/cmdline.txt and add the '-s' flag to the end of the first line of text to boot into single-user mode.
> ...


roberto


----------

