Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have no friendly unix admin expert to ask and I'm going cross eyed looking for info on the interworld webnet so I thought I'd give you guys a chance to dazzle with your expertise. I want to understand how a unix system, (Linux in my case), goes through the mechanics of recognising and attaching a disk drive. I've read a lot about the special files in /dev and their major and minor numbers. I thought I'd worked it out when I read that the major number identifies the driver for the specific device and the minor number the commumication port but then I realised that this also relates to partitions on single disks. Can anyone point me at or give me a difinitive explanation of what's going on, how the various bits and pieces bolt together? Cheers.
/dev/hda = master disk on 1st IDE
hdb = slave disk on 1st IDE
hdc = master on 2nd IDE
hdd = slave on 2nd IDE
That's the physical discs. Partitions add another number, so
hda1 = first partition on 1st master hard drive
hda2 = second partition on 1st master hard drive
hdb1 = first partition on 1st slave hard drive
Then you get the SCSI ones, but the basic convention is the same:
/dev/?? = basic device name - hd, sa, sd, etc
a,b,c,etc = order in which the devices are found
1,2,3,etc = partitions on the disk
Hi Oneandoneis2, thanks for you reply. Let me run what I've gleened from the web so far and I stress this is all conjecture on my part. I build a system from scratch. The server automatically locates the disk drive on the first relevant port and installs the boot partition there. After installation is complete I see:
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p3 67945696 12139224 52354996 19% /
/dev/cciss/c0d0p1 51342 14076 34615 29% /boot
none 1971924 0 1971924 0% /dev/shm
If I look at file /dev/ccis/c0d0p1 I see it has a major number of 104 and a minor number of 1. So it's using the driver code identified by 104 and using comms channel 1. The file /dev/ccis/c0d0p3 points to another partition on the same disk using 104 and 3. So if I add a new disk to this machine how does the system know it's there. Is it related to the major minor numbers? Am I barking up the wrong tree?
Mark.
Ah. You're using a SCSI array rather than a nice simple IDE arrangement then
I'm not sure I really understand your question. If you add a new disc, it'll find it when it looks for all the hardware, the same as with any hardware. If you mean how does it assign a disc to a /dev entry, that depends what you're using - udev, devfs, etc.
Incidentally, you might find it worth exploring the /proc/driver/cciss filesystem. . .
To be honest I just plugged the machine in and loaded the O/S using all the defaults from the cd's I didn't know what disks were in there. As you've probably guessed I'm not from this kind of background. I was intrigued as to how the system knows where disks are but that appears to be automatic. This all came about as I was trying to get my head around how the unix filesystem bolted together. I like to try to get a good mental picture of what's going on but rather than getting clearer, the more I looked the cloudier it became. I think I need to go work somewhere where there's a unix admin team. Thanks for your help anyway. Mark.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.