Grow the system partition

From, an OpenBSD-based firewall
Revision as of 13:44, 29 June 2018 by Anders (talk | contribs)
Jump to: navigation, search

Depending on which disk image the system was installed from, the system partiton can be of difference size. For example, the standard disk images of version 6.1 and earlier had 445 MB system partitions. The system partition of version 6.2 is 840 MB. For some tasks, such as installing packages or running syspatch, you might have to grow the system partition.

  1. If you're using a hypervisor/virtualisation, begin by growing the virtual disk
  2. Connect to the console (serial, video or virtual)
  3. Reboot (possibly by disconnecting the power)
  4. When you see Press 'f' for update and recovery firmware, press p (for "prompt")
  5. At the boot> prompt, run bsd.rd
  6. At the installation prompt, run s (for "shell")
  7. If you want to change the keyboard layout, run kbd XX (where "XX" is the keyboard layout, such as "sv" for Swedish)
  8. At the shell prompt, run:
    • echo "d f\nw\nq" | disklabel -E babebabebabebabe
    • echo "b\n\n*\nw\nq" | disklabel -E babebabebabebabe
    • echo "m e\n\n*\n\nw\nq" | disklabel -E babebabebabebabe
    • cp /mnt3/sbin/growfs /tmp
    • umount /mnt3
    • /tmp/growfs babebabebabebabe.e
    • fsck babebabebabebabe.e
    • reboot
  9. After the reboot, the system (root) partition should be larger