Finished installing Fedora 15 x86_64 to a iscsi root. Using pxeboot to install from and to boot the OS for now on.
Worked really easily using the advanced disk option and installing to an iscsi target. Couple gotchas caught me up.
1. The line in /boot/grub/menu.lst uses p7p1 for eth0 so it wouldn't find my nic and boot root. This caused a kernel panic on boot trying for no or empty root= line
2. Messagebus wouldn't start when booting the new OS. So it would hang trying to go to X. In /etc/fstab it had all the local filesystems, (the ones on the iscsi target) marked as _netdev. Once i took these out it boots like a charm.
This is my pxeboot file.
Code:PROMPT 0 MENU TITLE ISCSI BOOT TIMEOUT 20 Default menu.c32 LABEL Fedora15 MENU LABEL Fedora15 kernel pxelinux.cfg/MSsux-boot/vmlinuz-2.6.38.6-27.fc15.x86_64 ro root=/dev/mapper/vg_MSsux-lv_root netroot=iscsi:@192.168.0.2::3260::iqn.2008-09.com.microsoft:MSsux.rootlun iscsi_initiator=iqn.2008-09.com.microsoft:MSsux.rootlun ip=eth0:dhcp ifname=eth0:00:ab:cd:ef:gh:ij rd_LVM_LV=vg_MSsux/lv_root rd_LVM_LV=vg_MSsux/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us noapic acpi=off rhgb quiet initrd pxelinux.cfg/MSsux-boot/initramfs-2.6.38.6-27.fc15.x86_64.img
scp'd, once i was at the last screen of the install, the /boot/vmlinuz... /boot/initramfs... and /boot/grub/menu.lst to my iscsi machine and using those to pxeboot with.
When i was still there i should have vi'd the /srv/sysimage/etc/fstab and removed the _netdev mount options from the local filesystems. (keeps messagebus from working subsequently if not)
then put the grub kernel and append line in my pxeboot file. have to change the odd nic names though.
---------- Post added at 03:09 PM ---------- Previous post was at 02:07 PM ----------
I wanted to try Fedora 15 but didnt want to reload my current machine. Gnome 3 is all that gui stuff.
I used this page for the pxeboot setup.
http://linux-sxs.org/internet_serving/pxeboot.html
I used this page for the iscsi setup.
http://www.cyberciti.biz/tips/howto-...nwith-tgt.html
So what i decided to do was create an iscsi target and boot it. The motherboard I wanted to use doesn't support booting from iscsi targets. One of my motherboards does but I can't use it for this. So i decided I would use pxeboot to start the boot process.
Setup tftpboot server for install and later to boot the machine.
a. Install the tftp-server dhcp httpd and syslinux
Code:sudo yum install tftp-server dhcp httpd syslinux
b. setup dhcpd put this in /etc/dhcp/dhcpd.conf
Code:sudo cp /etc/dhcp/dhcpd.conf{,.ORIG} cat << EOF | sudo tee /etc/dhcp/dhcpd.conf 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; } EOF
c. setup xinetd. add this line to /etc/hosts.allow
Code:echo "in.tftpd: 192.168.0." | sudo tee -a /etc/hosts.allow
d. change the disable line to "no" in /etc/xinetd.d/tftp. I also changed the server_args line to -s /tftpboot because that is where i like it...
e. setup http to serve the installation files.Code:cat << EOF | sudo tee /etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot/ disable = no per_source = 11 cps = 100 2 flags = IPv4 } EOF
Code:cat << EOF | sudo tee /etc/httpd/pxeboot.conf # <Directory "/tftpboot"> order deny,allow deny from all allow from 127.0.0.1 allow from 192.168.0.0/24 </Directory> Alias /tftpboot /var/www/tftpboot/ EOF
f. create tftpboot directories
i. create the httpd directories and mount the Fedora15 Installation DVD iso imageCode:sudo mkdir -p /tftpboot/pxelinux.cfg/Fedora15-x86_64 sudo cp /usr/share/syslinux/pxelinux.0 /tftpboot/ sudo cp /usr/share/syslinux/menu.c32 /tftpboot/
j. create a default pxeboot image that will boot the installation.Code:sudo mkdir /var/www/tftpboot sudo cp ~/Downloads/Fedora-15-x86_64-DVD.iso /var/www/tftpboot sudo mkdir /var/www/tftpboot/Fedora15 sudo mount -o loop /var/www/tftpboot/Fedora-15-x86_64-DVD.iso /var/www/tftpboot/Fedora15
k. create httpd for Fedora15 Installation DVD iso imageCode:sudo cp /tftpboot/pxelinux.cfg/default{,-ORIG} cat << EOF | sudo tee /tftpboot/pxelinux.cfg/default default Fedora15 timeout 10 label Fedora15 kernel pxelinux.cfg/Fedora15-x86_64/vmlinuz-F15-x86_64 append initrd=pxelinux.cfg/Fedora15-x86_64/initrd-F15-x86_64.img ramdisk_size=9216 noapic acpi=off EOF
l. Copy the installation kernel and initrd into place.Code:sudo mkdir /var/www/tftpboot sudo cp ~/Downloads/Fedora-15-x86_64-DVD.iso /var/www/tftpboot sudo mkdir /var/www/tftpboot/Fedora15 sudo mount -o loop /var/www/tftpboot/Fedora-15-x86_64-DVD.iso /var/www/tftpboot/Fedora15
Code:sudo cp /var/www/tftpboot/Fedora15/isolinux/vmlinux /tftpboot/pxelinux.cfg/Fedora15-x86_64/vmlinuz-F15-x86_64 sudo cp /var/www/tftpboot/Fedora15/isolinux/initrd.img /tftpboot/pxelinux.cfg/Fedora15-x86_64/initrd-F15-x86_64.img
m. allow connection through iptables.
n. start dhcpCode:# allow dhcp requests sudo /sbin/iptables -I INPUT -p udp --sport 68 --dport 67 -j ACCEPT # allow tftp requests sudo /sbin/iptables -I INPUT -p udp -s 192.168.0.0/24 --dport 69 -j ACCEPT # allow http requests sudo /sbin/iptables -I INPUT -p tcp -s 192.168.0.0/24 --dport 80 -j ACCEPT
Code:sudo /etc/init.d/dhcpd start
o. restart xinetd - for tftp
Code:sudo /etc/init.d/xinetd restart
p. start httpd
Code:sudo /etc/init.d/httpd start
q. pxeboot the client and Install. When you get to the Disk selection at the bottom of the screen click advanced disk devices. It will pop up a menu and you can add an iscsi disk. This part was kind of weird and I think i had to create a disk under the "other" tab. Poke around and you can find it.
Once the installation completes and you are at the last screen with the reboot button in the bottom right. hit ALT+F2 to switch to a console tty. You need to grab your vmlinuz, initrd and grub file. If you do this now it will make life much easier. I just scp'd them to my iscsi server.
{i forget the name of the /mnt/sysimage dir now... so these may be wrong.} You dont need the menu.lst file but the lines you will need are in it. The line is long and the syntax is odd, so I would suggest copy+paste'ing it.
*** One gotcha that caught me up, is the install will mark the filesystem on the iscsi target with mount options _netdev in the /etc/fstab. This caused messagebus not to start and I got the chance to learn about systemd. I would suggest editing the fstab file now and learning about systemd later, once booted.Code:scp /mnt/sysimage/boot/vmlinuz* 192.168.0.2: scp /mnt/sysimage/boot/initramfs* 192.168.0.2: scp /mnt/sysimage/boot/grub/menu.lst 192.168.0.2:
This sed command will remove all the ",_netdev" options from the fstab file. You may have some FS's that require these though, up to you. For the install described here you wont. This sed command will save a copy of the fstab file at /mnt/sysimage/etc/fstab.ORIG if you make a mistake.
r. create the new pxeboot file for the system to boot from for now on. You will need the mac address of the client machine or you could create it as the default boot or make a menu or ... I would suggest making a mac specific boot target. Just makes life easier and if their are problems it wont affect your other machines.Code:sed -i.ORIG 's/,_netdev//' /mnt/sysimage/etc/fstab
Set these variables for your environment and then run the below sed command on your pxeboot server. This will create the pxeboot file to boot from. I got the kernel line below from the grub file I copied during the install. My grub file showed the nic as p7p1 though so i had to edit that to eth0 before this would work. Not sure why it passes swap and var through the initrd though, I haven't tried cleaning up the kernel line yet.
s. reboot your client system and done.Code:MACADDRESS="Mac address of the boot nic in the machine that will use the iscsi target for root" ISCSI_TARGET="This is the iscsi target name. Check the iscsi howto above." ISCSI_SERVERIP="This is the IP of your iscsi server." sed -e "s/{MACADDRESS}/$MACADDRESS/g; s/{ISCSI-TARGET}/$ISCSI_TARGET/g; s/{ISCSI-SERVERIP}/$ISCSISERVERIP/g" << EOF | sudo tee /tftpboot/pxelinux.cfg/00-`echo $MACADDRESS | sed -e 's/:/-/g'` PROMPT 0 MENU TITLE ISCSI BOOT TIMEOUT 20 Default menu.c32 LABEL Fedora15 MENU LABEL Fedora15 kernel pxelinux.cfg/vmlinuz-2.6.38.6-27.fc15.x86_64 ro root=/dev/mapper/vg0-lv_root netroot=iscsi:@{ISCSI-SERVER-IP}::3260::{ISCSI-TARGET} iscsi_initiator={ISCSI-TARGET} ip=eth0:dhcp ifname=eth0:{MACADDRESS} rd_LVM_LV=vg0/lv_root rd_LVM_LV=vg0/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us noapic acpi=off rhgb quiet initrd pxelinux.cfg/initramfs-2.6.38.6-27.fc15.x86_64.img EOF



Reply With Quote
7
6:E5
