Hi Chi; Well, normally you don't "mount" a "device". Normally you mount a partition that has a file system on it, provided that the kernel has that filesystem's kernel module loaded. Other devices can be directly access via the kernel, but traditionally partitions and filesystems are "mounted."
First the kernel has to detect the device and it's respective entry is added to the /dev tree. At this point it's just a device file and the kernel owns it. So in terms of say a SCSI disk, the kernel detects it at boot as /dev/sda for example, with a partition of /dev/sda1. When you want to use a device, you must have access to the device, as well as have permission to actually use it. So, in most cases root must perform these mounts. At this point, you can ask the kernel via the mount command, to map a directory mount point, say /mnt/disk to the device, /dev/sda1, i.e. mount /dev/sda1 /mnt/disk. When this happens the kernel queries the partition for it's type, and if it has the correct kernel module, it completes the mount. The kernels known filesystems are typically written to /etc/filesystems. As a result of the completed mount request, a piece of kernel memory is reserved for tracking the mount, it is viewable via /etc/mtab, which is simply a link to the /proc/mounts kernel space. And there is some kernel locking involved too. (this is a lengthy subject in and of it's self.) There is a whole lot more information in /usr/src/linux/Documentation/filesystems This note probably did not do the whole process true justice, but it's a start. More information is available via the man pages or via: http://linux.die.net/man/5/proc http://linux.die.net/man/5/filesystems Great stuff on ext3 here from IBM: (It's a little old, but still great detail) http://www.ibm.com/developerworks/library/l-fs7.html http://www.ibm.com/developerworks/library/l-fs8.html This only scratches the surface... I hope it's helpful.. Cheers; E! > > Hello fellow avid linux users, > > My name is Chi, and I am Scott's linux "apprentice", so please expect > some of my posts to be rather rudimentary - thanks & I'd appreciate > any of your valuable advice and tutelage as a linux newbie. > > I recently learned about devices, types, and mounting them. What > physically happens when a device is "mounted"? Does it just get a > directory location, or is it somehow "activated?" Also, what role does > a filesystem play in this? > > Thanks for your help, > > > ~Chi Zeng > > > > --~--~---------~--~----~------------~-------~--~----~ Central West End Linux Users Group (via Google Groups) Main page: http://www.cwelug.org To post: [email protected] To subscribe: [email protected] To unsubscribe: [email protected] More options: http://groups.google.com/group/cwelug -~----------~----~----~----~------~----~------~--~---
