Differences
This shows you the differences between two versions of the page.
| en:linux:diskless_pxe_nfs [2020/05/06 02:00] – created alex | en:linux:diskless_pxe_nfs [2020/05/06 02:08] (current) – alex | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| Install necessary packages | Install necessary packages | ||
| + | < | ||
| # apt install isc-dhcp-server tftpd-hpa pxelinux nfs-kernel-server debootstrap | # apt install isc-dhcp-server tftpd-hpa pxelinux nfs-kernel-server debootstrap | ||
| + | </ | ||
| Configure network interface (ref: [[https:// | Configure network interface (ref: [[https:// | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 31: | Line 33: | ||
| Configure DHCP (ref: [[https:// | Configure DHCP (ref: [[https:// | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 50: | Line 52: | ||
| </ | </ | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 64: | Line 66: | ||
| </ | </ | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 76: | Line 78: | ||
| </ | </ | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 84: | Line 86: | ||
| Start DHCP server | Start DHCP server | ||
| - | # systemctl enable --now isc-dhcp-server | + | Run '' |
| Configure TFTP | Configure TFTP | ||
| Line 92: | Line 94: | ||
| Configure PXE | Configure PXE | ||
| + | < | ||
| # mkdir / | # mkdir / | ||
| # cd / | # cd / | ||
| Line 97: | Line 100: | ||
| # cp / | # cp / | ||
| # cp -r / | # cp -r / | ||
| - | # vim pxelinux.cfg/ | + | </ |
| + | |||
| + | Edit ''/ | ||
| < | < | ||
| Line 120: | Line 125: | ||
| </ | </ | ||
| + | < | ||
| # mkdir ubuntu | # mkdir ubuntu | ||
| # mount --bind / | # mount --bind / | ||
| + | </ | ||
| - | # vim /etc/fstab | + | Edit '' |
| - | + | ||
| - | append | + | |
| < | < | ||
| Line 138: | Line 143: | ||
| Export install and required mounts | Export install and required mounts | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 146: | Line 151: | ||
| </ | </ | ||
| - | # exportfs -rv | + | Run '' |
| ===== Client hosts ===== | ===== Client hosts ===== | ||
| Line 152: | Line 157: | ||
| Install ubuntu for net boot clients (ref: [[https:// | Install ubuntu for net boot clients (ref: [[https:// | ||
| + | < | ||
| # mkdir /srv/nfs | # mkdir /srv/nfs | ||
| # cd /srv/nfs | # cd /srv/nfs | ||
| - | # vim run_debootstrap.sh | + | </ |
| + | |||
| + | Edit '' | ||
| < | < | ||
| Line 162: | Line 170: | ||
| </ | </ | ||
| - | # bash run_debootstrap.sh | + | Run '' |
| Do not set / | Do not set / | ||
| + | < | ||
| # mount --bind /proc ubuntu/proc | # mount --bind /proc ubuntu/proc | ||
| # chroot ubuntu | # chroot ubuntu | ||
| + | </ | ||
| Set up locales | Set up locales | ||
| - | # vi / | + | Edit '' |
| - | uncomment locale (en_US.UTF-8) | + | Run '' |
| - | + | ||
| - | # locale-gen | + | |
| Install kernel, nfs-common, and SSH server | Install kernel, nfs-common, and SSH server | ||
| Do not install grub if prompted to do so | Do not install grub if prompted to do so | ||
| + | < | ||
| # apt install linux-image-generic nfs-common openssh-server | # apt install linux-image-generic nfs-common openssh-server | ||
| # chmod a+r / | # chmod a+r / | ||
| # systemctl enable ssh | # systemctl enable ssh | ||
| + | </ | ||
| - | Enable serial console | + | Enable serial console |
| - | + | ||
| - | # systemctl enable getty@ttyS1 | + | |
| Set up fstab | Set up fstab | ||
| - | # vi /etc/fstab | + | Edit '' |
| < | < | ||
| Line 206: | Line 214: | ||
| Workaround for unreadable kernel image | Workaround for unreadable kernel image | ||
| - | # vi / | + | Edit '' |
| < | < | ||
| Line 214: | Line 222: | ||
| </ | </ | ||
| - | # chmod a+x / | + | Run '' |
| Edit initramfs settings for NFS boot | Edit initramfs settings for NFS boot | ||
| - | # vi / | + | Edit '' |
| < | < | ||
| Line 224: | Line 232: | ||
| </ | </ | ||
| - | Regenerate initramfs | + | Regenerate initramfs |
| - | # update-initramfs -u | + | Set root password and/or add users, install packages, etc. Then: |
| - | + | ||
| - | Set root password and/or add users, install packages, etc. | + | |
| + | < | ||
| # exit | # exit | ||
| # umount ubuntu/proc | # umount ubuntu/proc | ||
| + | </ | ||
| At this point, it should be possible to boot a system over the network. | At this point, it should be possible to boot a system over the network. | ||
| Line 241: | Line 249: | ||
| Note: make sure console is accessable over iLO just in case networking gets broken | Note: make sure console is accessable over iLO just in case networking gets broken | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 247: | Line 255: | ||
| </ | </ | ||
| - | # vim / | + | Edit '' |
| < | < | ||
| Line 253: | Line 261: | ||
| </ | </ | ||
| - | # vim / | + | Edit '' |
| [place immediately after header comment] | [place immediately after header comment] | ||
| Line 268: | Line 276: | ||
| </ | </ | ||
| + | < | ||
| # ufw allow ssh | # ufw allow ssh | ||
| # ufw allow in on eno2 | # ufw allow in on eno2 | ||
| # ufw enable | # ufw enable | ||
| + | </ | ||