RTFM

[Read This Fine Material] from Joshua Hoblitt

PXE booting SystemRescueCd

My friend and colleague Stuart Sheldon has vlogged about the many benefits of SystemRescueCd or sysresccd. Sysresccd has built in support for acting as a PXE server to boot other systems without having to connect local media. There are some instructions on setting this up on the official wiki page titled Sysresccd-manual-en PXE network booting. PXE booting recovery/test tools is really convenient but using the native sysresccd support won’t work in my production server environment as there is a preexisting PXE setup (DHCP/TFTP) managed by a tool called TheForeman.

Here is how I made PXE booting to sysresccd an option in my environment:

Download SystemRescueCd-x86-3.5.0 (contains support for both i386 and x86-64).

Mount the .iso image as a loopback device on a directory so files can be copied out of it.

~/noao/sysresccd $ mkdir mnt
~/noao/sysresccd $ sudo mount -o loop systemrescuecd-x86-3.5.0.iso mnt
~/noao/sysresccd $ cd mnt
~/noao/sysresccd/mnt $ ls
boot      bootprog  isolinux  readme.txt  sysrcd.md5  usb_inst.sh   version
bootdisk  efi       ntpasswd  sysrcd.dat  usb_inst    usbstick.htm

Copy the sysresccd kernel and initramfs images to your tftp server and make sure they have the correct permissions/ownership.

~/noao/sysresccd/mnt $ cd isolinux/
~/noao/sysresccd/mnt/isolinux $ ls rescue* initram.igz 
initram.igz  rescue32  rescue64

I used the path /tftpboot/sysresccd/350 so that I can potential server multiple versions of sysresccd in the future. Note that I’ve had problems with dashs and underscores in tftpboot paths in the past so now I always avoid them (this may just be cargo culting).

~ $ tree /tftpboot/sysresccd/
/tftpboot/sysresccd/
`-- 350
    |-- initram.igz
    |-- rescue32
    `-- rescue64

1 directory, 3 files

Copy the system image and it’s md5 checksum to some place where it’ll be easily accessible on the network. I used an HTTP server that I use for YUM repos and mirrors.

~/noao/sysresccd/mnt $ ls sysrcd.*
sysrcd.dat  sysrcd.md5

As with the tftp path, I put the version into the path.

~ $ tree /repo/mirrors/sysresccd/
/repo/mirrors/sysresccd/
└── 350
    ├── sysrcd.dat
    └── sysrcd.md5

1 directory, 2 files

It’s not documented on the wiki page but the initramfs image seems to look for sysrcd.md5 under the exact same path that sysrcd.dat is downloaded from. If it’s not available you’ll get errors like these:

Add entries to the default PXE boot menu for sysresccd for both the i386 and x86-64 version. Note that both kernels share the same initramsfs image.

~ $ cat /tftpboot/pxelinux.cfg/default 
DEFAULT menu
PROMPT 0
MENU TITLE PXE Menu
TIMEOUT 100
TOTALTIMEOUT 6000
ONTIMEOUT local

LABEL local
    MENU LABEL (local)
    MENU DEFAULT
    LOCALBOOT 0

LABEL Memtest86+ 4.20
    MENU LABEL Memtest86+ 4.20
    KERNEL memtest/4.20/memtest

LABEL Memtest86+ 500b1
    MENU LABEL Memtest86+ 500b1
    KERNEL memtest/500b1/memtest

LABEL Sysresccd x86 3.5.0
    MENU LABEL Sysresccd x86 3.5.0
    KERNEL sysresccd/350/rescue32
    append initrd=sysresccd/350/initram.igz dodhcp netboot=http://mirrors.sdm.noao.edu/sysresccd/350/sysrcd.dat

LABEL Sysresccd x86-64 3.5.0
    MENU LABEL Sysresccd x86-64 3.5.0
    KERNEL sysresccd/350/rescue64
    append initrd=sysresccd/350/initram.igz dodhcp netboot=http://mirrors.sdm.noao.edu/sysresccd/350/sysrcd.dat

Here’s what that menu looks like on the console of a booting PXE client:

Also, a quick note on managing a node with IPMI commands if it has a BMC. Even if the EFI/BIOS is set to boot first from a local device, ISCSI, etc. you can over ride this for just the next boot cycle with the following ipmitool command:

~ $ ipmitool -U ADMIN -P  -H  chassis bootparam set bootflag pxe 
Set Boot Device to pxe
~ $ ipmitool -U ADMIN -P  -H  chassis power cycle
Chassis Power Control: Cycle

Here is a screenshot of a successful sysresccd image booted from PXE. In this particular case, this allowed me to use smartctl to diagnose two disks in a system that were failing.

Comments are closed.