Problem
When I run the command "mkdev hd 0 1" to add a disk to the second IDE controller, I accidentally trash my root drive and the device node for my root drive /dev/rhd00 disappears.
Solution
Instead of using mkdev at the command line with arguments, simply use the command "mkdev hd" following the instructions in Parts I and II below. If you have already run mkdev at the command line with arguments and have lost your device nodes, recovery information for certain scenarios is provided in the section marked "Recovery" at the end of this article.
Part I.Step 1. If the secondary IDE device is onboard, enable the device by entering system setup and physically attach the hardware.
Part II.Run disk configuration utility in the interactive mode by typing:
# mkdev hdStep 1. You are instructed to make a selection from the three choices. Enter 1 to select "Adding a hard disk to IDE controller".
Step 2. When you are prompted to overwrite the current contents of the hard disk, answer 'Y'.
NOTE: You will be instructed to rebuild the kernel if the current kernel doesn't have support for the IDE controller. Follow the instructions presented during mkdev hd and return to step 3.
Step 3. You are in the Hard Disk Drive 1 Configuration screen. Select '1' to display the current disk parameters. Select 'q' to quit after verifying that the values listed match the manufacturer's literature.
Step 4. You are in the fdisk menu. Enter the appropriate response to correctly partition the hard drive.
Step 5. You are in the divvy menu. Enter the appropriate responses to create the divisions and filesystems on the hard drive.
Recovery
--------After invoking mkdev at the command line with arguments, the following message is displayed to the user:
Disk already configured as disk number 0 (/dev/dsk/0s0)During installation you may choose to overwrite all or part of the present contents of your hard drive.
Do you wish to continue> (y/n).If the user answers 'n' at this point, the following nodes are removed:
/dev/hd00 /dev/hd01 /dev/hd02 /dev/hd03 /dev/hd04 /dev/hd0a /dev/hd0d /dev/rhd00 /dev/rhd01 /dev/rhd02 /dev/rhd03 /dev/rhd04 /dev/rhd0a /dev/rhd0d
The user can re-create the block device nodes by typing:
/etc/mknod /dev/hd00 b 1 0 /etc/mknod /dev/hd01 b 1 15 /etc/mknod /dev/hd02 b 1 23 /etc/mknod /dev/hd03 b 1 31 /etc/mknod /dev/hd04 b 1 39 /etc/mknod /dev/hd0a b 1 47 /etc/mknod /dev/hd0d b 1 48
The user can re-create the character nodes by typing:
/etc/mknod /dev/rhd00 b 1 0 /etc/mknod /dev/rhd01 c 1 15 /etc/mknod /dev/rhd02 c 1 23 /etc/mknod /dev/rhd03 c 1 31 /etc/mknod /dev/rhd04 c 1 39 /etc/mknod /dev/rhd0a c 1 47 /etc/mknod /dev/rhd0d c 1 48
If the user answers y, the program guides them through dparam, fdisk and divvy, and probably, the contents of the root disk will be removed, for which the only recovery will be reinstallation.