73.2. Network Block Device protocol

简介:

73.2.1. nbd-server - Network Block Device protocol - server

apt-get install nbd-server		

# modprobe nbd
# mkdir -p /home/exported
# dd if=/dev/zero of=/home/exported/trial.img count=256 bs=1024k
# mkfs.ext3 /home/exported/trial.img

# nbd-server 1234 /home/exported/trial.img

# touch /root/empty
# nbd-server 1234 /home/exported/trial.img -C /root/empty
		

73.2.2. nbd-client - Network Block Device protocol - client

# apt-get install nbd-client


# nbd-client mine.my.flat 1234 /dev/nbd0
Negotiation: ..size = 262144KB
bs=1024, sz=262144

# mkdir /mnt/remote
# mount /dev/nbd0 /mnt/remote
# for i in $(seq 1 100) ; do echo $i > /mnt/remote/$i; done

# umount /mnt/remote 

root@vain:~#  nbd-client 127.0.0.1 1234 /dev/nbd0
root@vain:~# mkdir /tmp/foo
root@vain:~#  mount /dev/nbd0 /tmp/foo
root@vain:~#  ls /tmp/foo/
1    14  2   25  30  36  41  47  52  58  63  69  74  8   85  90  96
10   15  20  26  31  37  42  48  53  59  64  7   75  80  86  91  97
100  16  21  27  32  38  43  49  54  6   65  70  76  81  87  92  98
11   17  22  28  33  39  44  5   55  60  66  71  77  82  88  93  99
12   18  23  29  34  4   45  50  56  61  67  72  78  83  89  94  
13   19  24  3   35  40  46  51  57  62  68  73  79  84  9   95  lost+found
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
9月前
|
Java API 语音技术
MRCP(Media Resource Control Protocol)
MRCP(Media Resource Control Protocol)是一种音视频资源控制协议,用于控制语音识别、语音合成和语音交互等场景中的音视频资源。阿里云语音交互服务(ASR、TTS、Chatbot)支持MRCP协议,您可以使用MRCP协议来控制音视频资源,并实现语音交互的功能。
1210 1
|
5月前
|
存储 Cloud Native Linux
Failed to open/create the internal network ‘HostInterfaceNetworking-VirtualBox Host-Only Ethernet
Failed to open/create the internal network ‘HostInterfaceNetworking-VirtualBox Host-Only Ethernet
|
11月前
|
Linux Windows
The Genymotion virtual device could not obtain an IP address
The Genymotion virtual device could not obtain an IP address
56 0
|
存储 安全 文件存储
Network Attached Storage
Network Attached Storage
86 0
|
安全
解决:efi usb device has been blocked by the current security policy
解决:efi usb device has been blocked by the current security policy 问题描述:U盘装系统或者其他操作时,是因为BIOS安全策略,出现上述错误无法进入后续步骤。 解决方法:按F2(Fn+F2)进入BIOS,在secure Boot 中security选择disable。解决! 延伸(可不读): 黑苹
10760 0
asm Normal redundancy storage link is broken(19C)
asm Normal redundancy storage link is broken,Storage Split
2995 0

热门文章

最新文章