mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-28 02:44:42 +00:00
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
175 lines
8.5 KiB
Plaintext
175 lines
8.5 KiB
Plaintext
1) If you haven't done so already install a base gentoo installation:
|
|
download: http://www.gentoo.org/main/en/where.xml
|
|
documentation: http://www.gentoo.org/doc/en/handbook/index.xml
|
|
|
|
2) Lets make sure our package info is up2date
|
|
'emerge --sync'
|
|
|
|
3) You can get the SCST source files from http://scst.sourceforge.net/downloads.html
|
|
As I want a stable platform I use the downloads from "Download released versions"
|
|
For the iscsi-target we need three files: scst, iscsi-scst and scstadmin.
|
|
You can get these files in varios ways, in the example they are downloaded with links.
|
|
If links is not already installed install it:
|
|
'emerge links'
|
|
Go the the directory where you want the files (the example uses /root) and get the files:
|
|
'cd /root'
|
|
'links http://scst.sourceforge.net/downloads.html'
|
|
and download under stable the three needed files, at this moment they are scst-1.0.1.1.tar.gz, scstadmin-1.0.6.tar.gz and iscsi-scst-1.0.1.1.tar.gz
|
|
after downloading exit links:
|
|
'q'
|
|
|
|
4) Now extract the three downloaded files
|
|
'tar -zxf scst-1.0.1.1.tar.gz'
|
|
'tar -zxf scstadmin-1.0.6.tar.gz'
|
|
'tar -zxf iscsi-scst-1.0.1.1.tar.gz'
|
|
|
|
5) Because SCST needs some kernel patches we need to check which kernels are supported.
|
|
'ls /root/scst-1.0.1.1/kernel/'
|
|
This shows a list of kernel patches, we can see now the newest kernel scst 1.0.1.1 has patches for is kernel 2.6.29.
|
|
Now lets see which is the newest gentoo kernel.
|
|
'emerge --search gentoo-sources'
|
|
This shows the current installed kernel (if you are running the gentoo-sources kernel) and the newest version at this moment is 2.6.30-r6.
|
|
As we need an older kernel to use SCST we will need to explicitly tell emerge which kernel we want.
|
|
To find out which kernel we need we can take a look at http://packages.gentoo.org/package/sys-kernel/gentoo-sources
|
|
'links http://packages.gentoo.org/package/sys-kernel/gentoo-sources'
|
|
You will need to scroll down a bit to see the table. At this moment is shows that 2.6.29-r5 is the newest for the x86 and amd64 platform, so we want the 29-r5 kernel.
|
|
'emerge =gentoo-sources-2.6.29-r5'
|
|
The kernel source will now be in /usr/src/linux-2.6.29-gentoo-r5
|
|
|
|
6) Now we need to patch the kernel sources. First we set the /usr/src/linux link to the new kernel sources.
|
|
'rm /usr/src/linux'
|
|
'ln -s /usr/src/linux-2.6.29-gentoo-r5/ /usr/src/linux'
|
|
There are multiple kernel patches for SCST and not all are required but give better performance or new features.
|
|
Read the documentation from SCST to see what the patches are for and which ones you need/want.
|
|
The kernel patches are in /root/scst-1.0.1.1/kernel/ and /root/iscsi-scst-1.0.1.1/kernel/patches/.
|
|
Now Patch the kernel sources
|
|
'cd /usr/src/linux'
|
|
'patch -p1 < /root/scst-1.0.1.1/kernel/io_context-2.6.29.patch'
|
|
'patch -p1 < /root/scst-1.0.1.1/kernel/scst_exec_req_fifo-2.6.29.patch'
|
|
'patch -p1 < /root/scst-1.0.1.1/kernel/readahead-context-2.6.29.patch'
|
|
'patch -p1 < /root/scst-1.0.1.1/kernel/readahead-2.6.29.patch'
|
|
'patch -p1 < /root/iscsi-scst-1.0.1.1/kernel/patches/put_page_callback-2.6.29.patch'
|
|
? not required 'make clean'
|
|
|
|
7) Lets configure and build the kernel
|
|
'make menuconfig'
|
|
Make sure to enable a few kernel options.
|
|
in Networking Support -> Networking Options:
|
|
"TCP/IP networking" and "TCP/IP zero-copy transfer completion notification"
|
|
in Device Drivers -> SCSI Device Support:
|
|
"SCSI disk support"
|
|
Make sure you include all needed storage and lan drivers
|
|
|
|
-----optional, for maximum performance:-----
|
|
in Enable the block layer -> IO Schedulers
|
|
enable "CFQ I/O scheduler"
|
|
set "Default I/O scheduler" to "CFQ"
|
|
in Processor type and features
|
|
set "Preemption Model" to "No Forced Preemption (Server)"
|
|
set "High Memory Support" to "off" (use a 64bit kernel when using more then 1GB of RAM to get the best performance)
|
|
in File systems
|
|
enable "XFS filesystem support" (XFS is much faster then ext3 when using virtual-file-devices for the iSCSI target)
|
|
-----optional end-----
|
|
|
|
Build the kernel and install the kernel modules
|
|
'make'
|
|
'make modules_install'
|
|
Now copy the kernel to the boot directory (replace the directory after arch with your architecture, x86 for example)
|
|
'cp arch/x86_64/boot/bzImage /boot/kernel-2.6.29-gentoo-r5'
|
|
Add the new kernel to the configuration as described in the gentoo handbook (with grub you should edit /boot/grub/grub.conf)
|
|
Reboot the system with the new kernel
|
|
'shutdown -r now'
|
|
|
|
8) Lets configure, build and install SCST
|
|
'cd /root/scst-1.0.1.1/src'
|
|
'make all'
|
|
'make install'
|
|
|
|
9) Build and install scstadmin
|
|
'cd /root/scstadmin-1.0.6'
|
|
'make all'
|
|
'make install'
|
|
Remove the scst_disk module from the startup file
|
|
'nano -w /etc/init.d/scst'
|
|
change the line SCST_MODULES="scst scst-disk scst_vdisk" to SCST_MODULES="scst scst_vdisk"
|
|
|
|
10) Build and install iscsi-scst
|
|
'cd /root/iscsi-scst-1.0.1.1'
|
|
'make all'
|
|
'make install'
|
|
'cp etc/initiators.* /etc'
|
|
'cp etc/iscsi-scstd.conf /etc'
|
|
|
|
11) Make SCST init script work
|
|
As the scst init scipt uses lsb init-functions which are not available for gentoo scst can not run yet.
|
|
There are two easy ways to make it work. 1) Modify the SCST init script so it doesn't use init-functions. 2) Get the required init-functions scripts from another distro.
|
|
Choose one these options.
|
|
|
|
11-1) Modify the SCST script
|
|
The simplest way to do this is to remove/replace all lsb init-functions.
|
|
- remove or comment (put a # in front of) the line ". /lib/lsb/init-functions"
|
|
- replace all 'log_failure_msg' with 'echo "failure"' and replace all 'log_success_msg' with 'echo "succes"'
|
|
|
|
11-2) Get /lib/lsb/init-functions and /etc/rc.status from another distribution
|
|
See an example on how to do this on http://www.gentoo-wiki.info/Rivendell and only do the actions as described under "File creation"
|
|
Now you should have created /etc/rc.status and /lib/lsb/init-functions and set their permissions.
|
|
|
|
12) Configure iSCSI-SCST configuration
|
|
choose a target name and disk names and set it iscsi-scstd.conf, see the comments on the target name requirements in the same file.
|
|
'nano -w /etc/iscsi-scstd.conf'
|
|
|
|
-----example iscsi-scstd.conf-----
|
|
Target iqn.2009-10.nl.feka:storage.disk.1.vms
|
|
Target iqn.2009-10.nl.feka:storage.disk.2.iso
|
|
Target iqn.2009-10.nl.feka:storage.filedisk.1.backup
|
|
-----example end-----
|
|
|
|
13) Configure SCST configuration
|
|
SCSTadmin can create the SCST config but needs SCST to be loaded, unfortunately the initscript does not load SCST when scst.conf is not there.
|
|
Create an empty scst.conf.
|
|
'touch /etc/scst.conf'
|
|
Start SCST
|
|
'/etc/init.d/scst start'
|
|
Create an empty configuration.
|
|
'scstadmin -ClearConfig /etc/scst.conf'
|
|
Add the iSCSI disk(s), make sure to replace the device name(s) in the command(s) below:
|
|
'scstadmin -adddev disk01 -path /dev/sdb1 -handler vdisk -options BLOCKIO' (use this to add a disk/partition/file in BlockIO mode without caching)
|
|
'scstadmin -adddev disk02 -path /dev/sdc -handler vdisk -options NV_CACHE' (use this to add a disk/partition/file in FileIO mode with linux cache)
|
|
'scstadmin -adddev disk03 -path /root/vhdd1 -handler vdisk -options NV_CACHE' (use this to add a disk/partition/file in FileIO mode with linux cache)
|
|
Create a group for each target. (make sure to name the entry after Default_ the same as the names specified in iscsi-scstd.conf)
|
|
'scstadmin -addgroup Default_iqn.2009-10.nl.feka:storage.disk.1.vms'
|
|
'scstadmin -addgroup Default_iqn.2009-10.nl.feka:storage.disk.2.iso'
|
|
'scstadmin -addgroup Default_iqn.2009-10.nl.feka:storage.filedisk.1.backup'
|
|
Assign the device(s) to the group(s).
|
|
'scstadmin -assigndev disk01 -group Default_iqn.2009-10.nl.feka:storage.disk.1.vms -lun 0'
|
|
'scstadmin -assigndev disk02 -group Default_iqn.2009-10.nl.feka:storage.disk.2.iso -lun 0'
|
|
'scstadmin -assigndev disk03 -group Default_iqn.2009-10.nl.feka:storage.filedisk.1.backup -lun 0'
|
|
Save the configuration.
|
|
'scstadmin -WriteConfig /etc/scst.conf'
|
|
|
|
14) Set initiator connection rights
|
|
As default disable all targets for all initiators.
|
|
Add one line to initiators.deny with "ALL ALL"
|
|
'nano -w /etc/initiators.deny'
|
|
|
|
-----example initiators.deny-----
|
|
ALL ALL
|
|
-----example end-----
|
|
|
|
Add the inititators that may access the targets to initiators.allow.
|
|
Add one line per initiator with all initiators that need access, see the comments in the same file
|
|
'nano -w /etc/initiators.allow'
|
|
|
|
-----example initiators.allow-----
|
|
iqn.2009-10.nl.feka:storage.disk.1.vms 192.168.1.1, 192.168.1.2, 192.168.1.3
|
|
iqn.2009-10.nl.feka:storage.disk.2.iso 192.168.1.1, 192.168.1.2, 192.168.1.3
|
|
iqn.2009-10.nl.feka:storage.filedisk.1.backup 192.168.1.10
|
|
-----example end-----
|
|
|
|
15) Add SCST and iSCSI-SCST to default run-level and start iscsi-scst
|
|
'rc-update add scst default'
|
|
'rc-update add iscsi-scst default'
|
|
'/etc/init.d/iscsi-scst start'
|
|
|
|
Willem Boterenbrood
|