Adding additional SCSI drives

A place for discussing anything RISC iX, whether emulated or on original hardware!
Post Reply
iainfm
Posts: 602
Joined: Thu Jan 02, 2020 8:31 pm
Location: Dumbarton
Contact:

Adding additional SCSI drives

Post by iainfm »

Hi,

I was trying to add a third SCSI HD to the RISCiX box I've been messing aroung with under Arculator the other day, and found it wasn't quite as straightforward as I'd expected.

I'm not going to get into how to create and format a new disc partition (here), but if you have a second drive attached that contains a valid mountable partition, you can mount it without any hassle with

Code: Select all

mount /dev/sd1a /mnt
But things get a little bit interesting after that. In fact, I'm not sure why sd1a works, because the special files for SCSI device 1 don't exist in /dev. Only the sd0 and rsd0 do. So it's strange sd1 works at all.

If you have a third drive you want to mount, trying to do:

Code: Select all

mount /dev/sd2a /mnt2
will throw an error

Code: Select all

mount: /dev/sd2a on /mnt2: No such file or directory. Mount giving up on /mnt2
To mount the third (or subsequent) drives, we need to create the 'special files' under /dev. Typically this would be done by running the MAKEDEV script, but there's nothing within it to make anything other than the device nodes for SCSI ID 0. But if we figure out the major and minor device numbers we can add them manually.

The man page entry for mknod is somewhat less than helpful though. It says "The assignment of major device numbers is specific to each system. They have to be dug out of the system source file conf.c."

I found conf.c in the Victoria University RISCiX backup, which helped a little...coupled with some professional guesswork :lol:

Given the SCSI ID 0 parition 0 block device is defined by MAKEDEV as major device 12 and minor device 0, and its raw (character) equivalent is major device 21 minor device, I reckoned SCSI ID 1 would be 13/0 and 22/0. So for SCSI ID 2 I tried:

Code: Select all

cd /dev

mknod sd2a b 14 0
chmod 640 sd2a
chgrp operator sd2a

mknod rds2a c 23 0
chmod 640 rsd2a
chgrp operator rsd2a

mount /dev/rsd2a /mnt
and it worked.

I've not tried it yet, but this shoud be repeatable for other partitions, drives etc. sd2b/rsd2b should be 14/1 and 23/1, sd3a/rsd3a would be 15/0 and 24/0 etc.

PS Additionaly SCSI drives don't need to be *configured on the RISC OS side.
User avatar
BeebMaster
Posts: 7394
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Adding additional SCSI drives

Post by BeebMaster »

I don't suppose mount is complaining that /mnt2 doesn't exist, rather than /dev/sd2a ?

On Linux, mount doesn't create the mount point, it must already exist.

If the second drive (sd1a) is mounted at /mnt then where is the first drive mounted?
Image
iainfm
Posts: 602
Joined: Thu Jan 02, 2020 8:31 pm
Location: Dumbarton
Contact:

Re: Adding additional SCSI drives

Post by iainfm »

BeebMaster wrote: Sun Dec 24, 2023 12:45 pm I don't suppose mount is complaining that /mnt2 doesn't exist, rather than /dev/sd2a ?

On Linux, mount doesn't create the mount point, it must already exist.

If the second drive (sd1a) is mounted at /mnt then where is the first drive mounted?
Yes, the mount point was created so it was definitely moaning about the missing device. I tried mounting it at /mnt as well and got the same error.

The first drive is mounted at / (root), as defined in /etc/fstab, along with the swap partition

Code: Select all

/dev/sd0a /     4.3    rw    1 1
/dev/sd0b swap  swap   rw    0 0
Post Reply

Return to “32-bit acorn software: RISC iX”