In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to understand the character devices and block devices in the AIX shared disk, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
AIX 6.1, Oracle 11.2.0.1, ASM
When configuring ASM shared disks, you can see that there are many hdiskn and rhdiskn devices under / dev through lspv, so be sure to use / dev/rhdiskn instead of / dev/hdiskn when using hdiskn as the shared disk, because rhdiskn is a character device and hdiskn is a block device.
So what is the specific difference between / dev/hdisk and / dev/rhdisk?
Devices in the system that can access fixed-size slices (chunks) randomly (not in order) are called block devices, and these slices are called blocks. The most common block device is the hard disk, in addition to floppy disk drives, CD-ROM drives, flash memory, and many other block devices. Note that they are all used by mounting the file system-- this is also the general way to access block devices.
Another basic type of device is a character device. Character devices are accessed in an orderly manner according to the character stream, such as serial ports and keyboards. If a hardware device is accessed as a character stream, it should be classified as a character device; conversely, if a device is accessed randomly (unordered), it belongs to a block device.
The fundamental difference between these two types of devices is whether they can be accessed randomly-in other words, whether they can jump from one location to another at will when accessing the device. For example, a device like a keyboard provides a data stream, and when you type the string "fox", the keyboard driver returns the three-character data stream in exactly the same order as the input. It doesn't make sense for keyboard drivers to read strings or other characters out of order. So the keyboard is a typical character device, which provides the character stream that the user inputs from the keyboard. Reading the keyboard results in a stream of characters, first "f", then "o", then "x", and finally the end of the file (EOF). When no one taps the keyboard, the character stream is empty. The situation with hard disk devices is different. The driver of a hard disk device may require reading the contents of any block on the disk, and then turn to read the contents of another block, and the position of the read block on the disk is not necessarily continuous, so the hard disk can be accessed randomly, not by stream, obviously it is a block device.
Kernel management block devices are much more detailed than managing character devices, and the problems that need to be considered and the work done are much more complex than character devices. This is because the character device only needs to control one position-the current location-and the location accessed by the block device must be able to move back and forth between different intervals of the media. So in fact, the kernel does not need to provide a special subsystem to manage character devices, but the management of block devices must have a special subsystem to provide services. Not only because the complexity of the block device is much higher than that of the character device, but also because the block device requires high execution performance; each extra utilization of the hard disk will improve the performance of the whole system, and its effect is much greater than that of the keyboard. In addition, we will see that the complexity of block devices leaves a lot of room for this optimization.
In a nutshell, block devices can be accessed randomly, while character devices cannot be accessed randomly. What about bare devices?
Can't bare devices, such as disk bare devices, be read at random? Then use a bare device to build a 2g data file in the database, and in order to access the last data block, does Oracle have to read all the previous data blocks, which obviously does not accord with the facts? if it is explained in this way, the operating system can not be read randomly, it does not mean that the database can not be read randomly.
Block devices are read through the system cache, not directly from the physical disk. Character devices can be read directly from the physical disk. Does not go through the system cache. (such as keyboard, interrupt directly
After reading the above, do you have any further understanding of how to understand character devices and block devices in AIX shared disks? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.