Posted in Debian/Ubuntu Howto Linux

GNBD on Debian installation howto

June 30, 2009 - 2 comments

GNBD is some kind of alternative to iSCSI and to a (much) lower extent to sshfs or other filesharing systems (NFS, Samba, etc.).

Unlike iSCSI, there’s no authentication or such, I invite you to read the documentation to learn more about GNBD.

Server (server.example.org) :

Optional : Create a test filesystem

dd if=/dev/zero of=/home/disk bs=1M count=1000
losetup -f (find the next available loop device)
losetup /dev/loop0 /home/disk
mkfs.ext3 -j /dev/loop0

Install GNBD on the server and start :

apt-get install gnbd-server
/etc/init.d/gnbd-server start or gnbd-server -n

Export the device :

gnbd_export -d /dev/loop0 -e DISK -c

Replace /dev/loop0 by any device on your system you want to share (eg : /dev/sda2).
DISK will be the name of the exported device.

List the current exported drives :

gnbd_export

Client

Install GNBD on the client (client.example.org) :

apt-get install gnbd-client redhat-cluster-modules-2.6.26-2-686
(pick the package matching your architecture)

modprobe gnbd

List exports on the server from the client :

gnbd_import -e server.example.org -n

Create the device for the shared drive on the client :

gnbd_import -i server.example.org -n

This will result in a new device available under /dev/gnbd/DISK

Mount the device :

mount /dev/gnbd/DISK /mnt/DISK

Done !

Sources :

Linux Magazine France118 and Vincent ;-)

Comments

Errorcode408

July 3, 2009 - 10:26

Hi,

nice Articles you got here!

Do you know if GNDB can be used to get Live Migration working with XEN/VMware which needs shared storage?

Greetings,

Errorcode408

Sébastien Wains

July 3, 2009 - 13:17

Haven’t tried that yet unfortunately. If you find out, please let me know :)

Leave Comment

Please consider visiting the partners below if you enjoyed this article :

If this post saved you time and money, please consider checking my Amazon wishlist.

Before submitting, some rules :
- Is your comment related to the article ?
- You're having a problem ? Have you checked Google, other howtos, docs, manpages ?
- You're still having the problem ? Have you raised log verbosity, checked traces, ran tcpdump ?
- Have you checked your configuratoin for typo ?
Unless your comment is providing additional info or respect the rules above, DON'T comment.
If you don't understand what you are doing, I urge you to read the documentation, I'm not your free Level 1 helpdesk guy.