Search code examples
drawingnfscifs

RAW device export


How can I export a RAW device for database use using NFS or CIFS?


Solution

  • 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...