我正在尝试设置第一个(众多)运行 Pidora(Fedora Remix)的 Raspberry Pi 从 NFS 共享启动。我的目标是最终在数据中心放置十几个或更多 Raspberry Pi,为我的基础设施和客户端提供多种不同的服务,并希望取代我当前使用的一些较小的 VPS 节点。
我在cmdline.txt中的配置是:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/nfs nfsroot=<serverip>:/fake/path,nolock ip=dhcp elevator=deadline rootwait
在 Pi 上,我看到的输出是:
IP-Config: Got DHCP answer from <router>, my address is <clientip>
IP-Config: Complete:
device=eth0, hwaddr=<macaddress>, ipaddr=<clientip>, mask=255.255.255.0, gw=<routerip>
host=<clientip>, domain=, nis-domain=(none)
bootserver=<routerip>, rootserver=<serverip>, rootpath=
nameserver0=<routerip>
(It pauses for a bit here)
VFS: Unable to mount root fs via NFS, trying floppy
VFS: Cannot open root device "nfs" or unknown-block(2,0); error -6
Please append a correct "root=" boot option; here are the available partitions:
.....
导出配置为:
/fake/path <clientip>(rw,no_root_squash,insecure,no_subtree_check)
在 NFS 服务器(OpenVZ 容器)上,我在 /var/log/messages 中看到的输出是:
Aug 22 23:24:01 vps-4178 rpc.mountd[928]: authenticated mount request from <clientip>:783 for /fake/path (/fake/path)
Aug 22 23:24:38 vps-4178 rpc.mountd[928]: authenticated mount request from <clientip>:741 for /fake/path (/fake/path)
Aug 22 23:25:25 vps-4178 rpc.mountd[928]: authenticated mount request from <clientip>:752 for /fake/path (/fake/path)
Aug 22 23:26:12 vps-4178 rpc.mountd[928]: authenticated mount request from <clientip>:876 for /fake/path (/fake/path)
为了测试,我确保我可以从 Pi 和另一台机器安装(非 root)并且它有效。
有谁知道可能出什么问题或如何缩小范围?
更新:
这个过程已经稍微进一步了。服务器仍然显示相同的消息,但是客户端现在说“没有响应,仍在尝试”。
这是该过程中的 tcpdump(tcdump -vv 'port not 22'):
tcpdump: listening on venet0, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
02:27:49.396600 IP (tos 0x0, ttl 50, id 56458, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:27:49.396694 IP (tos 0x0, ttl 64, id 22318, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:27:49.396700 IP (tos 0x0, ttl 64, id 22318, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:27:49.396701 IP (tos 0x0, ttl 64, id 22318, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
02:27:49.396963 IP (tos 0x0, ttl 64, id 34369, offset 0, flags [DF], proto UDP (17), length 72)
<serverhostname>.57067 > <redacted2>.domain: [udp sum ok] 45505+ PTR? <redacted>.in-addr.arpa. (44)
02:27:49.400054 IP (tos 0x0, ttl 60, id 0, offset 0, flags [DF], proto UDP (17), length 121)
<redacted2>.domain > <serverhostname>.57067: [udp sum ok] 45505 q: PTR? <redacted>.in-addr.arpa. 1/0/0 <redacted>.in-addr.arpa. PTR <clienthostname>. (93)
02:27:49.400289 IP (tos 0x0, ttl 64, id 34372, offset 0, flags [DF], proto UDP (17), length 73)
<serverhostname>.51421 > <redacted2>.domain: [udp sum ok] 15808+ PTR? <redacted3>.in-addr.arpa. (45)
02:27:49.401603 IP (tos 0x0, ttl 60, id 0, offset 0, flags [DF], proto UDP (17), length 115)
<redacted2>.domain > <serverhostname>.51421: [udp sum ok] 15808 q: PTR? <redacted3>.in-addr.arpa. 1/0/0 <redacted3>.in-addr.arpa. PTR <redacted2>. (87)
02:27:50.496543 IP (tos 0x0, ttl 50, id 56459, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:27:50.496627 IP (tos 0x0, ttl 64, id 22319, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:27:50.496634 IP (tos 0x0, ttl 64, id 22319, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:27:50.496636 IP (tos 0x0, ttl 64, id 22319, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
02:27:52.694985 IP (tos 0x0, ttl 50, id 56460, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:27:52.695058 IP (tos 0x0, ttl 64, id 22320, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:27:52.695064 IP (tos 0x0, ttl 64, id 22320, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:27:52.695066 IP (tos 0x0, ttl 64, id 22320, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
02:27:57.105354 IP (tos 0x0, ttl 50, id 56461, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:27:57.105451 IP (tos 0x0, ttl 64, id 22321, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:27:57.105456 IP (tos 0x0, ttl 64, id 22321, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:27:57.105458 IP (tos 0x0, ttl 64, id 22321, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
02:28:05.914058 IP (tos 0x0, ttl 50, id 56462, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:28:05.914130 IP (tos 0x0, ttl 64, id 22322, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:28:05.914137 IP (tos 0x0, ttl 64, id 22322, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:28:05.914138 IP (tos 0x0, ttl 64, id 22322, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
02:28:07.014579 IP (tos 0x0, ttl 50, id 56463, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:28:07.014665 IP (tos 0x0, ttl 64, id 22323, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:28:07.014672 IP (tos 0x0, ttl 64, id 22323, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:28:07.014674 IP (tos 0x0, ttl 64, id 22323, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
02:28:09.216009 IP (tos 0x0, ttl 50, id 56464, offset 0, flags [DF], proto UDP (17), length 144)
<clienthostname>.3541049940 > <serverhostname>.nfs: 116 read fh Unknown/01000401D2255200F6209D570C172001AA2F2645000000000000000000000000 4096 bytes @ 516096
02:28:09.216102 IP (tos 0x0, ttl 64, id 22324, offset 0, flags [+], proto UDP (17), length 1500)
<serverhostname>.nfs > <clienthostname>.3541049940: reply ok 1472 read REG 100755 ids 0/0 sz 1630184 nlink 1 rdev ffffffff fsid 579d20f6 nodeid 120170c a/m/ctime 1408774668.892909 1404929018.000000 1408747025.202589
02:28:09.216107 IP (tos 0x0, ttl 64, id 22324, offset 1480, flags [+], proto UDP (17), length 1500)
<serverhostname> > <clienthostname>: udp
02:28:09.216109 IP (tos 0x0, ttl 64, id 22324, offset 2960, flags [none], proto UDP (17), length 1264)
<serverhostname> > <clienthostname>: udp
答案1
Pidora 的原生内核不支持 nfsroot,因此您必须编译自己的内核。我想这就是为什么他们说 Fedora 是最前沿的......