← Retour au blog
tech 6 September 2026

NetBSD 11: Building from Scratch

Learn how to install NetBSD 11 from scratch, exploring manual installation and the inner workings of this OS known for its portability.

Article inspired by the original source
NetBSD 11 from scratch ↗ meanmicio.org

Introduction

Installing an operating system can be a fascinating journey, especially when it comes to NetBSD 11, renowned for its portability and ability to breathe new life into older computers. In this article, we will dive into the process of installing NetBSD 11 from scratch, bypassing the default installer sysinst. This approach will allow us to explore the depths of this OS and learn to customize every step.

Why NetBSD?

NetBSD stands out for its impressive portability, capable of running on a multitude of hardware platforms, from modern x86 systems to older machines. This system offers great flexibility and total control, ideal for developers and system administrators looking to optimize their configurations.

Preparing the Installation

The first step involves preparing the installation image. You can download the image from the NetBSD website. Be sure to double-check the USB device name you are using to avoid erasing other important data.

``bash $ wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-11.0/images/NetBSD-11.0-amd64-install.img.gz $ gunzip NetBSD-11.0-amd64-install.img.gz $ sudo dd if=NetBSD-11.0-amd64-install.img of=/dev/<usb_device> bs=2m ``

Once the image is written to your USB stick, configure your BIOS to boot from it. You'll then encounter the sysinst installer, but our goal here is to bypass it to explore manual steps.

Manual Installation: Delving into the Internals

To exit sysinst, use CTRL+C to get a command prompt. This is where the manual installation begins. This method provides a better understanding of disk partitioning, network configuration, and essential package installation.

Disk Partitioning

Using the fdisk tool, create the necessary partitions. For a simple system, a root partition and a swap partition will suffice.

``bash # fdisk -u /dev/<disk> ``

File System

After partitioning, format the partitions with newfs and set up the swap with mkswap.

``bash # newfs /dev/<root_partition> # mkswap /dev/<swap_partition> ``

Installing the Base System

Mount the root partition and extract the base sets from the image.

``bash # mount /dev/<root_partition> /mnt # cd /mnt # tar -zxpf /path/to/base.tgz ``

Post-Installation Configuration

Once the system is installed, configure the network by editing /etc/rc.conf and /etc/ifconfig.<interface>. Ensure essential services like SSH are enabled for remote access.

``bash hostname="netbsd" ifconfig_<interface>="dhcp" dhclient=yes sshd=yes ``

Securing: Disk Encryption

For systems requiring enhanced security, configure disk encryption using cgdconfig to protect sensitive data.

``bash # cgdconfig <cgd_device> /dev/<raw_partition> ``

Conclusion

Installing NetBSD 11 from scratch provides a rewarding experience for those seeking to deeply understand the workings of UNIX systems. By following these steps, you'll not only have an optimized system but also a better understanding of the software and hardware components of your infrastructure.

Let's discuss your project in 15 minutes.

NetBSD installation Unix portability disk encryption
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call