Adding a second hard drive SCO Xenix, Open Desktop, Openserver
This article references SCO SCO Xenix, Open Desktop, Openserver specifically. See Linux/adddrive.html for adding a Linux drive.
You add a hard drive, and configure the file systems on it, by
running "mkdev hd".
People used to older Unices may expect more complications, and
may expect to have to use "mkfs" after hand editing kernel
configuration files to add the appropriate block and character
devices. You certainly can do all that if you want, but "mkdev hd"
is a front end that makes it much easier. If you are curious as to
what goes on behind the scenes, look in /usr/lib/mkdev. The "hd"
command there is a shell script, and is fairly
You generally have to run 'mkdev hd' twice. If I remember
correctly, the kernel already has the code for the second IDE
drives, so in that case it's only once. But for SCSI drives, the
first invocation puts the driver code in, and the second (after a
reboot) allows the partitioning and division of the drive.
For SCSI drives, the first pass asks you the name of the SCSI
controller. If you don't know, and if your primary drive already is
SCSI, look in /etc/conf/cf.d/mscsi. The end of the file might look
wd Srom 1 0 0 0
asc Sdsk 0 0 0 0
asc Sdsk 0 4 0 0
(This happens to be a machine with an EIDE cdrom and a scsi disk
using an "asc" controller, plus a second scsi disk at ID 4). You'll
also be asked about which controller (if you have only one, it's
"0"), what bus (probably 0) and the target ID. and the lun (almost
There are twin-channel controllers: for these, one is controller
"0", the other is "1". You can follow the internal cables to see
which one your drive is connected to.
If you aren't sure what SCSI devices are present,
the "sconf" command can help you on modern systems. Prior to
OSR5.0.5, this existed but could crash your system in multiuser
mode, but now is safe. Here's the output of "sconf -v" on one of my
Sdsk alad 0 0 0 0
Sdsk alad 0 0 1 0
Stp alad 0 0 3 0
Sdsk alad 0 0 4 0
Srom alad 0 0 6 0
For example, this tells me that a tape drive (the Stp line) is
attached to an alad controller, and (reading left to right), it's
alad unit 0, on bus 0, at id 3 and lun 0.
See sconf on 5.0.7.
After answering these questions, the kernel is relinked. Be sure
to answer "Y" to "Rebuild the Kernel Environment", and be sure you
understand what that question means (if you don't, make a copy of
/etc/inittab before you begin this process). You do have to reboot
before proceeding to the next step. You then run 'mkdev hd' again,
and answer the same questions.
If you got it wrong:
Let's be clear what that first invocation does. It's nothing more
than to trust you: in other words, you said "there's a scsi disk
attached to this controller and it has this id, etc." and mkdev hd
said "Kewl- I'll add that to /etc/conf/cf.d/mscsi and build a new
kernel which can access that".
But that's all it does. It doesn't even bother to run sconf -v to see if any hardware remotely like what you described is out there.
The second invocation (after rebooting) really goes out and tries to
access the physical hardware. Apparently it doesn't find the drive.
That could be because (just listing a few things I've done or not done)
- You forgot to plug in the power
- You forgot the cable- at one end or the other
- You forgot the cable completely (ayup, I did that!)
- You misidentified the adaptor bus, the scsi id, the lun- or all of
- You misidentifed which driver to use- arad, alad, what's the
difference? Hate to say how many times I've done that..
- You really installed a tape drive (I didn't actually do that but I
came very, very close to it once. But I have, at least twice, installed
a tape drive in a hard drive bay where there was no opening to the
outside world to put the tape in..)
If this is 5.0.5 or better, run sconf -v and see if it sees your
hardware and that it matches what you (or mkdev hd) put in
/etc/conf/cf.d/mscsi. If it doesn't, you can just manually edit mscsi,
relink, and reboot. Note that the order in which sconf displays info is
NOT the order used in mscsi!
If you guessed wrong about the controller, bus, or ID, you won't
get the screens that ask about the partitions. If that's the case,
don't use mkdev hd, simply go directly to /etc/conf/cf.d/mscsi,
make the corrections, and link a new kernel. The controller is the
first column after Sdsk, the ID is the second, then lun and bus.
Simply change the appropriate column, and then relink.
If you don't feel comfortable with that, at least vi mscsi to
remove the line that represents the error. Once you've got that
correct, 'mkdev hd' will proceed to the second phase, where you
create the Unix partition and then divide it into one or more
During that second phase, you are asked if you want "block by
block control". If you answer that affirmatively, you get to
control everything about the division(s) created, including the
Also, if you don't say you want interactive fdisk/divvy you never get the chance to name divisions anything memorable. Divvy will use a device name instead like "D1150".
When you run divvy initially, you tell it what device you are working on: scsi id, etc. It writes that information into a "division table" on the disk. The second invocation reads that table and scans through /dev looking for device nodes whose major/minor numbers match the entries in that table. When it finds one, it prints that name.
That means that if you boot from floppy or cd and access divvy, it can only find names that exist in /dev on your boot device.
It also means that when you change the name of a division, all divvy does is delete /dev/oldname and /dev/roldname and creates /dev/newname, /dev/rnewname in /dev. It doesn't write anything to the division table except if you
change the size of a division or split the disk into more divisions.
Changing the TYPE of a division does nothing at all except serve as a flag to divvy if you say "New filesystem", in
which case it runs mkfs to match the type you said.
If you have existing data
You may want to transfer an existing disk to another system, as
for an upgrade. The procedure is the same, but do NOT change the
partition info, do NOT change the bad track table, and do NOT
create new filesystems. You'll see your divisions; all you need to
do is (n)ame them and proceed from there.
If you don't, an arbitrary (e.g. "d1150" ) name is generated.
It's not actually completely arbitrary: it is related to the drive
number and its id if scsi. I think it's been documented somewhere,
but I never pay attention to it because:
- You can name the divisions sensibly
- You can always find out what someone else named them
The "finding out" can be accomplished by using 'divvy' on the
appropriate device. "man HW hd" gives tables of drive names, and
from that it's easy to find out /dev/hd1a will represent the second
physical disk. Therefor, 'divvy -P -N /dev/hd1a' will print out
info about the divisions, including the names.
Or, you can use divvy interactively, leaving out the -N and -P.
By doing this, you can even change the name to something more
sensible. I like to use names that are reminiscent of the mount
points, so my Jaz drive has a division 'jaz', which creates a
/dev/jaz, which I mount at /jaz.
Note here that the second pass of "mkdev hd" will have invoked
divvy for you: you don't need these commands unless you need to get
back to the divvy tables after this. Note also that if you already
know the name of the division (such as /dev/u), you can get there
with "divvy /dev/u"
You may want to creat multiple partitions. See Adding disk space for
The final step, of course, is to do the mount. You can manually
edit /etc/default/filesys ('man filesys'), or you can use 'mkdev
fs'. This does NOTHING TO EXISTING DATA. It only creates
/lost+found and adds the drive to /etc/default/filesys. You can
safely use this with any drive.
You didn't pay attention to the name of the division and didn't
change it from the default? Look at the "Existing Data" section
just above this.
For some reason, there is no mention of 'fs' in the man page for
'mkdev', but it's been in /usr/lib/mkdev for a very long time. It
asks the appropriate questions, and if you give it appropriate
answers, it will create the appropriate entry in
You get asked for the device name. Answer that with the name of
the division. You are then asked for a mount point, and finally you
are asked if you want to always mount this filesystem. Generally,
you'll answer yes to that.
If you told it to "always mount", you can then mount it by any
of "mountall", "mount /mount_point", or by rebooting.
For ideas about what to do with this extra space see Adding disk space.
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
More Articles by Tony Lawrence
Find me on Google+
© 2013-08-20 Tony Lawrence