The interfaces of the devices are represented under these two directories.
For example, the interface belonging to the Olympus digital camera is represented by the directory /sys/block/sda/.
The directory sda is the digital camera accessed like a SCSI hard disk.
The following is the content of the sda/ directory:
DA3:~ # ls /sys/block/sda dev queue removable size device range sda1 stat
The subdirectory sda1/ represents the interface to the first partition on the camera's memory card.
For example, by reading the content of /sys/block/sda/sda1/size, you can determine the size of the partition; as shown below:
DA3:~ # cat /sys/block/sda/sda1/size 31959
The partition has a size of 31959 512-byte blocks, which is about 16 MB.
To connect an interface with a device, file system links are used. In the Olympus digital camera example, a link exists from the file /sys/block/sda/device to the corresponding device; as shown below:
DA3:~ # ll /sys/block/sda/device lrwxrwxrwx 1 root root 0 Aug 17 14:03 device ->
Was this article helpful?
Insider Secrets Revealed By the Pro Showing You How to Become a Professional Photographer! Discover The Secret Tips & Techniques On How To Be A Professional Photographer, Start Producing High Quality Pictures and Skyrocket Your Photography Business Income Revenue To The Roof TODAY! You're About to Discover the Powerful Strategies and Method to Start Taking Sharp, Clear and High Quality Pictures Like the Professional Photographer Without Paying a Single Penny to the Expert!