Fix NBD Live CD Support in Ubuntu casper

Bug #587399 reported by PortlandLinuxSupport
This bug affects 3 people
Affects Status Importance Assigned to Milestone
casper (Ubuntu)

Bug Description

Binary package hint: casper

== Description
This patches /scripts/casper within initrd.lz to support booting Ubuntu Live CDs by exporting the .iso directly from nbd-server by adding netboot=nbd as a kernel command-line option. Tested under Ubuntu 10.04.

== Patch Details
The patch is simple and applies clean with one point to note: nbd-client must be included in the initrd for the distribution. The latest nbd-client and nbd-server source are available here:

== Usage Example
Prepare the server as:
   nbd-server -r 2000 /mnt/data/isos/ubuntu-10.04-desktop-amd64.iso

And then add the following to the Live CD kernel command line:
    netboot=nbd nbdsrv=

In addition, this script fixes the NetworkManager netboot challenge (noted here: ) for NBD-based netboots by disabling NetworkManager's use of the nbd-network-interface such that the network is still available when using netboot=nbd. NFS and CIFS-based netboot code is unaffected by this patch.

== NBD Kernel Command Line Options
The following list kernel command-line options that are available with their default values:

=== nbdrootdev=/dev/nbd0
The default nbd device to use for mounting the ISO (or other format) source image. You probably will not need to use this, however, you might be able to hack this to work with another blockdevice if the LiveCD does not probe your device for CD images.

=== nbdfstype=iso9660
The filesystem to mount $nbdrootdev as

=== nbdsrv=
The server to connect to with nbd-client

=== nbdport=2000
Default server port to connect

=== nbdblocksize=1024
nbdblocksize=1024 is default for backward-compatibility, however, a blocksize of 2048 or 4096 may have better performance.

=== nbdiface=eth0
This is the Ethernet interface that is to be ignored by NetworkManager. It is critical that this matches the interface to which there is an IP route to the nbd-server or NetworkManager will hang the system when it attempts to re-initialize eth0.

Revision history for this message
PortlandLinuxSupport (ubuntu-ew) wrote :
Revision history for this message
PortlandLinuxSupport (ubuntu-ew) wrote :

Pre-built i386 and x86_64 initrd's with the nbdboot patch and a static-compiled i386/x86_64 nbd-client are available here:

pxeboot.cfg/default might contain something like the following for pxeboot+nbd of Ubuntu 10.04 Lucid:

LABEL lucid-x86_64
        kernel ubuntu/10.04-live/vmlinuz
        append initrd=ubuntu/10.04-live/initrd.lz boot=casper netboot=nbd nbdsrv= nbdport=2000 nbdblocksize=4096 ip

LABEL lucid-i386
        kernel ubuntu/10.04-live-i386/vmlinuz
        append initrd=ubuntu/10.04-live-i386/initrd-i386.lz boot=casper netboot=nbd nbdsrv= nbdport=2001 nbdblocksize=4096 ip

Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote :

Thanks for giving up your time to make Ubuntu better, but in future please could you use the patch tag instead of putting 'patch' in the bug title.

tags: added: patch
summary: - Fix NBD Live CD Support in Ubuntu casper [PATCH]
+ Fix NBD Live CD Support in Ubuntu casper
tags: added: lucid
Changed in casper (Ubuntu):
importance: Undecided → Low
importance: Low → Wishlist
Revision history for this message
Stéphane Graber (stgraber) wrote :

The patch isn't quite ideal but it's a feature I said I'd implement for Edubuntu, so assigning it to me.
The options name should match those of the nbd initramfs hook and the code shouldn't mess with anything besides nbd.

Changed in casper (Ubuntu):
status: New → Triaged
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
James Le Cuirot (chewi) wrote :

Just tried this with the BackTrack 5R3 ISO, works nicely! It's such a simple change, please push it through.

Revision history for this message
PortlandLinuxSupport (ubuntu-ew) wrote :

> The options name should match those of the nbd initramfs hook

How so, to what should the names be changed?

> and the code shouldn't mess with anything besides nbd.

I presume you are referring to the hook of /scripts/init-bottom/ORDER to add
   iface eth0 inet manual
to /etc/network/interfaces.

This is critical, because if NetworkManager tries to initialize the network device, it will hang during boot (nbd-client isn't intelligent enough to reconnect, but thats a bug for another thread). Downing the network interface effectively unplugs the root block device.

I don't care how or where the hook is made---but somehow NetworkManager needs to be disabled for the session on that network interface.

How is this handled for NFS and CIFS root filesystems?

Revision history for this message
Gabriel (g-parrondo) wrote :

Is someone working on this feature? Being able to load the squashfs directly from nbd/tftp would be very useful. Sysresccd has something like that:

Changed in casper (Ubuntu):
assignee: Stéphane Graber (stgraber) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.