裸裝置與塊裝置的區別

wmlm發表於2011-11-30

raw device 與 block device有什麼區別呢?

以下內容引自 401132.1 文件
•What is a raw device?
Raw device are character devices...

[@more@]

•What is a raw device?
Raw device are character devices which allows byte level access to the device. Character devices (/dev/raw/raw9) are *UN-BUFFERRED** devices. This means that there is not need to pass attributes like O_DIRECT when accessing character devices since all I/O is unbufferred IO.

•What is block device?
Block devices provide block level access to the device. Block devices unlike character devices (/dev/sde9) are **BUFFERED** devices. This means the application program has to explicitly pass the O_DIRECT attribute to turn off caching. If the O_DIRECT attribute is not passed, I/O will be cached (linux buffer cache).

•How are raw devices created?
On linux, raw devices have to be created before it can be used. This is done by mapping the block device to the raw device by adding an entry in the /etc/sysconfig/rawdevices file and bind the mapping. Detailed instructions are in the Oracle installation guide.

•So which one (RAW or Block) is recommended?
Oracle 10g supports both raw devices and block devices for OCR, Voting disk & Database files so it is really a matter of choice. Raw devices need to be manually created each time a new file needs to be added. There is no performance benefits of Raw devices versus Block devices or vice versa. It should be pointed out that Linux vendors are planning on removing raw devices from future linux distributions and hence for the long term, Customers may want to go with block devices.

在oracle10g中,如果要使用塊裝置做為ocr/votedisk,需要費一下週折。其出發點是先使用裸裝置符號,其後再去更換;
而在更換過程中要小心,可能會毀了OCR。
具體參考 390880 文件
OCR Corruption after Adding/Removing voting disk to a cluster when CRS stack is running [ID 390880.1]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-1056634/,如需轉載,請註明出處,否則將追究法律責任。

相關文章