(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



Best of the Newsgroups: mkdev hd is all you need

Main Index

Why oh why don't people just run "mkdev hd" ? That gives an interface that lets you choose what you are adding and is far less likely to get you confused or in trouble.

Over the years, I have seen it over and over again where "mkdev hd" is is run with parameters and causes grief or at least confusion. What started this? Where did people get the idea that they needed parameters? Is is some SCO TA that leads them down this path or is it searching the newsgroups and seeing such usage? 99.99% of people should JUST RUN "mkdev hd" with no other information supplied.

From: "Brian K. White" <brian@aljex.com>
Subject: Re: /dev/rhd00 does not exist error when running fdisk...
Date: 20 Nov 2005 02:45:38 -0500
Message-ID: <026701c5eda6$5a902f80$931fa8c0@venti> 
References: <1132460204.138959.113470@g47g2000cwa.googlegroups.com> 


----- Original Message ----- 
From: "techeez" <ab@techeez.com>
Newsgroups: comp.unix.sco.misc
To: <distro@jpr.com>
Sent: Saturday, November 19, 2005 11:16 PM
Subject: /dev/rhd00 does not exist error when running fdisk...


> Hi All,
>
> In trying to add another ide drive to an sco openserver 5.0.4 machine,
> I've inadvertently done something nasty to the boot drive.  I
> originally ran mkdev hd 01 and stopped it when it got to running fdisk
> as I was nervous that I had selected the wrong drive... Now when I run
> fdisk, which defaults to /dev/rhd00 I get the error that it does not
> exist, even though it still seems to boot fine and run correctly.
>
> Any help would be greatly appreciated.

Short answer:
The safest thing, and probably all you have to do, is run 
/etc/conf/cf.d/link_unix.
That (re)creates any necessary device nodes according to what devices are 
actually in the kernel.

Long answer:
/dev/hd00 and /dev/rhd00 could arguably be called just conveniences.
There are a few different names for some of the same devices and there is no 
law that says your root device whole disk must be named /dev/hd00. Merely 
that somewhere a device node exists with the right major/minor numbers (1,0)

You may still have the /dev/dsk/0s* and /dev/rdsk/0s* versions of the same 
device nodes for /dev/hd00 and /dev/rhd00

Do you have /dev/rdsk0s0 ? If so, try:
fdisk -p -f /dev/rdsk/0s0

Does it look like your first (boot) drive? If so, just:
cp /dev/rdsk/0s0 /dev/hd00
or
mknod /dev/rhd00 c 1 0

Just to be paranoid and verify an assumption above,
"mount" should show / on /dev/root
and
ls -l /dev/root should show major number 1  as in the following line:
br--r-----   1 root     backup     1, 42 Nov  7 04:34 /dev/root
where the "1" in question is from "1, 42"

But it's a pretty safe assumption. Strangely, no matter what driver the disk 
uses, scsi or ide, the major number is always 1.

Here is a block device listing from a 5.0.7 system with 2 ide drives, 
booting off the first:
For every one of these there is also a matching character device where the 
line starts with c instead of b, and the name has either rhd or rdsk in 
place of hd or dsk.

brw-------   1 root     root       1,  0 Feb 18  2003 /dev/hd00
brw-------   1 root     root       1, 15 Feb 18  2003 /dev/hd01
brw-------   1 root     root       1, 23 Feb 18  2003 /dev/hd02
brw-------   1 root     root       1, 31 Feb 18  2003 /dev/hd03
brw-------   1 root     root       1, 39 Feb 18  2003 /dev/hd04
brw-------   1 root     root       1, 47 Feb 18  2003 /dev/hd0a
brw-r-----   1 dos      sysinfo    1, 48 Oct  8 21:23 /dev/hd0d
brw-------   1 sysinfo  sysinfo    1, 64 Oct 22 02:01 /dev/hd10
brw-------   1 sysinfo  sysinfo    1, 79 Oct 22 02:01 /dev/hd11
brw-------   1 sysinfo  sysinfo    1, 87 Oct 22 02:01 /dev/hd12
brw-------   1 sysinfo  sysinfo    1, 95 Oct 22 02:01 /dev/hd13
brw-------   1 sysinfo  sysinfo    1,103 Oct 22 02:01 /dev/hd14
brw-------   1 sysinfo  sysinfo    1,111 Oct 22 02:01 /dev/hd1a
brw-r-----   1 dos      sysinfo    1,112 Oct 22 02:01 /dev/hd1d

brw-------   1 root     root       1,  0 Feb 18  2003 /dev/dsk/0s0
brw-------   1 sysinfo  sysinfo    1, 15 Oct  8 21:23 /dev/dsk/0s1
brw-------   1 sysinfo  sysinfo    1, 23 Oct  8 21:23 /dev/dsk/0s2
brw-------   1 sysinfo  sysinfo    1, 31 Oct  8 21:23 /dev/dsk/0s3
brw-------   1 sysinfo  sysinfo    1, 39 Oct  8 21:23 /dev/dsk/0s4
brw-r-----   1 dos      sysinfo    1, 48 Oct  8 21:23 /dev/dsk/0sC
brw-r-----   1 dos      sysinfo    1, 49 Oct  8 21:23 /dev/dsk/0sD
brw-r-----   1 dos      sysinfo    1, 50 Oct  8 21:23 /dev/dsk/0sE
brw-r-----   1 dos      sysinfo    1, 51 Oct  8 21:23 /dev/dsk/0sF
brw-r-----   1 dos      sysinfo    1, 52 Oct  8 21:23 /dev/dsk/0sG
brw-r-----   1 dos      sysinfo    1, 53 Oct  8 21:23 /dev/dsk/0sH
brw-r-----   1 dos      sysinfo    1, 54 Oct  8 21:23 /dev/dsk/0sI
brw-r-----   1 dos      sysinfo    1, 55 Oct  8 21:23 /dev/dsk/0sJ
brw-------   1 root     root       1, 47 Feb 18  2003 /dev/dsk/0sa
brw-r-----   1 dos      sysinfo    1, 48 Oct  8 21:23 /dev/dsk/0sd
brw-------   1 sysinfo  sysinfo    1, 64 Oct 22 03:36 /dev/dsk/1s0
brw-------   1 sysinfo  sysinfo    1, 79 Oct 22 02:01 /dev/dsk/1s1
brw-------   1 sysinfo  sysinfo    1, 87 Oct 22 02:01 /dev/dsk/1s2
brw-------   1 sysinfo  sysinfo    1, 95 Oct 22 02:01 /dev/dsk/1s3
brw-------   1 sysinfo  sysinfo    1,103 Oct 22 02:01 /dev/dsk/1s4
brw-r-----   1 dos      sysinfo    1,112 Oct 22 02:01 /dev/dsk/1sC
brw-r-----   1 dos      sysinfo    1,113 Oct 22 02:01 /dev/dsk/1sD
brw-r-----   1 dos      sysinfo    1,114 Oct 22 02:01 /dev/dsk/1sE
brw-r-----   1 dos      sysinfo    1,115 Oct 22 02:01 /dev/dsk/1sF
brw-r-----   1 dos      sysinfo    1,116 Oct 22 02:01 /dev/dsk/1sG
brw-r-----   1 dos      sysinfo    1,117 Oct 22 02:01 /dev/dsk/1sH
brw-r-----   1 dos      sysinfo    1,118 Oct 22 02:01 /dev/dsk/1sI
brw-r-----   1 dos      sysinfo    1,119 Oct 22 02:01 /dev/dsk/1sJ
brw-------   1 sysinfo  sysinfo    1,111 Oct 22 02:01 /dev/dsk/1sa
brw-r-----   1 dos      sysinfo    1,112 Oct 22 02:01 /dev/dsk/1sd


So /dev/rhd00 is really just one of a couple common ways to name a device 
node that has the properties of: character device, major 1, minor 0
To recreate from scratch anything you're missing from above:

to create hd00:
mknod /dev/hd00 b 1 0
mknod /dev/rhd00 c 1 0

hd13 would be:
mknod /dev/hd13 b 1 95
mknod /dev/rhd13 c 1 95

-- 
Brian K. White  --  brian@aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk! 




Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



/Bofcusm/2633.html copyright 1997-2004 (various authors) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.



More:
       - OSR5
       - Bofcusm


Unix/Linux Consultants

Skills Tests

Guest Post Here











My Favorites

Change Congress