Linux Devices – Part III

Linux Devices – Part III

The /dev directory in Linux can be something of a mystery. Enigmatic references and all, it’s critical to understand the structure of the /dev directory in order to more fully understand the operation of your Linux system. In particular, understanding the /dev directory goes a long way toward understanding how Linux utilizes its available hardware resources.

Today, we’ll continue to move through the common device files in the /dev directory, picking up where we left off yesterday.

/ht0: If your machine has an IDE tape drive for backup, /dev/ht0 is the related device file. As with other device files, multiple tape drives will be numbered ht1, ht2, etc.

/js0: Some old-timers would still consider it heresy to play shoot ’em up games in Linux. Ah, well. I guess Ludditism can exist by degrees. The /js0 device file makes those daring escapist adventures possible by providing a reference for your joystick.

/lp0: /dev/lp0 is the home of your [l]ocal [p]rinter.

/loop0: I find myself using this device file more often lately. /loop0 is the loopback device. It’s purpose is to provide a mount for filesystems that are not located on other block devices. Sound confusing? My recent usage of /loop0 may help explain its use. When I create an iso image using mkisofs, I like to test the image prior to burning it to CD. That way, I can check the integrity of my backups and recreate the image, if necessary, without creating shiny coasters. The loopback device makes this possible, using the command:

    mount -o loop image name /mnt/cdrom

In other words, I mount the iso image on the cdrom drive, as if it were an actual cdrom. I can then ls the /mnt/cdrom directory and/or handle the files in the image just as though they had already been burned to disk. /loop0 is the device file that makes this possible.

/md0: /md0 is the [m]eta [d]isk group device file. A meta disk group is the genesis of RAID (Redundant Array of Independent Disks). RAID is used for backup, disaster recovery, or decreased disk access time, depending on the number of drives and configuration. There are several reconginzed RAID levels, each meeting one or some combination of these goals. A thorough discussion of RAID is best left for another series, but know that /md0 is the single device file that defines a cluster of RAID-related drives – a meta disk group.

Tomorrow, we’ll look at device files representing mice, sound and nothing.