Chapter B20: Media
 
Goals for this chapter: rpm packages covered in this chapter: 
  • dev (/dev/*)
  • MAKEDEV  (MAKEDEV)
  • mount (mount
  • mt-st (mt)
  • eject (eject)
  • fdutils (/dev/MAKEFLOPPIES)
 

The "file devices"

In the setup phase, Linux installs several types of files connected to the system devices. There are 2281 files present in the "/dev" directory, in RedHat Linux.

UNIX, and therefore Linux, manages the hardware installed in the system through these "devices" files that correspond to the installed hardware or to the hardware to be installed.

Unlike operating systems like DOS (Disk Operating System) that assign an alphabetic letter to each disk, using letters "A" or "B" for floppy disks and the letters from "C" to "Z" for fixed disks, including CD-ROMs, removable disks, network disks; Linux makes and assigns files for all the devices installed on the system.

For example, for the Hard Disk, "hd", the following file devices are present:

[root@heaven /dev]# l hd
hda    hda13  hda4   hda9   hdb12  hdb3   hdb8   hdc11  hdc2   hdc7   hdd10  hdd15  hdd6   hdf
hda1   hda14  hda5   hdb    hdb13  hdb4   hdb9   hdc12  hdc3   hdc8   hdd11  hdd2   hdd7   hdg
hda10  hda15  hda6   hdb1   hdb14  hdb5   hdc    hdc13  hdc4   hdc9   hdd12  hdd3   hdd8   hdh
hda11  hda2   hda7   hdb10  hdb15  hdb6   hdc1   hdc14  hdc5   hdd    hdd13  hdd4   hdd9
hda12  hda3   hda8   hdb11  hdb2   hdb7   hdc10  hdc15  hdc6   hdd1   hdd14  hdd5   hde
[root@heaven /dev]# l hd

As we explained in the previous chapters, the letters "a", "b", "c", "d" and "e" are assigned in that order on the installed hard disk in the machine, or on the hard disk that will be installed in the future.

So the first hard disk in the system will be "hda". The first partition on the first disk will be "hda1" while the fourth partition on the second disk will be "hdb4".

As you can read, the file for partition number 10, "hdd10", is listed on the fourth disk (d), which is generally not present in the system.

This means that the system includes all the possible devices. If you need to use hardware that doesn't have a device file, you have to create it manually with the "mknod" program.

The installed device file has been made during the installation phase starting from its "major" and "minor" numbers assigned by the hardware.

For example, the major numbers for the file device relative to the serial and parallel ports are respectively 5 and 6, while the minor numbers are the ordered numbers in the second column.

[root@heaven /dev]# ll lp[0-3] cua[0-3]
crw-rw----   1 root     uucp       5,  64 Aug 19 08:22 cua0
crw-rw----   1 root     uucp       5,  65 Aug 19 08:22 cua1
crw-rw----   1 root     uucp       5,  66 Aug 19 08:22 cua2
crw-rw----   1 root     uucp       5,  67 Aug 19 08:22 cua3
crw-rw----   1 root     lp         6,   0 Aug 19 08:22 lp0
crw-rw----   1 root     lp         6,   1 Aug 19 08:22 lp1
crw-rw----   1 root     lp         6,   2 Aug 19 08:22 lp2
[root@heaven /dev]#

Another way to display the major and minor number is to use the program "file" :

[root@heaven /dev]# file lp0 hda1
lp0:  character special (6/0)
hda1: block special (3/1)
[root@heaven /dev]# ^file^ll
ll lp0 hda1
brw-r-----   1 root     operator   3,   1 Aug 19 08:22 hda1
crw-rw----   1 root     lp         6,   0 Aug 19 08:22 lp0
[root@heaven /dev]#

To create these files you can consult the documentation "info" about "mknod", inserting the relative "major" and "minor" numbers.
 

`mknod': Make block or character special files
==============================================

   `mknod' creates a FIFO, character special file, or block special
file with the specified name.  Synopsis:

     mknod [OPTION]... NAME TYPE [MAJOR MINOR]

   Unlike the phrase "special file type" above, the term "special file"
has a technical meaning on Unix: something that can generate or receive
data.  Usually this corresponds to a physical piece of hardware, e.g.,
a printer or a disk.  (These files are typically created at
system-configuration time.)  The `mknod' command is what creates files
of this type.  Such devices can be read either a character at a time or
a "block" (many characters) at a time, hence we say there are "block
special" files and "character special" files.

   The arguments after NAME specify the type of file to make:

`p'
     for a FIFO

`b'
     for a block (buffered) special file

`c'
     for a character (buffered) special file

`u'
     for a character (unbuffered) special file

   When making a block or character special file, the major and minor
device numbers must be given after the file type.

   The program accepts the following option.  Also see *Note Common
options::.

`-m MODE'
`--mode=MODE'
     Set the mode of created files to MODE, which is symbolic as in
     `chmod' and uses 0666 minus the bits set in the umask as the point
     of departure.  *Note File permissions::.
 

RedHat includes the program "MAKEDEV" to install new file devices.

We have also included the program "tpqic02-support-1.9b.tar.g", in the dir "ExternalContribs/Sunsite/pub/Linux/kernel/tapes" that includes some programs for setting up tape models like Wangtek, Emerald, Archive and Mountain.

These files are included for the purpose of inserting new file devices not included in the 1036 files after the installation.

In you have trouble creating the necessary device file for setting up new hardware because you don't know the major/minor numbers, you can contact the hardware vendor or RedHat Systems.

In the directory "/dev" we can find files for any kind of interface:

All these files are managed by the installed kernel and are listed in the file "devices.txt", present in the directory "/usr/src/linux/Documentation". These files include the major numbers for the most important devices.

We advise to setup the following symbolic links:

/dev/mouse      mouse port      symbolic        Current mouse device
/dev/tape       tape device     symbolic        Current tape device
/dev/cdrom      CD-ROM device   symbolic        Current CD-ROM device
/dev/cdwriter   CD-writer       symbolic        Current CD-writer device
/dev/scanner    scanner         symbolic        Current scanner device
/dev/modem      modem port      symbolic        Current dialout device
/dev/root       root device     symbolic        Current root file system
/dev/swap       swap device     symbolic        Current swap device

Some of these links can be made in the installation phase.

The "char" and "block" devices

Practically all the devices can be classified in two important file device families:

You can find out which type a device is with a simple "ls" command. The type is the letter at the beginning; "c" for character (such as cua0 and lp0 -- the serial and parallel ports), and "b" for block files like the SCSI and IDE disks.

[root@heaven /dev]# ls -al  lp0 cua0 hda1 sda   | sort -r
crw-rw----   1 root     uucp       5,  64 Aug 19 08:22 cua0
crw-rw----   1 root     lp         6,   0 Aug 19 08:22 lp0
brw-r-----   1 root     operator   8,   0 Aug 19 08:22 sda
brw-r-----   1 root    operator   3,   1 Aug 19 08:22 hda1
[root@heaven /dev]#
 

"hd", "sd" and "fd"

The best representatives of block family devices are "IDE-EIDE hard disks", hd, SCSI disks, sd and floppy disks, fd.

[root@heaven /dev]# ls hd* sd* fd*
fd0        fd0u1760   fd1h410    fd1u820    hdb11      hdc2       hdd7       sda8       sdc11      sdd2
fd0CompaQ  fd0u1840   fd1h420    fd1u830    hdb12      hdc3       hdd8       sda9       sdc12      sdd3
fd0H1440   fd0u1920   fd1h720    hda        hdb13      hdc4       hdd9       sdb        sdc13      sdd4
fd0d360    fd0u2880   fd1h880    hda1       hdb14      hdc5       hde        sdb1       sdc14      sdd5
fd0h1200   fd0u3200   fd1u1040   hda10      hdb15      hdc6       hdf        sdb10      sdc15      sdd6
fd0h1440   fd0u3520   fd1u1120   hda11      hdb2       hdc7       hdg        sdb11      sdc2       sdd7
fd0h1476   fd0u360    fd1u1440   hda12      hdb3       hdc8       hdh        sdb12      sdc3       sdd8
fd0h1494   fd0u3840   fd1u1600   hda13      hdb4       hdc9       sda        sdb13      sdc4       sdd9
fd0h1600   fd0u720    fd1u1680   hda14      hdb5       hdd        sda1       sdb14      sdc5       sde
fd0h360    fd0u800    fd1u1722   hda15      hdb6       hdd1       sda10      sdb15      sdc6       sdf
fd0h410    fd0u820    fd1u1743   hda2       hdb7       hdd10      sda11      sdb2       sdc7       sdg
fd0h420    fd0u830    fd1u1760   hda3       hdb8       hdd11      sda12      sdb3       sdc8       sdh
fd0h720    fd1        fd1u1840   hda4       hdb9       hdd12      sda13      sdb4       sdc9       sdi
fd0h880    fd1CompaQ  fd1u1920   hda5       hdc        hdd13      sda14      sdb5       sdd        sdj
fd0u1040   fd1d360    fd1u2880   hda6       hdc1       hdd14      sda15      sdb6       sdd1       sdk
fd0u1120   fd1h1200   fd1u3200   hda7       hdc10      hdd15      sda2       sdb7       sdd10      sdl
fd0u1440   fd1h1440   fd1u3520   hda8       hdc11      hdd2       sda3       sdb8       sdd11      sdm
fd0u1600   fd1h1476   fd1u360    hda9       hdc12      hdd3       sda4       sdb9       sdd12      sdn
fd0u1680   fd1h1494   fd1u3840   hdb        hdc13      hdd4       sda5       sdc        sdd13      sdo
fd0u1722   fd1h1600   fd1u720    hdb1       hdc14      hdd5       sda6       sdc1       sdd14      sdp
fd0u1743   fd1h360    fd1u800    hdb10      hdc15      hdd6       sda7       sdc10      sdd15

For IDE/EIDE or SCSI hard disk operation, this is clear. Unlike these, floppies depend on the format of the floppy.

For example, for the device file "fd0H1440" we have:

Similarly for the file device "fd1d360" : The oldest floppy disk was used in the first years of the 70s and continues to be supported in all the Linux distributions, so we can guarantee support and compatibility with these old devices.

A floppy disk under Linux can be formatted with the "fdformat" command:

[root@heaven /dev]# fdformat /dev/fd0
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
Verifying ... done
[root@heaven /dev]#

As you can see, we don't use the specific device (fd0H1440) because Linux knows the type in advance.

Under Linux  it's also possible to format hard disk.

The "tty"

Linux, like UNIX, manages communication between the user and the system with I/O devices. All these devices under Linux correspond to the "/dev/tty" files, also called "tty".

The word "tty" means "teletype"; these terminals were slow printers, built by the Teletype Corporation.

These files belong to the "char" family as we can see from the "ls" list :

[root@heaven /dev]# ll tty[0-6]
crw-rw----   1 root     root       4,   0 Nov 22 05:56 tty0
crw--w----   1 root     tty        4,   1 Nov 22 15:09 tty1
crw-------   1 root     tty        4,   2 Nov 22 05:56 tty2
crw-------   1 root     tty        4,   3 Nov 22 05:56 tty3
crw-------   1 root     tty        4,   4 Nov 22 05:56 tty4
crw-------   1 root     tty        4,   5 Nov 22 05:56 tty5
crw-------   1 root     tty        4,   6 Nov 22 05:56 tty6
[root@heaven /dev]#

When the system boots by "default" under RedHat Linux, level number 3 (Multi-User) enters into the "init" as we can see in the file "/etc/inittab" (See Chapter 22. Boot and shutdown)

[root@heaven /dev]# more /etc/inittab | grep getty
# Run gettys in standard runlevels
1:12345:respawn:/sbin/getty tty1 VC linux
2:2345:respawn:/sbin/getty tty2 VC linux
3:2345:respawn:/sbin/getty tty3 VC linux
4:2345:respawn:/sbin/getty tty4 VC linux
5:2345:respawn:/sbin/getty tty5 VC linux
6:2345:respawn:/sbin/getty tty6 VC linux
[root@heaven /dev]#

After any terminal console, from "ALT-F1" to "ALT-F6", there's assigned a corresponding "tty". So "tty1" corresponds to "ALT-F1" and "ALT-F6" corresponds to "tty6".

If we run the command "tty" without any other parameter, the program prints the communication port from where it is interacting with the system.

[root@heaven /root]# tty
/dev/tty4

If we run this command from the graphical X-Window environment, the "tty" will be the pseudo-tty, in other words the virtual terminal assigned automatically by the system.

Running the command "ps" without parameters, we see the actual activated "TTY" channels in the second column.

[root@heaven /root]# ps
  PID TTY STAT TIME COMMAND
  627   1 S    0:00 (login)
  628   2 S    0:00 (getty)
  629   3 S    0:00 (getty)
  630   4 S    0:00 login root
  631   5 S    0:00 (getty)
  632   6 S    0:00 (getty)
  633   1 S    0:00 (bash)
  659   1 S    0:00 (xinit)
  660   1 S    1:57 X:0
  661   1 S    0:00 (startkde)
  677   1 S    0:00 kaudioserver
  678   1 S    0:00 kwmsound
  679   1 S    0:00 kfm
  681   1 S    0:00 kbgndwm
  682   1 S    0:00 krootwm
  683   1 S    0:02 kpanel
  684   1 S    0:25 kwm
  685   1 S    0:00 maudio -media 1
  696  p0 S    0:00 (bash)
  720   1 S    0:00 /opt/kde/bin/kforest.kss -delay 10 -install -corners iiii -nice 0
  723   1 S    7:06 /opt/netscape/netscape
  724   1 S    0:00 (dns helper)
  922   1 S    0:06 kvt -T Terminale
  923  p1 S   0:00 bash
 1769   1 S    0:00 kvt -T Terminale
 1770  p2 S    0:00 bash
 2012  p2 S    0:00 mc --color
 2014  p3 S    0:00 bash -rcfile .bashrc
 2229   4 S    0:00 -bash
 2261   1 S    0:00 kvt -T Terminale
 2262  p4 S    0:00 bash
 2274   1 S    0:00 kvt -T Terminale
 2275  p5 S    0:00 bash
 2287   1 S    0:00 kvt -T Terminale
 2288  p6 S    0:00 bash
 2300  p6 S    0:00 vi
 2301  p4 S    0:00 top
 2302   1 S    0:00 kvt -T Terminale
 2303  p7 S    0:00 bash
 2315  p7 S    0:00 mc --color
 2317  p8 S    0:00 bash -rcfile .bashrc
 2329  p5 S    0:00 /usr/visix/lg/lg
 2330  p5 S    0:00 fss
 2331  p1 R    0:00 ps
[root@heaven /root]#

The memory devices

In the "devices.txt" file we find that the memory devices are the following:

  1 char        Memory devices
                  1 = /dev/mem          Physical memory access
                  2 = /dev/kmem         Kernel virtual memory access
                  3 = /dev/null         Null device
                  4 = /dev/port         I/O port access
                  5 = /dev/zero         Null byte source
                  6 = /dev/core         OBSOLETE - replaced by /proc/kcore
                  7 = /dev/full         Returns ENOSPC on write
                  8 = /dev/random       Nondeterministic random number gen.
                  9 = /dev/urandom      Faster, less secure random number gen.
 

Each of these files as listed in the previous table has a specific task in the system. The physical memory is present in the "/dev/mem" file. The "/dev/kcore" file represents the memory size.

For further information we can run the command "man mem".

The "/dev/null" file represents infinite trash. This means that any file that you append to this file will disappear.

[root@heaven /root]# cat /etc/passwd > /dev/null
[root@heaven /root]# more /dev/null
[root@heaven /root]#

In fact this is a special file.

[root@heaven /root]# file /dev/null
/dev/null: character special (1/3)
[root@heaven /root]#
 

Creating new devices

The major and minor numbers

Like we explain before (i.e Chapter 11 or section devices before) , UNIX and now Linux enumerate device by numbers: eth0, eth1, ... or video0, video1, video2, ... or fd0, fd1, etc.

For example for Harddisk, we have:

[root@ftosx1 /dev]# ls -al hda9
brw-rw----    2 root     disk       3,   9 May  5  1998 hda9
[root@ftosx1 /dev]#

Now, we know that the "b" in front of the filename means "block" (see before), and also that each file was create in May 5 1998, but what means the numbers "3,   9" on the file "hda9"?

These numbers are called "Major and Minor numbers"!

These numbers are also listed in the file "devices.txt" created and maintained by H. Peter Anvin

Numbers for devices are called "major numbers". For example for SCSI disk the major number is "8".

[root@ftosx1 /dev]# ls -al sda
brw-rw----    2 root     disk       8,   0 May  5  1998 sda
[root@ftosx1 /dev]#

[root@ftosx1 /dev]# ls -al hda*
brw-rw----    2 root     disk       3,   0 May  5  1998 hda
[root@ftosx1 /dev]#

Once the device is identified, for example "hda", with this major number "8" ... is possible to start to enumarate the device family (that belong to this major). Minor numbers starts from 0, on the device.

[root@ftosx1 /dev]# ls -al hda*
brw-rw----    2 root     disk       3,   0 May  5  1998 hda
[root@ftosx1 /dev]#

and then are 1, 2, 3, ... until is necessary. For example,  for "/dev/hda" we have

[root@ftosx1 /dev]# ls -al /dev/hda* | sort
brw-rw----    2 root     disk       3,   0 May  5  1998 /dev/hda
brw-rw----    2 root     disk       3,   1 May  5  1998 /dev/hda1
brw-rw----    2 root     disk       3,   2 May  5  1998 /dev/hda2
brw-rw----    2 root     disk       3,   3 May  5  1998 /dev/hda3
brw-rw----    2 root     disk       3,   4 May  5  1998 /dev/hda4
brw-rw----    2 root     disk       3,   5 May  5  1998 /dev/hda5
brw-rw----    2 root     disk       3,   6 May  5  1998 /dev/hda6
brw-rw----    2 root     disk       3,   7 May  5  1998 /dev/hda7
brw-rw----    2 root     disk       3,   8 May  5  1998 /dev/hda8
brw-rw----    2 root     disk       3,   9 May  5  1998 /dev/hda9
brw-rw----    2 root     disk       3,  10 May  5  1998 /dev/hda10
brw-rw----    2 root     disk       3,  11 May  5  1998 /dev/hda11
brw-rw----    2 root     disk       3,  12 May  5  1998 /dev/hda12
brw-rw----    2 root     disk       3,  13 May  5  1998 /dev/hda13
brw-rw----    2 root     disk       3,  14 May  5  1998 /dev/hda14
brw-rw----    2 root     disk       3,  15 May  5  1998 /dev/hda15
brw-rw----    2 root     disk       3,  16 May  5  1998 /dev/hda16
[root@ftosx1 /dev]#

and we can read that the minor numbers (like "sons") in sequence. This is the simple and clear rule!.

This is valid for any device, for example for the video the number is "81"!

[root@ftosx1 /root]# cd /dev
[root@ftosx1 /dev]# ls -al video
lrwxrwxrwx    1 root     root            6 Sep 23 14:59 video -> video0
[root@ftosx1 /dev]# ls -al video0
crw-------    1 gorlando root      81,   0 Jan 28  2000 video0
 

[root@ftosx1 /dev]# ls -al video*
lrwxrwxrwx    1 root     root            6 Sep 23 14:59 video -> video0
crw-------    1 gorlando root      81,   0 Jan 28  2000 video0
crw-------    1 gorlando root      81,   1 Jan 28  2000 video1
 
 

The command "mknod"

You can create a new device on Linux running the command "mknod".

For example if you want to connect a third video camera, you need to create a "new" device: "video2". Remember video0 is for the video camera #1". Devices start from 0.
 

[root@ftosx1 /dev]# mknod /dev/video c 81 2
mknod: /dev/video: File exists
[root@ftosx1 /dev]# mknod /dev/video2 c 81 2
[root@ftosx1 /dev]# ls -al video*
lrwxrwxrwx    1 root     root            6 Sep 23 14:59 video -> video0
crw-------    1 gorlando root      81,   0 Jan 28  2000 video0
crw-------    1 gorlando root      81,   1 Jan 28  2000 video1
crw-r--r--    1 root     root      81,   2 Feb 18 15:41 video2
[root@ftosx1 /dev]# l

If you write a new device driver for some special medical peripheral, and you want that Linux handle this device, then you (or the device mantainer) need to assign a number.

Like explained in the the files "devices.txt", the maximun number of devices for Linux is: 255.

Actual range number available for new devices is:

Some FileSystem Types on Linux

The old D.O.S. (Disk Operating System), the Windows 95/98/2000 VFAT, the original ext2, developed by Theodore T'so, the new ReiserFS, developed by Hans Reiser,  the HFS for the Mac, the UFS for the latest MacOSX (beta), the old System V, the ISO9660 for the CD, the UDF for the DVD-R, ... are only some examples about the different filesystem types.

We present here the "Filesystem chapter" included in Linux Kernel 2.4.1:





You need to recompile the kernel or load the relative module to support a specific filesystem type. Is very important that you know all the filesystems type, because there are different and are everyday you must create, or mount or dump a specific filesystem.

The command "mount"

When the system boots "mount" the hard disk, there is installed the Linux operating system in the directory "/" as we can see in the first line of the "/etc/fstab" file.

[root@heaven /root]# more /etc/fstab
/dev/hda3 / ext2 defaults 0 1
/proc /proc proc defaults 0 0
/dev/hda5 none swap defaults 0 0
#
/dev/fd0 /mnt/floppy ext2 defaults,noauto 0 0
#
/dev/hdb /mnt/cdrom iso9660 ro,noauto 0 0
/dev/hda1       /mnt/w95        msdos rw 0 2
/dev/hda2       /mnt/nt msdos rw 0 2
earth:/var/spool/fax    /mnt/earth      nfs     soft,bg,intr,nodev,nosuid,rw 0 0
[root@heaven /root]#

In this are listed all the File Systems that the system mounts in the start up process.

The device file representing blocks like floppy disks, hard disks, CD-ROMs, SCSI disks can be mounted at any time with the "mount" command.

For example, DVD-ROM media can be mounted on our CD-ROM SCSI unit, like a CD, with the command:

[root@heaven /root]# mount -t iso9660 /dev/sr0 /mnt/pd
mount: block device /dev/sr0 is write-protected, mounting read-only

When we run the command "mount", we have to specify the File System type to mount: msdos, vfat, nfs, iso9660, etc. The device file that represents the hardware device on the system is the first SCSI CD-ROM, "/dev/sr0" and the mounting point on the system:

[root@heaven /root]# cd /mnt/pd
[root@heaven pd]# ls
audio_ts  video_ts
[root@heaven pd]#

where we will find the information.

The DVD-ROM format of the last example is not supported at the moment on Linux. In the meantime, we use the ISO9660 format. This is the reason why we mount the DVD using the ISO9660 File system type.

This format allows you to have on average a higher capacity than on a CD-ROM!

In fact,running the command "disk free", "df", we obtain :

[root@heaven /root]# df -h
Filesystem            Size  Used  Avail  Capacity Mounted on
/dev/hda3             4.7G  2.5G   2.0G     55%   /
/dev/hda1            1004M  106M   898M     11%   /mnt/w95
/dev/hda2            1004M  198M   805M     20%   /mnt/nt
/dev/sr0              7.7G  7.7G      0    100%   /mnt/pd
[root@heaven /root]#

Another command that belongs to the same family is the "disk usage" command, "du", that lets you find out how much space has been used on a disk or a single directory. For example, the device file uses a space of 51K :

[root@heaven /dev]# du -hs .
51K     .
[root@heaven /dev]#

The directory "/etc" uses the following disk space:

[root@heaven /]# du -hs /etc
1.8M    /etc
[root@heaven /]#

The option '-h' human readable is very useful. The option '-s' used with the program "du" allows to print only totals (the sum) of disk usage.

After installation, RedHat Linux makes two directories on "/mnt"

Generally, all the file systems are mounted on the directory "/mnt", whatever their type: "nfs" disk, Windows95 or NT partitions, DOS partitions, etc..
Both these directories are present in the "/etc/fstab" file:

[root@heaven /root]# more /etc/fstab | grep mnt
/dev/fd0 /mnt/floppy ext2 defaults,noauto 0 0
/dev/hdb /mnt/cdrom iso9660 ro,noauto 0 0

The word "noauto" means that the device will not be mounted during the boot phase.

Now, to mount a CD-ROM, the operation is very simple, you only have to run the command :

[root@heaven /root]# mount /mnt/cdrom

The command "mount" checks the File System table "/etc/fstab" and afterwards mounts the device.

The same is valid for a floppy whose type is "ext2" (Linux).

All these devices can be managed and mounted because there is a file system on the media. So, the CD-ROMs are written with a CD-writer that makes a file system of type iso9660 on the CD. DOS floppies can have a DOS filesystem simply by formatting the floppy in DR-DOS, PC-DOS, WINDOW 3.x, or others, and read on Linux.

To unmount a file system, you can run the command :

[root@heaven /root]# umount /mnt/cdrom

Before running the command "umount" it is necessary to verify that no users are logged in on the mounted file system. If you try to unmount the file system while a user is logged in, the "umount" command fails.

In any event, all the file systems are unmounted when the system shuts down.

The "mounting" situation can be listed by running the "mount" command without parameters.

[root@heaven /root]# mount
/dev/hda3 on / type ext2 (rw)
/proc on /proc type proc (rw)
/dev/hda1 on /mnt/w95 type msdos (rw)
/dev/hda2 on /mnt/nt type msdos (rw)
heaven:(pid446) on /auto type auto (intr,rw,port=1023,timeo=8,retrans=110,indirect,map=/etc/amd.localdev)
[root@heaven /root]#

All the File Systems mounted on the system are listed in the "/etc/mtab" file.

[root@heaven /root]# more /etc/mtab
/dev/hda3 / ext2 rw 0 1
/proc /proc proc rw 0 0
/dev/hda1 /mnt/w95 msdos rw 0 2
/dev/hda2 /mnt/nt msdos rw 0 2
heaven:(pid446) /auto auto intr,rw,port=1023,timeo=8,retrans=110,indirect,map=/etc/
amd.localdev 0 0
[root@heaven /root]#

For example if we your system support the ReiserFS, then you will see a screen like the following:

[root@ftosx1 base]# mount
/dev/hda2 on / type reiserfs (rw,notail)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
automount(pid400) on /misc type autofs (rw,fd=5,pgrp=400,minproto=2,maxproto=3)
[root@ftosx1 base]#