开发者

RAW device export

How can I export a RAW 开发者_如何学运维device for database use using NFS or CIFS?


I remember doing this to fulfill some arcane requirement for an Oracle installation. I figured out how to make this happen but realized that under no circumstance would I want to actually implement this.

That said, if you like making bad choices:

Create an empty file that you're eventually going to expose as a raw device:

   dd if=/dev/zero of=/netapp/ocr/file bs=8k count=50000

Make a raw device:

mknod /dev/raw1 c 162 1

Create a loopback device that points to the file you want to use:

losetup /dev/loop1 /netapp/ocr/file

Bind the raw device to the loopback device:

raw /dev/raw/raw1 /dev/loop1

Produce output that can confirm the raw device is bound correctly:

raw -qa


Short answer: you cannot!

Long answer:

Both NFS and CIFS are designed to handle files, not devices.

Exporting a device node on Unix using NFS will actually refer to a (maybe non-existent) device on the client, as far as the client's kernel is concerned. NFS is also notorious for locking issues that make anything concurrent (including DB transactions) a major problem. ACID on NFS is generally a no-no.

I believe CIFS has limited support for special files as well, although I may be mistaken.

Perhaps your are looking for something like NBD (Network Block Device), DRBD (Distributed Replicated Block Device) or even iSCSI?

http://en.wikipedia.org/wiki/ISCSI

http://en.wikipedia.org/wiki/Network_block_device

http://en.wikipedia.org/wiki/DRBD

Keep in mind that there can be atrocious locking issues if you try to share a raw device to multiple nodes - you'd need to have support for distributed operation and locking all the way up to your database.

You would probably get more help if you explained what you want to do at a higher level...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜