Public bug reported: In /etc/init.d/nbd-client, I don't see any way that would permit me to use an nbd-mounted root filesystem and have a clean shutdown process. With the current code, "rmmod nbd" is executed and then the client gets a bunch of read errors instead of shutting down.
Test case: * In /etc/nbd-server/config on the server, I export a whole partition with an OS in it: [generic] [sda2] exportname = /dev/sda2 port = 10809 * In pxelinux.cfg/default on the server, I pass these kernel parameters to netboot a client: APPEND ro initrd=nbdclient/initrd.img root=/dev/nbd0 nbdroot=10.160.31.14,10809 ip=10.160.31.101:10.160.31.1:10.160.31.1:255.255.255.0:nbd101:eth0:none * In the client /etc/network/interfaces (i.e. in /dev/sda2), I put a "manual eth0" to prevent network manager to break the existing connection. Then I need the following 2 workarounds so cleanly shutdown: 1) In the client /etc/fstab, I put the following *commented* entry, just to prevent /etc/init.d/nbd-client from unmounting the root filesystem on shutdown. Some documentation for a better way to do that would be appreciated: #/dev/nbd0 / ext4 _netdev,errors=remount-ro 0 1 2) In the client /etc/init.d/nbd-client, I move the marked "if" after the rmmod command: if [ "$KILLALL" != "false" ] then if [ -d /dev/nbd ] then DEVICES=/dev/nbd/* else DEVICES=/dev/nb* fi - fi echo "Invoking swapoff on NBD devices..." swapoff $DEVICES 2>/dev/null echo "Disconnecting $DESCes..." for i in $DEVICES do $DAEMON -d $i 2>/dev/null >/dev/null done rmmod nbd + fi Is there any better way to make nbd-mounted root filesystems shutdown properly? ** Affects: nbd (Ubuntu) Importance: Undecided Status: New -- Unable to cleanly shutdown with an nbd root filesystem https://bugs.launchpad.net/bugs/682328 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs