Changing the Default Boot Device

Changing the Default Boot Device

To boot from the default boot device (usually the primary hard drive), you would enter the following:

ok boot

However, it is also possible to boot using the CDROM by using this command:

ok boot cdrom

The system may be booted from a host on the network by using this command:

ok boot net

Alternatively, if you have a boot floppy, the following command may be used:

ok boot floppy

Because many early Solaris distributions were made on magnetic tape, it’s also possible to boot using a tape drive with the following command:

ok boot tape

Instead of specifying a different boot device each time you want to reboot, it is possible to set an environment variable within the OpenBoot monitor, so that a specific device is booted by default. For example, to set the default boot device to be the primary hard disk, you would use the following command:

ok setenv boot-device disk
boot-device = disk

To verify that the boot device has been set correctly to disk, the following command can be used:

ok printenv boot-device
boot-device disk

In order to reset the system, to use the new settings, you simply use the reset command:

ok reset

To set the default boot device to be the primary network device, you would use the following command:

ok setenv boot-device net
boot-device = net

This configuration is commonly used for diskless clients, such as Sun Rays, which use RARP and NFS to boot across the network. To verify that the boot device has been set correctly to net, the following command can be used:

ok printenv boot-device
boot-device net disk 

To set the default boot device to be the primary CD-ROM device, you would use the following command:

ok setenv boot-device cdrom
boot-device = cdrom

To verify that the boot device has been set correctly to cdrom, the following command can be used:

ok printenv boot-device
boot-device cdrom disk

To set the default boot device to be the primary floppy drive, you would use the following command:

ok setenv boot-device floppy
boot-device = floppy

To verify that the boot device has been set correctly to floppy, the following command can be used:

ok printenv boot-device
boot-device floppy disk

To set the default boot device to be the primary tape drive, you would use the following command:

ok setenv boot-device tape
boot-device = tape

To verify that the boot device has been set correctly to tape, the following command can be used:

ok printenv boot-device
boot-device tape disk


Part I: Solaris 9 Operating Environment, Exam I