首页 > 系统服务 > 详细

ubuntu nbd-server nbd-client使用

时间:2020-01-08 13:04:24      阅读:137      评论:0      收藏:0      [点我收藏+]

1 Install nbd-server

sudo apt-get install nbd-server

2 Create a file content

dd if=/dev/zero of=/mnt/dhini bs=1024 count=36000

Use mke2fs to make the /mnt/dhini as a filesystem.

mke2fs /mnt/dhini

3 config nbd-server

cat /etc/nbd-server/config        
[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
    user = nbd
    group = nbd
    includedir = /etc/nbd-server/conf.d

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.

[export]
    exportname = /home/pandx/sdbdisk/dhini

4 run nbd-server

sudo nbd-server 1043  
                            
?  sdbdisk netstat -tln|grep 1043
tcp6       0      0 :::1043                 :::*                    LISTEN

 

5 Install nbd-client

apt-get install nbd-client
modprobe nbd

6 connect nbd-server

sudo nbd-client -N export 10.0.1.57 1043 /dev/nbd0

 

done.

ubuntu nbd-server nbd-client使用

原文:https://www.cnblogs.com/longchang/p/12165853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!