how to mount device in SCSI and IDE interface
Question 1:
Suppose my computer have two SCSI cards and two SCSI HDs. 1st SCSI HD is on 1st SCSI card and 2nd SCSI HD is on 2nd SCSI card. according to devices.txt : (0-15) sda~sdp , major=8 (16-31) sdq~ sdaf , major=65 How 2nd SCSI HD on 2nd SCSI card should mount device file ? Mount sdb or sdq ? My idea is "sdq" mounted because different SCSI cards have different major number which represents a driver. Major number =8 controls HDs on first SCSI card and major number=65 controls HDs on second SCSI card. Is My idea correct ? Question 2: Normally, common computer have two IDE controllers. My IDE HD connects with 2nd IDE interface , but 1st IDE connects with other devices. according to devices.txt : 22 block Second IDE hard disk/CD-ROM interface 0 = /dev/hdc Master: whole disk (or CD-ROM) 64 = /dev/hdd Slave: whole disk (or CD-ROM) ............. ............. How IDE HD should mount device file ? Mount hda or hdc ? My HD is on 2nd IDE interface and I should mount "hdc" . However , "hdc" represent third HD and I just have one HD, so I should mount hda that represents first HD. Should I mount hda or hdc ?? Thanks for everybod's reply. |
Re: how to mount device in SCSI and IDE interface
Quote:
So: Primary Master = hda Primary Slave = hdb Secondary Master = hdc Secondary Slave = hdd ... the same for hde,etc You say your hd is master on the 2nd IDE bus, so the device will be hdc It doesn't matter if it is your first or your second or whatever disk it is. hda means Primary Master not first disk SCSI devices named again according to their interface but there is a different way. You have two disks. Lets suppose that one has 0,0,0 (ID 0 on the first controller) and the other has 1,0,0 (ID 0 on the second controller) Then the 0,0,0 will be named sda and the 1,0,0 will be named sdb. The change to major 65 has nothing to do with the naming. The difference with IDE and SCSI device naming is that the IDE naming stays the same always, while the SCSI naming isn't persistent (which causes trouble sometimes) For example, if you connect another SCSI disk on the first controller and you give it ID 2 (so it becomes 0,0,2) then this will become sdb and your 1,0,0 which was sdb will become sdc Anyway, you can see which device each disk uses by running "dmesg" which prints the kernel messages. |
1,0,0 (ID 0 on the second controller)
Is it a slip of the pen ? ID 0 => ID 1. Your explanation make me very clear. Thank you solve my questions that confuses me. |
If your not sure what the device file names are for your system, you can find out easily by opening a console and running as root:
# fdisk -l That will give a listing of all hard drive partitions that your system recognizes, whether mounted or not. |
Quote:
Let me explain it a bit more. SCSI devices can be accessed using 3 numbers (you used to do that with cd-rw/dvd-rw with scsi-emulation untill 2.6 kernels were released) The naming is "scsibus,target,lun" So if you have on controller and two devices (a hard disk with ID=0 and a tape drive with ID=5) then the devices will have 0,0,0 and 0,5,0. You have 2 controllers with one hard disk connected in each controller, so a good guess was that the disks would be (0,0,0 and 1,0,0 if they have ID=0) This isn't directly associated with your question, i just mentioned it to explain to you which one would be sda and which would be sdb etc. |
Your explanation make me clear again.
Now,I have a question about IDE tape devices again and I never use tape devices, so the question could be stupid . According to devices.txt: 37 char IDE tape 0 = /dev/ht0 First IDE tape 1 = /dev/ht1 Second IDE tape ... 128 = /dev/nht0 First IDE tape, no rewind-on-close 129 = /dev/nht1 Second IDE tape, no rewind-on-close ... Currently, only one IDE tape drive is supported. Does it (...) mean 3rd IDE tape,4th IDE tape and so on ? If it's true , the max number of IDE tape can get up to 128 becase of "127=/dev/ht127 128th IDE tape " ( I guess). But IDE devices have no ID unlike SCSI devices, how does os determine the sequence among tape devices ? Who is first or second or whatever ? Is os's decision according to sequence of IDE controller(ide0,ide1...) and Master/Slave ? If my question isn't clear ,please forgive me and ignore this question. |
Probably by their position on the ide bus but your documentation plainly states that only one tape device is currently supported. You seem very confulsed about those numbers. Those are the major and minor numbers of the device. That's how the kernel actually communicates with the device. Those numbers are mapped to the device file for us humans; the kernel could care less how you name it as long as you create the device file with the right major and minor number. See the mknod command and man mknod. Naming conventions are important so other user space programs can communicate with the devices but it doesn't matter at the kernel level. All the kernel cares about are those numbers and whether the device is a block device or a character device. Those numbers tell the kernel where the device is on the various system busses and how to deal with the device.
To answer your question, ht0 is the first ide tape drive and has the major and minor numbers of 37 0. If you where to create this device by hand using mknod you would do: # mknod /dev/ht0 c 37 0 The nht0 device refers to the same drive but the "n" refers to "no rewind". The fact that it has a minor number of 128 does not necessarilly indicate that there are 127 possible tape drives before it; there are often gaps in these sequences. In fact, if you look here: http://www.lanana.org/docs/device-list/devices.txt you can see the full mapping of the major and minor numbers in the kernel. |
To kilgoretrout:
After reading your reply,the following is my cognizances: Minor number of 128 symbolizes a limit of "norewind" . The number(128) only shows a beginning of "norewind", which doesn't mean that the pc could connects up to 128 tape devices;it maybe or maybe not. In the other word, if the minor number is 64 (64=/dev/nht0 ,First IDE tape,no rewind-on-close), it doesn't represent that pc could connect up to 64 tape devices. I don't know if my cognizances is correct. :) Thanks for everybody's direction. |
All times are GMT -5. The time now is 07:34 AM. |