Tuesday, December 31. 2013
PLD RescueCD is my new favorite Linux rescue CD. It has a ton of stuff in it, even the ipmitool from OpenIPMI-project. One of these days, it so happened that I lost my IPMI network access due to own mis-configuration. I just goofed up the conf and oops, there was no way of reaching management interface anymore. If the operating system on the box would have been ok, it might have been possible to do some fixing via that, but I chose not to. Instead I got a copy of PLD and started working.
The issue is, that PLD RescueCD comes as ISO-image only. Well, erhm... nobody really boots CDs or DVDs anymore. To get the thing booting from an USB-stick appeared to be a rather simple task.
- A working Linux with enough root-access to do some work with USB-stick and ISO-image
- syslinux-utility installed, all distros have this, but not all of them install it automatically. Confirm that you have this or you won't get any results.
- GNU Parted -utility installed, all distros have this. If yours doesn't you'll have to adapt with the partitioning weapon of your choice.
- An USB-stick with capacity of 256 MiB or more, the rescue CD isn't very big for a Linux distro
- WARNING! During this process you will lose everything on that stick. Forever.
- Not all old USB-sticks can be used to boot all systems. Any reasonable modern ones do. If you are failing, please try again with a new stick.
- PLD RescueCD downloaded ISO-file, I had RCDx86_13_03_10.iso
- You'll need to know the exact location (as in directory) for the file
- The system you're about to rescue has a means of booting via USB. Any reasonable modern system does. With old ones that's debatable.
Assumptions used here:
- Linux sees the USB-stick as /dev/sde
- ISO-image is at /tmp/
- Mount location for the USB-stick is /mnt/usb/
- Mount location for the ISO-image is /mnt/iso/
- syslinux-package installs it's extra files into /usr/share/syslinux/
- You will be using the 32-bit version of PLD Rescue
On your system those will most likely be different or you can adjust those according to your own preferences.
Information about how to use syslinux can be found from SYSLINUX HowTos.
Steps to do it
- Insert the USB-stick into your Linux-machine
- Partition the USB-stick
- NOTE: Feel free to skip this if you already have a FAT32-partition on the stick
- Start GNU Parted:
- Create a MS-DOS partition table to the USB-stick:
- Create a new 256 MiB FAT32 partition to the USB-stick:
mkpart pri fat32 1 256M
- Set the newly created partition as bootable:
set 1 boot on
- End partitioning:
- Format the newly created partition:
mkfs.vfat -F 32 /dev/sde1
- Copy a syslinux-compatible MBR into the stick:
dd if=/usr/share/syslinux/mbr.bin of=/dev/sde conv=notrunc bs=440 count=1
- Install syslinux:
- Mount the USB-stick to be written into:
mount /dev/sde1 /mnt/usb/
- Mount the ISO-image to be read:
mount /tmp/RCDx86_13_03_10.iso /mnt/iso/ -o loop,ro
- Copy the ISO-image contents to the USB-stick:
cp -r /mnt/iso/* /mnt/usb/
- Convert the CD-boot menu to work as USB-boot menu:
mv /mnt/usb/boot/isolinux /mnt/usb/syslinux
- Take the 32-bit versions into use:
cp /mnt/usb/syslinux/isolinux.cfg.x86 /mnt/usb/syslinux/syslinux.cfg
- Umount the USB-stick:
- Umount the ISO-image:
- Un-plug the USB-stick and test!
Like always, any comments or improvements are welcome. Thanks Arkadiusz for your efforts and for the great product you're willing to share with rest of us. Sharing is caring, after all!