[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] about nbd not work correctly



Thank you very much. 
Please let me confirm it. 
1.I can use it as a data block.
2.If I want to make a file system, I can do it either on server side or client side.
Just like:
mkfs -t ext4 /home/go/nbd-export 
or 
mkfs -t ext4 /dev/nb0
3.I can mount it, and make directory, just look it as  a local hard disk.
Mount /dev/nb0 /mnt/vhd
Cd /mnt/vhd
Mkdir doc



>  
> 
> I am using nbd-2.9.17. but it doesn’t work correctly. I don’t know where is
> problem, and could you look it for me?

First, note that there is a bug in the name-based export stuff of
2.9.17, which was fixed in 2.9.18. You may wish to upgrade.

> My environment :
> 
> Server side:  2.6.27.9-159.fc10.i686
> 
> Client side:  2.6.27.25-78.2.56.fc9.i686
> 
>  
> 
> The following is log.
> 
> ########################################################
> 
> //server
> 
> [root@...845...]# nbd-server 5555 /home/go/

That can't work.

NBD isn't a network file system, like NFS; you can't export a directory
like that.

Instead, NBD exports files, which are then accessible as block devices
on the client side.

E.g., the following will work:

dd if=/dev/zero of=/home/go/nbd-export bs=1k seek=1M count=1
mkfs -t ext4 /home/go/nbd-export
nbd-server 5555 /home/go/nbd-export

That will create a 1G sparse file with an ext4 filesystem on it; you can
then connect to that filesystem from a client (your nbd-client example
was okay), and put files on it.

Also note that you can't access the same filesystem from several clients
in read-write mode (well, you can, but it's a very bad idea unless the
filesystem was specifically designed to do that).

If you do need to export the directory, you need NFS rather than NBD.

Regards,

-- 
The biometric identification system at the gates of the CIA headquarters
works because there's a guard with a large gun making sure no one is
trying to fool the system.
  http://www.schneier.com/blog/archives/2009/01/biometrics.html




Reply to: