Linux NFS Root and PXE-Boot
Linux NFS Root and PXE-Boot
November 6, 2006
Linux kernel hacking and test running on the same machine becomes a major pain. This tutorial explains how to separate the two easily for a quick code-and-test loop. This tutorial explains how to setup a Linux thin client that boots using PXE by pulling a remote Linux kernel image and mounting a remote root file system over NFS. This is only possible if your client machine has a network card that supports this (do you remember seeing some type of option like press N to boot from network just after posting?). I am using Fedora Core 5 as my server, so some of the details may be specific to FC.
Most of the details of setting up the PXE boot server were found at Setting up a PXE-Boot Server.
1) yum install tftp-server dhcp
Make sure you have an NFS server.
2) create /etc/dhcpd.conf
allow bootp;
allow booting; ddns-update-style interim;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.254;
default-lease-time 3600;
max-lease-time 4800;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name "llama.net";
option time-offset -8;
} host llama0 {
hardware ethernet 04:4B:80:80:80:03;
fixed-address 192.168.0.254;
option host-name "llama0";
filename "pxelinux.0";
}
Change MAC address to match that of the client machine.
3) Create the directory and add the following line to /etc/exports for the nfs share.
/nfsroot *(rw,no_all_squash,no_root_squash)
4) cp -a /bin /dev /etc /home /lib /mnt /sbin /tmp /usr /var /nfsroot
from a good Fedora Core install. You'll have to cleanup and change some of these files for your client at some point.
5) Activate tftp within xinetd by changing disable=yes to disable=no in /etc/xinetd.d/tftp. Restart xinetd. The tftp root is at /tftpboot.
6) Compile your kernel with the following options and move bzImage to /tftpboot/:
- NFS filesystem support (CONFIG_NFS_FS).
- Root file system on NFS (CONFIG_ROOT_NFS).
- Ethernet (10 or 100Mbit) (CONFIG_NET_ETHERNET).
- The ethernet driver for the clent's network card.
- IP: kernel level autoconfiguration (CONFIG_IP_PNP)
- BOOTP support (CONFIG_IP_PNP_BOOTP)
7) Configure pxelinux. First create the directory /tftpboot/pxelinux.cfg (and make it world readable). Inside that directory you need to create a number of zero size files (use touch):
01-04-4B-80-80-80-03
C
C0
C0A
C0A8
C0A80
C0A800
C0A800F
C0A800FE
01-04-4B-80-80-80-03
The first 8 are the hex representation of the 192.168.0.254 IP address that your PXE boot client will be assigned. The permutations allow a broader IP subnet to be searched first for matches. The last entry is the MAC address of your PXE boot client's NIC (with dashes substituted for the colons), with '01' pre-pended. The "01" at the front represents a hardware type of Ethernet, so pxelinux.0 see's the configuration string as an IP address.
Copy /usr/lib/syslinux/pxelinux.0 from your Fedora install to /tftpboot/
8) Now create the default pxelinux configuration inside the new file
/tftpboot/pxelinux.cfg/default:
prompt 1
default linux
timeout 100 label linux
kernel bzImage
append init=/sbin/init root=/dev/nfs rw nfsroot=192.168.0.1:/nfsroot ip=192.168.0.254:192.168.0.1:192.168.0.1:255.255.255.0:llama0::off noapic acpi=off
The last line is where you can stick any kernel parameters needed. You'll notice this menu is somewhat similar to a grub config file.
Check out the following articles for more information:
PXELINUX - SYSLINUX for network boot
http://www.tldp.org/HOWTO/Diskless-root-NFS-other-HOWTO-4.html
Linux NFS Root and PXE-Boot的更多相关文章
- Linux NFS 服务部署
系统环境:Oracle Linux 5.7 服务端:192.168.1.111 客户端:192.168.1.171 一.服务端配置 二.客户端配置 一.服务端配置 1.依次启动portmap和nfs服 ...
- Linux NFS存储服务部署
什么是NFS 中文意思是网络文件系统,主要功能是通过网络(一般是局域网)让不同主机之间可以共享文件或目录 NFS属于本地文件存储服务 缺点1: 1 2 3 4 5 6 7 windows上无法使用 ...
- Redhat Linux NFS配置
Linux下,All deviceis file,所有的设备都是文件.当我们需要把某些文件夹就或者文件共享给其他用户,就可以使用网络文件系统. 本文介绍Redhat Linux下的NFS配置. 在使用 ...
- linux nfs
linux(十四)之linux NFS服务管理 学到这里差不多就结束了linux的基础学习了,其实linux的内容并不难,我们要经常的反复的去操作它,多多和它去联络感情才能很好的掌握这个linux. ...
- Linux破解root密码
实验环境 虚拟机软件:VMware Workstation 操作系统:Read Hat Enteprise 6.3 1.破解r ...
- Linux NFS 说明,配置及故障分析
一.NFS服务简介 NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布.功能是通过网络让不同的机器.不同的操 ...
- linux nfs文件夹、文件共享
◆一.概念 NFS是网络文件系统(Network File System)的简称,是分布式计算机系统的一个组成部分,可实现在异构网络上共享和装配远程文件系统. NFS由SUN公司开发,目前已成为文件服 ...
- Linux nfs下载安装与简单配置
1.什么是NFS? 全称 network file system 网络文件系统 通过网络存储和组织文件的一种方法或机制. 2.为什么要用共享存储? 前端所有的应用服务器接收到用户上传的图片.文件.视频 ...
- linux nfs服务配置挂载以及oracle使用nfs存储挂载注意事项
服务端共享目录 /home/XXX/nfs_shared 172.16.22.0/24(rw,no_root_squash) service nfs restart 常用命令: 查看所有nfs共享目录 ...
随机推荐
- Socket网络编程--简单Web服务器(3)
上一小节已经实现了浏览器发送请求,然后服务器给出应答信息,然后浏览器显示出服务器发送过来的网页.一切看起来都是那么的美好.这一小节就准备实现可以根据地址栏url的不同来返回指定的网页.目前还不考虑带参 ...
- FFmpeg: AVPacket 结构体分析
AVPacket是FFmpeg中很重要的一个数据结构,它保存了解封装之后,解码之前的数据(注意:仍然是压缩后的数据)和关于这些数据的一些附加信息,如显示时间戳(pts).解码时间戳(dts).数据时长 ...
- 消息推送之百度云推送Android集成与使用方法
这两天由于项目需要,研究了一下百度云推送,本来这事没什么多大工作量的,但注册百度开发者账户创建应用令我蛋疼菊紧了好一阵,这些东西做了对技术没啥提升,不做又不行,必经之路.好在我耗费了N多个毫毫秒秒后稀 ...
- 在Centos 6 64bit 上安装 Hyperic HQ 5.8.2.1 中文版
原文:https://my.oschina.net/hyperichq/blog/306791 环境描述: [test@tester ~]$ cat /etc/issue CentOS release ...
- hdoj:2022
#include <iostream> #include <string> using namespace std; int main() { int m, n; int x, ...
- Java知多少(89)列表和组合框
有两种类型的菜单:下拉式菜单和弹出式菜单.本章只讨论下拉式菜单编程方法.菜单与JComboBox和JCheckBox不同,它们在界面中是一直可见的.菜单与JComboBox的相同之处是每次只可选择一个 ...
- MQTT 学习记录
学习mqtt协议,从网上找demo验证一下. 参考链接 https://www.jianshu.com/p/ebbe25d1c4b2 https://blog.csdn.net/xxmonstor/a ...
- windows server 2008 R2 计划任务备份系统
实验环境拓扑图: 实验效果: Windows Server Backup 可以设置备份计划,但只能按日进行备份,不能设置按周或月进行备份.所以,需要使用到 windows Server 2008 R2 ...
- linux下Ftp服务安装
安装vsftp 使用yum命令安装vsftp #yum install vsftpd -y 如果yum安装不成功,可以到 http://pkgs.org/centos-6/centos-x86_64/ ...
- 九度OJ 1067 n的阶乘 (模拟)
题目1067:n的阶乘 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5666 解决:2141 题目描写叙述: 输入一个整数n,输出n的阶乘 输入: 一个整数n(1<=n<=2 ...