4

I am currently PXE booting a bunch a machine, via the diskless function in ubuntu. What is the best practice when upgrading the image from 10.04 LTS to 12.04 LTS?

I've currently made a copy of the image with cp -arpv to ensure that i can switch back to the old image, if something is wrong in the new image.

However do-release-upgrade is not available in the diskeless image.

Any good ideas on what to do?

Best regards.

EDIT: The image is Ubuntu-server btw.

ChosSimbaOne
  • 151
  • 1
  • 3
  • 12

1 Answers1

4

I have upgraded my diskless PXE booting systems in the past using do-release-upgrade.

Install update-manager-core to obtain do-release-upgrade. When you upgrade, don't forget to ensure that your initrd is built for netbooting in /etc/initramfs-tools/initramfs.conf, I have had this file overwritten on upgrade in the past, the option you need is:

 BOOT=nfs

You will also need to update your kernel and kernel configuration on your tftp server.

Edit the configuration file in your pxelinux.cfg directory to contain the new entry, on my server I have a host specific file:

johnf@carbon:~$ cat /srv/tftp/pxelinux.cfg/01-00-1f-d0-27-d2-17 
LABEL linux
KERNEL /vmlinuz-2.6.38-10-generic
APPEND initrd=/initrd.img-2.6.38-10-generic root=/dev/nfs nfsroot=172.29.1.6:/home/export/argon ip=dhcp rw

You will also need to update the kernel images on the tftp server itself, here's the command I use:

sudo cp --preserve=timestamps /home/export/argon/boot/initrd.img*-generic /home/export/argon/boot/vmlinuz*-generic /srv/tftp
johnf
  • 856
  • 1
  • 7
  • 18
  • Thanks for the quick reply. Must it be done from the host (ssh to host) or from the image (chroot to diskless image)? My plan is to make one of the machines boot from then new image, to test if it works, and then let the rest boot, when probably tested. – ChosSimbaOne Sep 05 '12 at 10:41
  • Sorry for the delayed response, I would recommend that you do it through an ssh session to the (a?) host. I have seem some unusual issues with chroot vs ssh though I can't remember the specific details. It might have had something to do with the installation of locales. – johnf Sep 06 '12 at 00:21
  • Thanks for the reply. Will test it out today, and see if it works :-) Will report back later :-) – ChosSimbaOne Sep 06 '12 at 06:35
  • Thanks for the help. I got the image updated. Problem now is that it will not find the kernel when rebooting. But i guess that should go into another question. After editing the configuration of the TFTP server it still says, cannot find kernel image: – ChosSimbaOne Sep 17 '12 at 08:21
  • 1
    You will also need to copy the kernel image and the initrd into the tftp directory. I use the following command: sudo cp --preserve=timestamps /home/export/argon/boot/initrd.img*-generic /home/export/argon/boot/vmlinuz*-generic /srv/tftp – johnf Sep 18 '12 at 09:38
  • I have the Ubuntu image and the tftp server at the same physical machine. I guess i should be able to symlink the kernel, but when i boot i get could not fine kernel image: precise_pxe/vmlinuz, seems as it cannot read the new symlink. The old one works fine. If i issue lucid_killing/vmlinuz it boots. Got any idea to what this might be? I've upgraded my pxelinux.0 image, to the latest from ubuntu repository. – ChosSimbaOne Oct 23 '12 at 08:58
  • 1
    tftpd is often run chrooted, this means that it will only have access to the files under /srv/tftp. It doesn't appear to be the case on my system, it may be the case for you. Can you give me a ls -l of the two symbolic links as well as the two actual files? – johnf Oct 24 '12 at 10:02
  • 1
    You can also edit /etc/default/ and edit the option TFTP_OPTIONS="-vvv" , this will put the tftp server in debug mode and will help you to clarify why it isn't working. You should really ask this question as a new question, it's unrelated to your current issue. I'm quite surprised that you apparently unaccepted my answer on how to dist-upgrade because of your issues with getting your image accessible by tftp. – johnf Oct 24 '12 at 10:12
  • Hi Johnf. I am sorry about un-accepting your answer, that was not my intent. I did accepted it again, when i found out what I did do :-/ Sorry. I figured out what my problem was. vmlinuz and initrm.img was not readable from the PXE folder, so it is working now. My current problem is now that it cannot mount /dev/nfs, and cannot figure out how to specify it. – ChosSimbaOne Oct 25 '12 at 12:00
  • No trouble, I realized that you had re-added it after, sorry about my fit of rage. Please update your new question with a bit of info about your new NFS problem, I've updated my answer: http://askubuntu.com/questions/189692/problem-pxe-booting – johnf Oct 27 '12 at 12:06