setup doesn't copy /boot partition into image

Bug #1352038 reported by map7
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
LTSP5
Fix Released
Medium
Alkis Georgopoulos

Bug Description

I'm using Xubuntu 14.04 64bit and I'm setting this up as a LTSP-PNP machine. I've setup the hard drive with /boot on a separate partition as I'm using LVM for the other partitions to allow for snapshots and easy resizing.

I followed the instructions from https://help.ubuntu.com/community/UbuntuLTSP/ltsp-pnp to build the system, using the following commands to build my image in this order

Update PXE config for kernels (LTSP-PNP specific) (must be done before building the image)
: /usr/share/ltsp/update-kernels

Build image
: ltsp-update-image --cleanup /

Update kernels
: ltsp-update-kernels

Generate LTS config
: ltsp-config lts.conf

When I try booting a thin client I get the error 'Could not find kernel image: vmlinuz'. After a lot of debugging and talking to people on IRC I found that the command 'ltsp-update-image -c /' was not copying my '/boot' contents as it was on a separate partition.

I could prove that nothing was in the image files /boot area by mounting the image in a loop back like so
: mount -o loop /opt/ltsp/images/amd64.img /mnt
: ls /mnt/boot
I found that there was only three files in there: gpxelinux.0 pxelinux.0 pxelinux.cfg

To get it working I had to do a hack
: mount /dev/mapper/xubuntu--vg-root /mnt
: cp /boot/* /mnt/boot
: umount /mnt
: ltsp-update-image -c /

After rebuilding the image this way I could boot the thin client without any problems. My /boot is an ext4 filesystem and is the first primary partition on the drive.

Tags: ltsp-pnp
Revision history for this message
Vagrant Cascadian (vagrantc) wrote : Re: [Bug 1352038] [NEW] setup doesn't copy /boot partition into image

On 2014-08-03, map7 wrote:
> I'm using Xubuntu 14.04 64bit and I'm setting this up as a LTSP-PNP
> machine. I've setup the hard drive with /boot on a separate partition as
> I'm using LVM for the other partitions to allow for snapshots and easy
> resizing.
...
> Build image
> : ltsp-update-image --cleanup /
>
> Update kernels
> : ltsp-update-kernels
>
> Generate LTS config
> : ltsp-config lts.conf
>
> When I try booting a thin client I get the error 'Could not find kernel
> image: vmlinuz'. After a lot of debugging and talking to people on IRC I
> found that the command 'ltsp-update-image -c /' was not copying my
> '/boot' contents as it was on a separate partition.

I had to fix this in Debian, which uses aufs, by adding code in
ltsp-update-image to mount each mountpoint individually before making
the image. This used to not be required with overlayfs, which is what I
believe Ubuntu is using, but perhaps the overlayfs defaults have
changed?

live well,
  vagrant

Changed in ltsp:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
g (wgordonw1) wrote :

I've encountered this using Ubuntu 14.04 as well

Revision history for this message
g (wgordonw1) wrote :

For other users encountering this issue on Ubuntu 14.04.2 the workaround is pretty much identical to the Xubuntu commands posted in the initial description. I've pasted them below for reference:

sudo -i
mount /dev/mapper/ubuntu--vg-root /mnt
cp /boot/* /mnt/boot
umount /mnt
ltsp-update-image -c /
exit

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Yes it appears that overlayfs no longer sees submounts, so a workaround is needed.
Unfortunately bind-mounting the submounts over the work dir makes it possible for the cleanup phase to *write* to them, as they would be "above" the COW, not below it.

This affects aufs as well.

Maybe a compromise could be to bind-mount them read-only on top of workdir...

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix committed in http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/revision/2648

Can someone that uses a different /boot partition, download the new version of ltsp-update-image and test if it works?
http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk/view/head:/server/ltsp-update-image

Please also mention your kernel version, uname -a.

Changed in ltsp:
assignee: nobody → Alkis Georgopoulos (alkisg)
status: Triaged → Fix Committed
Revision history for this message
David Groos (djgroos) wrote :

Ran into this problem and caused a big slowdown in solving it, thanks to #ltsp for help. Please also support overlayfs for Ubuntu 14.04.

Revision history for this message
David Groos (djgroos) wrote :

Needing to re-solve this problem. Tried the fix provided by @alkisg in #5 (replacing ltsp-update-image with revision 2659). After replacing file and re-running sudo ltsp-update-image --cleanup / I got this message:
 "/usr/sbin/ltsp-update-image: 2: /usr/sbin/ltsp-update-image: Syntax error: newline unexpected"

Not sure what that means...

Machine info: Linux myserver 3.19.0-26-generic #28~14.04.1-Ubuntu SMP Wed Aug 12 14:12:35 UTC 2015 i686 i686 i686 GNU/Linux

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

There were two issues involved here, because both were part of the same function in the LTSP code:
1) Copy the /boot partition into image. This was working with aufs (=Debian), but not with overlay (=newer Ubuntu) and overlayfs (older Ubuntu).
2) Support for the new upstream overlay file system (=newer Ubuntu and Debian) which replaced the older overlayfs one (=older Ubuntu).

In revision 2648 I fixed (2), but I only managed to push a lame workaround for (1).
In revision 2651, vagrantc properly fixed (1) for aufs and overlay, but he didn't notice the other fixes I did and he reverted them, so the lame workaround for overlayfs was removed, and support for (2) was also reverted.

Now, in revision 2661, I think I've properly solved both issues.

David, you should request an SRU for this fix, i.e. the ltsp-update-image script should be backported as is to at least Ubuntu 14.04, if not to all supported Ubuntu versions.
Links for how to request this:
https://wiki.ubuntu.com/StableReleaseUpdates
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification
When it's done, you'll receive the fixed version normally as a software update.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix released in LTSP 5.5.5.

Changed in ltsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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