UNIX File Systems - Devices
(Page 5 of 5 )
In the section on file types, I talked about devices. Now it is time to take a more detailed look at them. You can find all of the devices inside the /dev directory. There are three types of devices. Block devices are the physical ones, like a hard drive or a partition. Character devices contain only a character stream, like the terminal.
Finally, there are pseudo devices. This are not proper devices; they just act like them. One example is /dev/null, which will "eat up" whatever data you throw at it. This is perfect if you want to throw away some text. Just send it to this device and you will never see it again.
A good example of the character device is the /dev/console. As for the block devices, their names are built upon the following rule. The first letter signals the type of the connection. With a hard drive, this is h, or for a device connecting through the serial IDE or SCSI, the letter is s. This is followed by the letter d. The third letter will represent the number of the device, and letters are used.
If you have two devices the, first is a, while the second is b, and so on. At the end of the named device is the number of the partition. Therefore, the /dev/hda1 will point to the first hard drive, and for that, the first partition. The /dev/sdb4 points to the second device, connecting through the serial IDE or SCSI, and on that, the fourth partition.
This will be all for today. Next week we will continue with the right management system, and afterward we will return to file systems and learn even more. There is much more to know, so make sure you do not miss it. If you read my article you can also rate it and put up any questions you may have here on the blog. Thank you for your attention and Live With Passion!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |