You are on page 1of 2

Migrating System to RAID The new RAID filesystems are now ready for use.

We mount them under /mnt and cop y all files from the old system. This can be done using dump(8) or pax(1). # mount /dev/raid0a /mnt # df -h /mnt Filesystem Size Used Avail %Cap Mounted on /dev/raid0a 8.9G 2.0K 8.5G 0% /mnt # cd /; pax -v -X -rw -pe . /mnt [...snip...] The NetBSD install now exists on the RAID filesystem. We need to fix the mount-p oints in the new copy of /etc/fstab or the system will not come up correctly. Re place instances of wd0 with raid0. The swap should be unconfigured upon shutdown to avoid parity errors on the RAID device. This can be done with a simple, one-line setting in /etc/rc.conf. # vi /mnt/etc/rc.conf swapoff=YES Next the boot loader must be installed on Disk1/wd1. Failure to install the load er on Disk1/wd1 will render the system un-bootable if Disk0/wd0 fails making the RAID-1 pointless. Tip Because the BIOS/CMOS menus in many x86 based systems are misleading with regard to device boot order. I highly recommend utilizing the "-o timeout=X" option su pported by the x86 1st stage boot loader. Setup unique values for each disk as a point of reference so that you can easily determine from which disk the system is booting. Caution Although it may seem logical to install the 1st stage boot block into /dev/rwd1{ c,d} with installboot(8) , this is no longer the case since NetBSD 1.6.x. If you make this mistake, the boot sector will become irrecoverably damaged and you wi ll need to start the process over again. On x86, install the boot loader into /dev/rwd1a : # /usr/sbin/installboot -o timeout=30 -v /dev/rwd1a /usr/mdec/bootxx_ffsv2 File system: /dev/rwd1a Primary bootstrap: /usr/mdec/bootxx_ffsv2 Ignoring PBR with invalid magic in sector 0 of `/dev/rwd1a' Boot options: timeout 30, flags 0, speed 9600, ioaddr 0, console pc Note As of NetBSD 6.x, the default filesystem type on x86 platforms is FFSv2 instead of FFSv1. Make sure you use the correct 1st stage boot block file /usr/mdec/boot xx_ffsv{1,2} when running the installboot(8) command. To find out which filesystem type is currently in use, the command file(1) or du mpfs(8) can be used: # /usr/bin/file -s /dev/rwd1a /usr/bin/file -s /dev/rwd1a /dev/rwd1a: Unix Fast File system [v2] (little-endian), last mounted on ... or

# /usr/sbin/dumpfs -s /dev/rwd1a file system: /dev/rwd1a format FFSv2 endian little-endian ... On sparc64, install the boot loader into /dev/rwd1a as well, however the "-o" fl ag is unsupported (and un-needed thanks to OpenBoot): # /usr/sbin/installboot -v /dev/rwd1a /usr/mdec/bootblk File system: /dev/rwd1a Primary bootstrap: /usr/mdec/bootblk Bootstrap start sector: 1 Bootstrap byte count: 5140 Writing bootstrap Finally the RAID set must be made auto-configurable and the system should be reb ooted. After the reboot everything is mounted from the RAID devices. # raidctl -v -A root raid0 raid0: Autoconfigure: Yes raid0: Root: Yes # tail -2 /var/log/messages raid0: New autoconfig value is: 1 raid0: New rootpartition value is: 1 # raidctl -v -s raid0 [...snip...] Autoconfig: Yes Root partition: Yes Last configured as: raid0 [...snip...] # shutdown -r now Warning Always use shutdown(8) when shutting down. Never simply use reboot(8). reboot(8 ) will not properly run shutdown RC scripts and will not safely disable swap. T his will cause dirty parity at every reboot.

You might also like