### How to make my OpenSUSE installation boot via PXE ### | |
Booting from PXE is amazing. It allows one to have computers without a hard dis… | |
Few days ago, I decided to remove hard disks of all my workstation PCs at home,… | |
My distribution of choice (as far as we're talking about workstations) is OpenS… | |
Of course, this is not only true for OpenSUSE, and should be adaptable without … | |
* The "big picture" * | |
The whole idea is this: the workstation starts, and the BIOS of the network car… | |
The local DHCP server provides it with an IP address, a mask, a gateway, and fe… | |
The "next-server" field contains the IP address of a local TFTP server, and the… | |
Now, the PC loads the PXE image from the TFTP server. I am using the excellent … | |
When PXELINUX starts, it loads a configuration file from the TFTP server (pxeli… | |
Let's see the configuration of most important parts of our PXE architecture. | |
* DHCP * | |
I won't discuss DHCP configuration. It's pretty trivial, so you can figure it o… | |
* PXELINUX * | |
The PXE boot is assured by pxelinux. The configuration file of pxelinux is rath… | |
label OpenSUSE | |
menu label OpenSUSE | |
kernel suse_martyna/boot/vmlinuz | |
append initrd=suse_martyna/boot/initrd rootfstype=nfs root=/dev/nfs nfsroot… | |
* INITRD * | |
to prepare the mkinitrd: | |
mkinitrd -f nfs -D eth0 | |
This will add the required kernel modules and a dhcp client to the initrd, whic… | |
If your network card isn't working at initrd boot stage, you might want to spec… | |
You also might try to use "mkinitrd -A -D eth0", this one will generate a "mons… | |
WARNING: On OpenSUSE 11.4 (and maybe other versions) there is a bug that makes … | |
To fix it, I did on the nfs server, as root: | |
# cd <exported directory for the client's home> | |
# chroot . | |
# cd /boot | |
# mkdir img | |
# cd img | |
# gzip -cd /boot/initrd | cpio -imd --quiet | |
# cp /etc/{protocols,netconfig} etc | |
# find . | cpio --quiet -H newc -o | gzip -9 -n > /boot/initrd_patched | |
# cd /boot | |
# rm initrd | |
# ln -s initrd_patched initrd | |
# exit | |
* Root directory content * | |
Then rsync your fs (offline, eg. via a liveCD) to the remote server: | |
rsync -a /mnt/mydisk /srv/nfs/suse_root | |
* FSTAB * | |
in the fstab, replace the / entry with: | |
none / none | |
or (dunno which one is better) | |
/dev/nfs / nfs | |
* Other bits to know about * | |
Make sure that the network script won't be able to run (if it does, it could cr… | |
chmod -x /etc/init.d/network | |
Export the NFS share containing the root filesystem as such: | |
/srv/tftp/suse_root/ 192.168.190.24(rw,no_root_squash,no_subtree_check) | |
If you get a "FIBMAP: invalid argument" error after or during the boot of your … | |