Difference between revisions of "NetBSD"
(Added DNS information.) |
|||
Line 10: | Line 10: | ||
</pre> | </pre> | ||
− | You will also need the IP address of a DNS server. You can copy the one from /etc/resolv.conf , or you can use a public DNS server, such as Google's Pulic DNS | + | You will also need the IP address of a DNS server. You can copy the one from /etc/resolv.conf , or you can use a public DNS server, such as Google's Pulic DNS Server at 8.8.8.8. |
− | + | From the control menu on your dom0 host, destroy/shutdown the instance, and restart ("create/start") it, selecting the "rescue" option from the bootloader. Login as 'root'. | |
− | + | Your fixed disk, as known to the linux rescue image, is /dev/xvda. Later, when booted to the NetBSD installer, it is identified as /dev/xbd0. | |
− | + | For NetBSD, this disk must be partitioned, and the NetBSD installer files placed therein. | |
+ | <pre>fdisk /dev/xvda</pre> | ||
+ | |||
+ | From within fdisk, | ||
+ | <ul> | ||
+ | <li>delete the existing partition, <b>*which will destroy your current OS image and dataa*</b></li> | ||
+ | <li>create a new primary partition #1, with first cylinder at default=1 and last cylinder at +32M</li> | ||
+ | <li>write the new parition table to the disk. | ||
+ | <li>exit fdisk | ||
+ | </ul> | ||
+ | |||
+ | Success to this point is evidenced by the prseence of /dev/xvda1 | ||
+ | |||
+ | |||
+ | |||
+ | If the file 'netbsd64.tar.gz' exists in /distros, skip over to <a href=<"#Unpack_Installer">Unpacking the Installer</a> | ||
+ | |||
+ | Otherwise you'll have to proceed here with | ||
+ | <h3>Fetching the Installer</h3> | ||
Wait for DHCP to time out. | Wait for DHCP to time out. | ||
Line 27: | Line 45: | ||
Partition /dev/xvda, create a 32mb ext2 partition as partition 1, make | Partition /dev/xvda, create a 32mb ext2 partition as partition 1, make | ||
− | a directory boot/, wget and extract | + | a directory boot/, |
− | + | ||
+ | wget and extract to /mnt/boot/ : | ||
<pre> | <pre> | ||
Line 50: | Line 69: | ||
kernel /boot/netbsd-INSTALL_XEN3_DOMU | kernel /boot/netbsd-INSTALL_XEN3_DOMU | ||
</pre> | </pre> | ||
+ | |||
+ | Skip to <a href="Boot_to_Installer">Booting the Installer</a> | ||
+ | |||
+ | <a name="Unpack_Installer">Unpack the Installer</a> | ||
+ | <h3>Unpacking the Installer</h3> | ||
+ | This section presumes the presence, in the rescue instance, of /distros/netbsd64.tar.gz | ||
+ | |||
+ | |||
+ | |||
+ | <a name="Boot_to_Installer"</a> | ||
+ | <h3>Booting the Installer</h3> | ||
Shutdown again. | Shutdown again. |
Revision as of 15:31, 9 June 2010
Contents
chris2's gentle guide to installing NetBSD in a prgmr DomU (January 2009)
Installing NetBSD as DomU is easy, but not trivial.
Boot your preconfigured system, jot down its IP address:
eth0 Link encap:Ethernet inet addr:64.62.205.XXX Bcast:64.62.205.255 Mask:255.255.255.192
You will also need the IP address of a DNS server. You can copy the one from /etc/resolv.conf , or you can use a public DNS server, such as Google's Pulic DNS Server at 8.8.8.8.
From the control menu on your dom0 host, destroy/shutdown the instance, and restart ("create/start") it, selecting the "rescue" option from the bootloader. Login as 'root'.
Your fixed disk, as known to the linux rescue image, is /dev/xvda. Later, when booted to the NetBSD installer, it is identified as /dev/xbd0.
For NetBSD, this disk must be partitioned, and the NetBSD installer files placed therein.
fdisk /dev/xvda
From within fdisk,
- delete the existing partition, *which will destroy your current OS image and dataa*
- create a new primary partition #1, with first cylinder at default=1 and last cylinder at +32M
- write the new parition table to the disk.
- exit fdisk
Success to this point is evidenced by the prseence of /dev/xvda1
If the file 'netbsd64.tar.gz' exists in /distros, skip over to <a href=<"#Unpack_Installer">Unpacking the Installer</a>
Otherwise you'll have to proceed here with
Fetching the Installer
Wait for DHCP to time out.
Setup IP with
ifconfig eth0 up 64.62.205.XXX/26 route add -net 0.0.0.0 gw 64.62.205.193 eth0
Partition /dev/xvda, create a 32mb ext2 partition as partition 1, make a directory boot/,
wget and extract to /mnt/boot/ :
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0/amd64/binary/kernel/netbsd-INSTALL_XEN3_DOMU.gz ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0/amd64/binary/kernel/netbsd-XEN3_DOMU.gz
(or newer)
Create a file boot/grub/menu.lst with this content:
timeout 5 title NetBSD run root (hd0,0) kernel /boot/netbsd-XEN3_DOMU title NetBSD install root (hd0,0) kernel /boot/netbsd-INSTALL_XEN3_DOMU
Skip to <a href="Boot_to_Installer">Booting the Installer</a>
<a name="Unpack_Installer">Unpack the Installer</a>
Unpacking the Installer
This section presumes the presence, in the rescue instance, of /distros/netbsd64.tar.gz
<a name="Boot_to_Installer"</a>
Booting the Installer
Shutdown again.
Create instance. Boot first grub item, then pick "NetBSD install".
Install onto xbd0(!).
IMPORTANT: Change disklabel such that xbd0a starts after the end of the ext2 partition. Add a disklabel for the /boot partition, so you can update the kernels and adjust the menu.lst later. (You can find out its sectors by using fdisk /dev/xbd0). Here is an example disklabel setup for a 3072M disk with a 32M boot partition:
We now have your BSD-disklabel partitions as: This is your last chance to change them. Start MB End MB Size MB FS type Newfs Mount Mount point --------- --------- --------- ---------- ----- ----- ----------- a: 31 2912 2882 FFSv1 Yes Yes / b: 2913 3040 128 swap c: 0 3071 3072 NetBSD partition d: 0 3071 3072 Whole disk e: 0 30 31 Linux Ext2 f: 0 0 0 unused g: Show all unused partitions h: Change input units (sectors/cylinders/MB) >x: Partition sizes ok
Install by FTP, setup networking by the noted data. Adjust the FTP paths to the snapshot you use.
Reboot, now with "NetBSD run".
Congratulations!
19:30, 3 February 2009 (UTC)