wait-for-root fails to detect nbd root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
nbd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Kernel does not generate any events when ndb-client connects /dev/nbd0 devices, therefore it is impossible to monitor/react to the state of /dev/nbd0.
[Fix]
Generate change uevent when size of /dev/nbd0 changes
[Testcase]
* Start udevadm monitor
* modprobe nbd
* use ndb-client to connect something to /dev/nbd0
* observe that there are change udev events generated on /dev/nbd0 itself
[Regression Potential]
There is no change to existing uevents, or their ordering.
There is now an addition change event which will cause systemd to mark ndb devices as ready and trigger appropriate actions
[Original Bug Report]
When using an nbd root, wait-for-root blocks for 30 seconds before booting continues successfully.
Using Ubuntu Natty, related packages versions:
nbd-client 1:2.9.16-6ubuntu1
initramfs-tools 0.98.1ubuntu9
The wait-for-root call from /usr/share/
while [ -z "${FSTYPE}" ]; do
FSTYPE=
# Run failure hooks, hoping one of them can fix up the system
# and we can restart the wait loop. If they all fail, abort
# and move on to the panic handler and shell.
if [ -z "${FSTYPE}" ] && ! try_failure_hooks; then
break
fi
done
I replaced wait-for-root with a sh script that did `set >&2`, here are the relevant environment variables at the time wait-for-root was called:
ROOT='/dev/nbd0'
ROOTDELAY=''
ROOTFLAGS=''
ROOTFSTYPE=''
nbdroot=
It's probably worth noting that "nbd0: unknown partition table" was displayed asynchronously 1-2 seconds after wait-for-root was invoked and while it was still waiting. But I tried adding a "sleep 5" as the last line of local-top/nbd, so that the nbd message was displayed a lot before wait-for-root was called, and it didn't make a difference. So I don't think a race condition is involved in this problem.
Temporarily I'm passing rootdelay=1 in the kernel command line to work around the problem.
tags: | added: bot-stop-nagging |
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
Changed in linux (Ubuntu): | |
status: | New → Fix Released |
tags: | added: id-594d1970df3ec53730c0d28c |
Changed in linux (Ubuntu Xenial): | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | Canonical Kernel (canonical-kernel) → Joseph Salisbury (jsalisbury) |
tags: | added: kernel-da-key |
Changed in linux (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
Changed in systemd (Ubuntu Xenial): | |
status: | Confirmed → In Progress |
I ran into "nbd0: unknown partition table" with maverick 64bit client and lucid server. The client doesn't boot:
Negotiation: ..size = 3397924KB
nbd0: unknown partition table
bs=1024, sz=3397924
and then it stops at
exec run-init /root /sbin/init ro
The client machine has two network cards if it's relevant?