Fix NBD Live CD Support in Ubuntu casper

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

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: http://sourceforge.net/projects/nbd/.

== 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=192.168.102.101

In addition, this script fixes the NetworkManager netboot challenge (noted here: https://wiki.ubuntu.com/LiveCDNetboot ) 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=192.168.102.101
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:
   http://www.PortlandLinuxSupport.com/src/ubuntu-live-nbdboot/

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=192.168.102.101 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=192.168.102.101 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:
http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM#Network_boot_using_PXE

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.