Linux NFS Root and PXE-Boot

November 6, 2006

Home· Linux

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

NFS-Root-Client Mini-HOWTO

NFS-Root mini-HOWTO

NFS-Root

http://www.tldp.org/HOWTO/Diskless-root-NFS-other-HOWTO-4.html

Linux NFS Root and PXE-Boot的更多相关文章

  1. Linux NFS 服务部署

    系统环境:Oracle Linux 5.7 服务端:192.168.1.111 客户端:192.168.1.171 一.服务端配置 二.客户端配置 一.服务端配置 1.依次启动portmap和nfs服 ...

  2. Linux NFS存储服务部署

    什么是NFS 中文意思是网络文件系统,主要功能是通过网络(一般是局域网)让不同主机之间可以共享文件或目录 NFS属于本地文件存储服务 缺点1: 1 2 3 4 5 6 7 windows上无法使用   ...

  3. Redhat Linux NFS配置

    Linux下,All deviceis file,所有的设备都是文件.当我们需要把某些文件夹就或者文件共享给其他用户,就可以使用网络文件系统. 本文介绍Redhat Linux下的NFS配置. 在使用 ...

  4. linux nfs

    linux(十四)之linux NFS服务管理 学到这里差不多就结束了linux的基础学习了,其实linux的内容并不难,我们要经常的反复的去操作它,多多和它去联络感情才能很好的掌握这个linux. ...

  5. Linux破解root密码

    实验环境                 虚拟机软件:VMware Workstation                 操作系统:Read Hat Enteprise 6.3      1.破解r ...

  6. Linux NFS 说明,配置及故障分析

    一.NFS服务简介 NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Sun公司开发,于1984年向外公布.功能是通过网络让不同的机器.不同的操 ...

  7. linux nfs文件夹、文件共享

    ◆一.概念 NFS是网络文件系统(Network File System)的简称,是分布式计算机系统的一个组成部分,可实现在异构网络上共享和装配远程文件系统. NFS由SUN公司开发,目前已成为文件服 ...

  8. Linux nfs下载安装与简单配置

    1.什么是NFS? 全称 network file system 网络文件系统 通过网络存储和组织文件的一种方法或机制. 2.为什么要用共享存储? 前端所有的应用服务器接收到用户上传的图片.文件.视频 ...

  9. linux nfs服务配置挂载以及oracle使用nfs存储挂载注意事项

    服务端共享目录 /home/XXX/nfs_shared 172.16.22.0/24(rw,no_root_squash) service nfs restart 常用命令: 查看所有nfs共享目录 ...

随机推荐

  1. SNF快速开发平台3.0之--系统里广播的作用--迅速及时、简明扼要的把信息发送给接收者

    广播信息,即速度快捷.迅速及时.简明扼要的把信息发送给接收者. 当然在SNF快速开发平台上你也可以作为公告使用.不管当做什么使用要满足以下需求: 简单操作:页面操作简单 只需要输入内容就可以发送. 灵 ...

  2. HTML5 完美解决javascript中iphone手机和android手机复制文本到剪切板问题

    1.执行以下解决方案条件:(这个是原理) ①执行复制方法时 所复制文字不能被任何 块级元素和行内块元素和行内元素遮盖否则无效:(解决方案:将文本通过绝对定位或其他方式移除屏幕外) ②ios中不能复制属 ...

  3. Windows Media Player 的文件格式支持情况

    唔,官方文档:https://support.microsoft.com/zh-cn/help/316992/file-types-supported-by-windows-media-player ...

  4. D3.js学习

    // 1.选择d3.select('p')d3.selectAll('p')d3.select('.txt').style('color', '#fff')// 2.支持动态设置属性// a:随机属性 ...

  5. 【iCore4 双核心板_ARM】例程十六:USB_HID实验——双向数据传输

    实验方法: 1.USB_HID协议免驱动,此例程不需要驱. 2.将跳线冒跳至USB_OTG,通过Micro USB 线将iCore4 USB-OTG接口与电脑相连. 3.打开上位机软件usb_hid. ...

  6. 安卓程序代写 网上程序代写[原]Android应用的自动更新模块

    软件的自动更新一般都与Splash界面绑定在一起, 由于需要维护的软件界面很复杂, 一个Activity中嵌入ViewPager, 并且逻辑比较复杂, 索性重新写一个Activity, 现在的软件都很 ...

  7. 关于指针*前后const代表的意思——记住一个口诀“左内右本”

    记住一个口诀“左内右本”:const出现在*的左边,则说明指针所指向的内容是常量const出现在*的右边,则说明指针本身是常量如果*左右两边都出现const,那么说明指针本事是常量,它所指向的内容也是 ...

  8. pca , nmds , pcoa 图添加分组的椭圆

    对于pca , nmds, pcoa 这些排序分析来说,我们可以从图中看出样本的排列规则,比如分成了几组. 为例样本分组更加的直观,我们可以根据实验设计时的样本分组情况,对属于同一个group的样本添 ...

  9. 解决wireshark检测不到网卡的问题

    第一步 1.打开windows设备管理器. 2.查看-显示隐藏的设备 3.非即插即用驱动程序 4.NetGroup Packet Filter Driver 右键属性---驱动程序---启动类型,修改 ...

  10. Mac 上 Charles 抓取 iso http、https数据包

    一.下载charles包. http://www.charlesproxy.com/download/ 选择mac版本的最新包Charles is 3.11.4. http://www.charles ...