使用PXE安装Ubuntu问题总结

问题1:

当前PXE中DHCP配置与ubuntu不兼容
现象:

Ubuntu提示无法正确配置IP

PXE中:tailf /var/log/messages

Mar 10 11:08:25 MXY-PXE in.tftpd[24927]: RRQ from 172.16.8.250 filename pxelinux.cfg/01-78-2b-cb-32-0f-09 
Mar 10 11:08:25 MXY-PXE in.tftpd[24928]: RRQ from 172.16.8.250 filename ../boot.msg 
Mar 10 11:08:25 MXY-PXE in.tftpd[24929]: RRQ from 172.16.8.250 filename splash.lss 
Mar 10 11:09:05 MXY-PXE in.tftpd[24981]: RRQ from 172.16.8.250 filename ubuntu_1204_64/linux 
Mar 10 11:09:05 MXY-PXE in.tftpd[24982]: RRQ from 172.16.8.250 filename ubuntu_1204_64/initrd 
Mar 10 11:09:29 MXY-PXE dhcpd: DHCPDISCOVER from 78:2b:cb:32:0f:09 via eth0.206: network 172.16.8/24: no free leases
Mar 10 11:09:57 MXY-PXE last message repeated 10 times

原因
在当前dhcpd.conf中限制只对两类“pxelient、udhcp”标识进行分配,拒绝为其它服务器分配IP

解决方法
删除分类限制,配置成如下所示:

ddns-update-style interim;
ignore client-updates;
next-server 10.26.1.134;  
filename "pxelinux.0";  
allow booting;
allow bootp;

subnet 172.16.8.0 netmask 255.255.255.0 {
        option routers                  172.16.8.254;
        option subnet-mask              255.255.255.0;
        option nis-domain               "Cyou";
        option domain-name              "Cyou.com";
        option domain-name-servers      127.0.0.1;
        option time-offset              28800;
        pool {
                range                   172.16.8.2 172.16.8.250;
                default-lease-time      1000;
                max-lease-time          7200;
        }
}

问题2:

ubuntu不断发起DHCP请求,PXE服务器不断分配IP,但ubuntu还是报无法正确配置IP

PXEmessages记录:
Mar  9 18:19:12 MXY-PXE dhcpd: DHCPREQUEST for 172.16.8.215 (172.16.8.134) from 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:12 MXY-PXE dhcpd: DHCPACK on 172.16.8.215 to 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:12 MXY-PXE dhcpd: DHCPDISCOVER from 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:12 MXY-PXE dhcpd: DHCPOFFER on 172.16.8.215 to 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:14 MXY-PXE dhcpd: Unable to add forward map from ubuntu.Cyou.com to 172.16.8.215: not a zone
Mar  9 18:19:14 MXY-PXE dhcpd: DHCPREQUEST for 172.16.8.215 (172.16.8.134) from 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:14 MXY-PXE dhcpd: DHCPACK on 172.16.8.215 to 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:15 MXY-PXE dhcpd: Unable to add forward map from ubuntu.Cyou.com to 172.16.8.215: not a zone
Mar  9 18:19:15 MXY-PXE dhcpd: DHCPREQUEST for 172.16.8.215 (172.16.8.134) from 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:15 MXY-PXE dhcpd: DHCPACK on 172.16.8.215 to 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:17 MXY-PXE dhcpd: Unable to add forward map from ubuntu.Cyou.com to 172.16.8.215: not a zone
Mar  9 18:19:17 MXY-PXE dhcpd: DHCPREQUEST for 172.16.8.215 (172.16.8.134) from 78:2b:cb:32:0f:09 (ubuntu) via eth0.206
Mar  9 18:19:17 MXY-PXE dhcpd: DHCPACK on 172.16.8.215 to 78:2b:cb:32:0f:09 (ubuntu) via eth0.206

问题原因
1. DNS设置为了更新启用,在dhcpd.conf中有如下一项
ddns-updates on;
2. 分配时间太短
default-lease-time 1000;
max-lease-time 7200;
这个时间对ubuntu来说太短

解决方法
1. 删除以下项
ddns-updates on;
在subnet中启用选项
option domain-name-servers 127.0.0.1;
2. 修改分配时间为以下值
default-lease-time 200;
max-lease-time 400;

问题3:

使用PXE安装Ubuntu问题总结_第1张图片
使用PXE安装Ubuntu问题总结_第2张图片
原因
1. 在ks.cfg %packages下指定的软件有错误
2. %packages下写的软件名有语法错误
3.
解决方法
1. 确认软件名称
2. 仔细检查并修改语法错误

问题4:

安装提示如下图所示:
使用PXE安装Ubuntu问题总结_第3张图片
按alt+F4后显示:

INFO: Menu item 'live-installer' selected
base-installer: error: Could not find any live images
WARNING **: Configuring 'live-installer' failed with error code 1
WARNING **: Menu item 'live-installer' failed.

原因
暂时怀疑Ubuntu镜像中的启动文件linx和initrd.gz中只包含了livecd启动过程的文件系统,无法有效识别硬盘和正常的文件系统

解决方法
在default文件中append 中加入参数live-installer/net-image=http://10.26.1.134/UBUNTU1404_64/install/filesystem.squashfs,整个default中的安装项如下所示:

label ubuntu_1404_64_8
  kernel ubuntu_1404_64/linux
  append  netmask=255.255.255.0 gateway=172.16.8.254 ksdevice=em1 initrd=ubuntu_1404_64/initrd.gz live-installer/net-image=http://10.26.1.134/UBUNTU1404_64/install/filesystem.squashfs  nofb text ks=http://10.26.1.134/conf/ubuntu_1404_64.cfg

问题5:

安装ubuntu后重启出现如下所示错误
Check root= bootarg cat /proc/cmdline
or missing modules, devices: cat /proc/modules ls /dev
ALERT! /dev/disk/by-uuid/9a4fcd54-f38f-4dd6-b126-983d7a4c32b5 does not exist. Dropping to a shell !

Busybox v1.1.3 (Debian 1:1.1.3 ubuntu 12)
Built in shell (ash)

(initramfs)_
没有正常进入系统

原因
此错误为已经被公布的BUG。
“Lucid: Gave up waiting for root device (mptsas) resolved by rootdelay”
BUG地址: https://bugs.launchpad.net/ubuntu/+bug/579572

解决方法
1.在(initramfs) 下 输入 exit 后回车,操作系统开始引导.
2.进入系统后,编辑/etc/default/grub 文件,寻找到GRUB_CMDLINE_
LINUX_DEFAULT=”quite” 修改为 GRUB_CMDLINE_
LINUX_DEFAULT=”rootdelay=50 ”
3. sudo update-grub 更新 grub配置文件
4.重启后解决

问题6

自动配置IP问题

原因
Ubuntu内核不识别 ip=172.16.xx.xx参数,只能在装机完成后进行配置
需要ipmitool工具的支持,以ILO IP为基础进行配置,而ipmitool需要在重启后生效

解决方法
将配置IP的脚本放入/etc/rc.local中

你可能感兴趣的:(问题分析解决)