3: [[!toc levels=3]]
5: # Installing NetBSD: Preliminary considerations and preparations
7: ## Preliminary considerations
9: ### Dual booting
11: It is possible to install NetBSD together with other operating systems on one
12: hard disk.
14: If there is already an operating system on the hard disk, think about how you
15: can free some space for NetBSD; if NetBSD will share the disk with other
16: operating systems you will probably need to create a new partition (which you
17: will do with sysinst). Often times this will not be possible unless you resize
18: an existing partition.
20: Unfortunately, it is not possible to resize an existing partition with sysinst,
21: but there are some commercial products (like Partition Magic) and some free
22: tools (GNU Parted, FIPS, pfdisk) available for this.
24: You can also install NetBSD on a separate hard disk.
26: *Advice*: Unless you are comfortable with setting up a partitioning scheme for
27: two or more operating systems, and unless you understand the risk of data loss
28: if you should make a mistake, it is recommended that you give NetBSD its own
29: hard disk. This removes the risk of damage to the existing operating system.
31: ### NetBSD on emulation and virtualization
33: It is possible to install and run NetBSD on top of other operating systems
34: without having to worry about partitioning. Emulators or virtualization
35: environments provide a quick and secure way to try out NetBSD. The host
36: operating system remains unchanged, and the risk of damaging important data is
39: Information about NetBSD as a Xen host and guest system is available on the
40: [NetBSD/xen web page](http://www.NetBSD.org/ports/xen/).
42: The [NetBSD on emulated hardware](http://www.NetBSD.org/ports/emulators.html)
43: web page provides detailed information about various emulators and the supported
44: NetBSD platforms. It should also be noted that NetBSD runs as a VMware guest.
46: ## Install preparations
48: ### The INSTALL document
50: The first thing to do before installing NetBSD is to read the release
51: information and installation notes in one of the `INSTALL` files: this is the
52: official description of the installation procedure, with platform-specific
53: information and important details. It is available in HTML, PostScript, plain
54: text, and an enhanced text format to be used with more. These files can be found
55: in the root directory of the NetBSD release (on the install CD or on the FTP
56: server). For example, the amd64 install instructions are available at:
60: ### Partitions
62: The terminology used by NetBSD for partitioning is different from the typical
63: DOS/Windows terminology; in fact, there are two partitioning schemes involved
64: when running NetBSD on a typical PC. NetBSD installs in one of the four primary
65: BIOS partitions (the partitions defined in the hard disk partition table).
67: Within a BIOS partition (also called *slice*) NetBSD defines its BSD partitions
68: using a *disklabel*: these partitions can be seen only by NetBSD and are
69: identified by lowercase letters (starting with `a`). For example, wd0a refers to
70: the `a` partition of the first IDE disk (wd0) and sd0a refers to the `a`
71: partition of the first SCSI disk. In the following figure, there are two primary
72: BIOS partitions, one used by DOS and the other by NetBSD. NetBSD describes the
73: disk layout through the disklabel.
77: *Note*: The meaning of partitions `c` and `d` is typical of the amd64 port. On
78: most other ports, `c` represents the whole disk.
80: *Note*: If NetBSD shares the hard disk with another operating system (like in
81: the previous example) you will want to install a *boot manager*, i.e., a program
82: which lets you choose which OS to start at boot time. sysinst can do this for
83: you and will ask if you want to install one. Unless you have specific reasons
84: not to, you should let sysinst perform this step.
86: ### Hard disk space requirements
88: The exact amount of space required for a given NetBSD installation varies
89: depending on the platform being used and which distribution sets are selected.
90: Generally speaking, if you have a few GB of free space on your hard drive, you
91: will have enough space for a full installation of the base system.
93: ### Network settings
95: If you plan to fetch distribution sets over the network (not necessary if you
96: downloaded a full-size install ISO) and do not use DHCP, write down your basic
97: network settings. You will need:
99: * Your IP address (example: 192.168.1.7)
100: * the netmask (example: 255.255.255.0)
101: * the IP address of your default gateway (example: 192.168.1.1)
102: * the IP address of the DNS server you use (example: 188.8.131.52)
104: ### Backup your data and operating systems!
106: Before you begin the installation, make sure that you have a reliable backup of
107: any operating systems and data on the used hard disk. Mistakes in partitioning
108: your hard disk can lead to data loss. Existing operating systems may become
109: unbootable. "Reliable backup" means that the backup and restore procedure is
110: tested and works flawlessly!
112: ### Preparing the installation media
114: The NetBSD installation system consists of two parts. The first part is the
115: installation kernel. This kernel contains the NetBSD install program sysinst and
116: it is booted from the install media (e.g, CD/DVD, USB drive, memory card, etc.).
117: The [[!template id=man name="sysinst" section="8"]] program will prepare the disk: it separates the disk space into
118: partitions, makes the disk bootable and creates the necessary file systems.
120: The second part of the install system is made up of the binary distribution
121: sets: the files of the NetBSD operating system. The installer needs to have
122: access to the distribution sets. [[!template id=man name="sysinst" section="8"]]
123: will usually fetch these files from the install media you booted from, but it
124: can also fetch them via HTTP, NFS, or a local file system.
126: The NetBSD Project provides [complete install media](https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/images/) for every supported hardware
127: architecture. This is usually in the form of bootable CD images (`.iso` files).
129: #### Booting the install system from USB
131: To use a bootable USB install image (on amd64, i386) download the `img.gz` file for your hardware architecture, decompress and copy the image to a USB. For example on a Unix-like system you may use:
133: # gunzip NetBSD-8.0-amd64-install.img.gz
134: # dd if=NetBSD-8.0-amd64-install.img of=/dev/your-usb bs=2m
136: Examples of `your-usb` are `/dev/rsd0d` (NetBSD), `/dev/sda` (Linux).
138: *Caution*: Selecting the wrong device in dd may destroy your current system.
139: Double check it isn't mounted and is your USB stick. It should appear at the
140: bottom of dmesg on connect, for example, if you see:
142: sd0 at scsibus0 target 0 lun 0: [...], disk removable
144: on NetBSD, you will want to select `/dev/rsd0d`.
146: #### Booting the install system from CD
148: To use a bootable NetBSD install CD download the `iso` file for your hardware
149: architecture and burn it to a CD or DVD. You will need to handle this step
150: alone, as burning programs vary widely. Ensure that your computer is set up to
151: boot from CD-ROM before hard drives, insert the disc, and reboot the computer.
153: #### Booting the install system from floppy
155: If you need to create installation floppies, you need to copy floppy images to a
156: diskette. The floppy images are available on the NetBSD FTP servers or on a
157: NetBSD install CD. To perform this operation in DOS you can use the rawrite
158: program in the `i386/installation/misc` directory. For Windows, there's a
159: version in `rawr32.zip`. The image files are `i386/installation/floppy/boot1.fs`
160: and `i386/installation/floppy/boot2.fs` for installation of a "normal" PC. The
161: other floppies that are available are described in more detail in the `INSTALL`
164: *Note*: Before you write the boot images to floppies, you should always check
165: that the floppies are good: this simple step is often overlooked, but can save
166: you a lot of trouble!
168: The procedure to write floppies is:
170: 1. Format the floppy.
171: 2. Go to the `I386\INSTALLATION\FLOPPY` directory of the CD-ROM.
172: 3. Run the `..\MISC\RAWRITE` program (or extract `..\MISC\RAWR32.ZIP` if
173: you're on a Windows system, and run the RAWRITE32 program in that file).
174: Usually the `Source file`s are `BOOT1.FS` and `BOOT2.FS` and the
175: `Destination drive` is `A`:
177: To create a boot floppy in a Unix environment, the
178: [[!template id=man name="dd" section="1"]]
179: command can be used: For example:
181: # cd i386/installation/floppy
182: # dd if=boot.fs of=/dev/fd0a bs=36b
184: *Note*: A 1440K floppy contains 1474560 bytes and is made up of 80 cylinders, 2
185: tracks, 18 sectors and 512 bytes per sector, i.e., 80 \* 2 \* 18 = 2880 blocks.
186: Thus `bs=36b` copies one cylinder (18 \* 2 blocks) at a time and repeats the
187: operation 80 times instead of 2880.
189: ## Checklist
191: This is the checklist about the things that should be clear and on-hand now:
193: * Available disk space
194: * Bootable medium with the install system
195: * CD/DVD or server with the distribution sets
196: * Your network information (only if you will be fetching distribution sets via
197: the network and do not use DHCP)
198: * A working backup
199: * A copy of the INSTALL document
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb