Difference between revisions of "ISCSI Boot"

From ArchWiki
Jump to: navigation, search
m (typo)
(add a note that there are no details for the actual boot..)
Line 12: Line 12:
 
{{Article summary end}}
 
{{Article summary end}}
  
You can install and boot Arch on an [[iSCSI Target]].
+
You can install Arch on an [[iSCSI Target]].
 
This howto will guide you through the process.
 
This howto will guide you through the process.
 +
 +
(The actual boot will use an extra drive / usb drive or pxe boot?)
  
 
== Server / Target Setup ==
 
== Server / Target Setup ==

Revision as of 04:45, 2 March 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:ISCSI Boot#)
Summary help replacing me
How to install Arch on an iSCSI target.
Related
iSCSI Target
iSCSI Initiator

You can install Arch on an iSCSI Target. This howto will guide you through the process.

(The actual boot will use an extra drive / usb drive or pxe boot?)

Server / Target Setup

You can set up an iSCSI target with any hosting server OS. Follow the procedure outlined in iSCSI Target if you use Arch Linux as the hosting server OS.

Client / Initiator Setup

Install over iSCSI

Note: For running shell commands during install press Template:Keypress+Template:Keypress to switch between ttys.
Note: If you use Virtualbox, press Template:Keypress+Template:Keypress to switch between ttys, where Template:Keypress is normally the Template:Keypress key.

Download Arch Linux ISO image [1] and boot Arch Linux using the ISO image. After Arch Linux is booted, login as "root" and type "/arch/setup" to bring up the installer. Either use net as the install source or manually ifconfig and dhcp.

Now before you continue to "Prepare Hard Drive(s)" install open-iscsi and connect to target.

Be sure to your servers IP address, Name, etc.

wget http://aur.archlinux.org/packages/open-iscsi/open-iscsi.tar.gz

tar xzvf open-iscsi.tar.gz

cd open-iscsi

pacman -Sy

pacman -S patch make gcc

makepkg --asroot

pacman -U open-iscsi...pkg.tar.xz

modprobe iscsi_tcp

iscsistart -i iqn.2010-06.ClientName:desc -t iqn.2010-06.ServerName:desc -g 1 -a 192.168.1.100

During the above procedures, if "pacman -Sy" asks you to upgrade pacman, answer "no" otherwise pacman may fail to install patch, make, and gcc, which are essential to the compilation of the open-iscsi source.

(Optional) If you want to make sure that your iSCSI target is up and running, you may start "iscsid" and check whether the iSCSI target is available.

# iscsid
# iscsiadm -m discovery -t sendtargets -p <server-IP>

Continue to prepare the hard drive, using the iSCSI target drive. It is suggested that you manually create a partition that uses the entire iSCSI target drive.

Note: When you "Manually Configure block devices, filesystems and mountpoints" make sure that you use UUID. This way there won't be any issues booting if the number of devices changes (/dev/sda /dev/sdb ...) by adding or removing hard drives, usb thumb drives, etc... or booting it on different machines.
Note: It is recommended that you NOT include swap on the iSCSI drive when creating the partitions, you can just ignore the warning.

Before you "Configure System" you must install open-iscsi to the "future" root filesystem, and download and install the hook for booting from iSCSI. This should be done after all selected packages are installed.

Create these hook files, replacing the IP, etc. You may create these hook files after open-iscsi is installed to the "future" root filesystem.

1. /mnt/lib/initcpio/install/iscsi: It should look like the following.

# vim: set ft=sh:

install ()
{
    MODULES="iscsi_tcp libiscsi libiscsi_tcp scsi_transport_iscsi crc32c $(checked_modules "/drivers/net/") "
    BINARIES="/sbin/iscsistart"
    FILES=""
    SCRIPT="iscsi"
}

help ()
{
cat <<HELPEOF
  This hook allows you to boot from an iSCSI target.
HELPEOF
}

2. /mnt/lib/initcpio/hooks/iscsi: It should look like the following.

# vim: set ft=sh:

run_hook ()
{
    modprobe iscsi_tcp
    ifconfig eth0 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255
    sleep 10
    iscsistart -i iqn.2010-06.ClientName:desc -t iqn.2010-06.ServerName:desc -g 1 -a 192.168.1.100
}

If you want to use dhcp for the above script, you may try to replace the "ifconfig" line with "dhcpcd eth0", but make sure that dhcpcd is installed.

Now, you can install open-iscsi into the "future" root filesystem.

mv open-iscsi...pkg.tar.xz /mnt/root

chroot /mnt/ /bin/bash

cd /root/

pacman -U open-iscsi...pkg.tar.xz

Now you can create the above hook files by pasting the above scripts.

nano /lib/initcpio/install/iscsi

nano /lib/initcpio/hooks/iscsi

exit

Now you are ready to "Configure System." Most of the configuration files can remain unchanged.

Add "iscsi" to the HOOKS in /etc/mkinitcpio.conf. The "mkinitcpio" will generate a new kernel image after you are done with "Configure System."

Note: If you plan on booting this installation of Arch on machines with nic cards that require different modules, remove "autodetect" from HOOKS
Note: Rebuilding the initial ramdisk will take some time if autodetect is removed from HOOKS

When configuring grub find the lines for Arch that are

root (hdX,0)

and change to

root (hd0,0)