码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu nbd-server nbd-client使用

时间:2020-01-08 12:48:05      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:lin   oge   mke2fs   eth   server   col   connect   etc   apt   

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使用

标签:lin   oge   mke2fs   eth   server   col   connect   etc   apt   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!