LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 11-09-2005, 07:40 AM   #1
superstition
LQ Newbie
 
Registered: May 2005
Posts: 10

Rep: Reputation: 0
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.
 
Old 11-09-2005, 08:02 AM   #2
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 374

Rep: Reputation: 55
Re: how to mount device in SCSI and IDE interface

Quote:
Originally posted by superstition
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.
IDE devices are named according to their interface (bus number,master/slave)
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.
 
Old 11-09-2005, 08:51 AM   #3
superstition
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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.

Last edited by superstition; 11-09-2005 at 08:52 AM.
 
Old 11-09-2005, 11:10 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,334

Rep: Reputation: 144Reputation: 144
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.
 
Old 11-09-2005, 04:35 PM   #5
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 374

Rep: Reputation: 55
Quote:
Originally posted by superstition
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.
I am sorry if i confused you. I told these numbers just to explain how the SCSI naming works.

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.
 
Old 11-09-2005, 06:35 PM   #6
superstition
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 11-09-2005, 11:44 PM   #7
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,334

Rep: Reputation: 144Reputation: 144
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.
 
Old 11-14-2005, 09:47 PM   #8
superstition
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB or LILO boot to SCSI drive on SCSI system w/ IDE card mkl838 Linux - General 1 03-06-2005 10:01 PM
how to mount a IDE Partition as a SCSI disk? alexlihk Linux - Hardware 1 08-02-2004 11:28 AM
Fedora Core 1 SCSI CD-ROM Won't Mount (always get "is not a valid block device") jerrykuch Linux - Hardware 2 04-18-2004 02:02 PM
5th IDE device or SCSI CD-RW? star geezer Linux - Hardware 1 11-17-2003 10:56 AM
bad dmesg output when using ide-scsi boot parameter for IDE CD/DVD-ROM Locura Slackware 7 09-29-2003 03:36 AM


All times are GMT -5. The time now is 09:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration