- 论坛徽章:
- 0
|
iSCSI Linux diskless booting
Created by cclausen. Last edited by cclausen, 7 days ago. Viewed 573 times.
PXE boot to an iSCSI root using freely available Linux clients
As a reference, I suggest you read through the iSCSI-Root mini-HOWTO. I tried to use that mkinitrd script, but it did not work on a RedHat 7.3 system using the Linux-iSCSI 3.6.2 driver. I think it will work fine with other versions but I have not tested it, as the iscsi-init module works very well and I'm just going to use it from now on.
I used WinTarget as the iSCSI target (I do realize its not free.) Works great! I was told they would have educational pricing very soon. As I test other iSCSI target software, I'll list them here. I'll note that I could not get the UNH iscsi target software to work with a 2.4.26 kernel on Debian unstable, but its probably my fault. I'll eventually get around to testing out iSCSI Enterprise Target but I haven't done it yet, mostly b/c of non-iSCSI related issues when using the 2.6 kernel.
To get this all working, you pretty much just compile and install linux-iscsi and iscsi-init by following the instructions and create a initrd to load the drivers. You could build everything into the kernel, but that probably isn't a good idea if you need to support a lot of different machines with different hardware.
I'll post my config files for using the Debian mkinitrd very soon. (I need to fix some stuff..)
Compile iscsi-init and follow its instructions to mount the initrd image and add the config files, iscsi_sfnet and iscsi_init modules to it.
You can follow the iSCSI-Root mini-HOWTO to setup PXE booting. Those instructions work just fine.
If you are lazy (and I certainly am) you can just use my kernel and RAM disk. The following Debian packages are available for download: (Note that can use this RAM disk and kernel on a non-Debian system, you'd just need to make sure that the modules needed locally on the client match.)
kernel-image-2.4.30-iscsi.deb Debian kernel package based on linux-2.4.30 from kernel.org
vmlinuz-2.4.30-iscsi kernel based on the kernel.org 2.4.30 source with linux-iscsi 3.6.2
openafs-modules-2.4.30-iscsi_1.3.81.deb OpenAFS kernel module for this kernel, if you need it.
nvidia-kernel-2.4.30-iscsi_1.0.7174.deb if you need the nvidia driver.
initrd-2.4.30-iscsi.gz initrd with support for most network cards (tested with for Intel PRO 100 NICs), others to follow
pxelinux.0 PXELinux "kernel"
Follow these steps:
Install Debian to a hard drive for now on the machine you want to boot over iSCSI. I suggest using a single large root partition the first time. You do not need swap, as you probably don't want memory access to incur network latency.
You probably want to run sarge or sid and NOT woody (something was broken; I don't remember what.)
apt-get dist-upgrade
download my kernel-image package.
dpkg -i kernel-image-*.deb as root.
OPTIONAL Install the openafs module package if you want to access AFS space. (If you have no idea what I am talking about you can safely ignore this step.)
make sure a DHCP / PXE / TFTP server is available on your network. If you are using some version of ISC DHCP (and its very likely that you are) you can use the following steps to set this up:
Install ISC DHCP. This is OS specific and shouldn't be too hard.
edit the dhcpd.conf file (usually in /etc)
#You will of course need to modify this for your environment
shared-network ISCSI {
option domain-name "internal.domain.org";
option domain-name-servers 10.0.0.1
allow booting;
allow bootp;
default-lease-time 900;
max-lease-time 21600;
host pdu {
hardware ethernet 00:08:C7:8A:39:08;
fixed-address 10.0.8.10
next-server 10.0.0.1;
filename "pxelinux.0";
option root-path "10.0.8.100:/iqn.2003-05.com.stringbeansoftware:target.internal.domain.org/iqn.1987-05.com.cisco:pdu.internal.domain.org/1";
}
}
place vmlinuz-2.4.30-iscsi in /tftpboot/
place initrd-2.4.30-iscsi.gz in /tftpboot/
place pxelinux.0 in /tftpboot/
copy the following text to /tftpboot/pxelinux.cfg/IP.cfg
TIMEOUT 50
PROMPT 1
DEFAULT linux_iscsi_root
LABEL linux_iscsi_root
KERNEL vmlinuz-2.4.30-iscsi
APPEND root=/dev/sda1 initrd=initrd-2.4.30-iscsi.gz ether=0,0,0x30,0,eth0
IPAPPEND 1
LABEL disk
LOCALBOOT 0
rename IP.cfg as per the PXElinux instructions or you can simply name it default if you are too lazy to fingure out the file naming scheme.
edit IP.cfg and customize it for the initrd and kernel that you are using. (The default should work if you are using the one on this page.)
enable your system's tftp daemon by editing /etc/inetd.conf and running
/etc/init.d/inetd reload
or a similar command on your system.
set your computer to boot to LAN and try it out. It will probably fail after the kernel loads, as there is no file system on the iSCSI volume yet. I'd recomend running the iscsi_sfnet software on a machine with a disk to create the root partition for the other machine. You should be able to follow the instructions to do this. If not, I can send you a tarball or a dd image of a base Debian sarge install.
you will need to partition the iSCSI volume:
cfdisk /dev/sda
create a filesystem:
mkfs -t ext3 /dev/sda
(You can try other filesystems, but I have only tested ext3.)
and mount it
mount /dev/sda /mnt
copy the OS from your HD to the iSCSI partition.
tar -C / -cpSf - | tar -xvpf -
If something isn't working let cclausen know about it and I might be able to help you out.
我使用as3 按照上面的步骤做了,可是在启动的时候出现这样的错误
![]()
请大侠指教 |
|