Guide - unRAID as iSCSI target


Recommended Posts

I've gotten iSCSI working well enough for unRAID to be an iSCSI target. However, the machine you connect from needs to be able to read/write reiserFS volumes, but you can test using another HDD in the unRAID, or using the flash drive.

 

iSCSI is quite different from AFP and Samba - it isn't a network file sharing protocol; it lets a remote device connect to a disk (not a filesystem) on the target device (maybe?) as though the disk was connected locally. You can partition and format drives over iSCSI, but that also means the device you connect from has to recognise the file system on the drive. (EDIT:) Note - writing to the /dev/mdx devices won't break unRAID's parity, where as creating targets to the sdxx devices (e.g. /dev/sda or /dev/sda1) bypasses the unRAID array, and so will break parity. DO NOT CONNECT iSCSI TO /dev/sdX DEVICES.

 

DISCLAIMER - I only understood about 75% of what I did. Don't blame me if anything goes wrong!

 

The installation wasn't easy, but the most difficult bit was building the iSCSI install package. Here's the one I built. It's built for unRAID 4.6 on i686. unRAID 4.6's kernel is 2.6.32.9.

http://fredsherbet.com/unraid/iscsitarget-1.4.20.2-i686-1.tgz

 

References

These are the references I used to set up a slackware dev box, build iSCSI target, install on unRAID, and configure it.

   * Target - http://iscsitarget.sourceforge.net/'>http://iscsitarget.sourceforge.net/

         o Config http://manpages.ubuntu.com/manpages/hardy/man5/ietd.conf.5.html

 

Building them requires kernel source and complicated stuff. Have to build on a full slackware install, then package up to install on unRAID.

   * http://lime-technology.com/forum/index.php?topic=2937.0

   * http://www.linuxpackages.net/howto.php?page=package&title=Package+Howto

 

Process I went through

For reference, here's my rough notes for the whole process I went through.

 

I had unRAID 4.6, which uses kernel 2.6.32.9.

 

  1. Install Slackware in Virtual Box.

  2. Get kernel source that matches the kernel on the unRAID box.

        1. Download from ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ (

wget

)

        2. unpack (tar xvf)

        3. copy directory to

/usr/src

  3. Set up the kernel source's config

        1. Copy

.config

from

/usr/src/linux

on the unraid box to the kernel source directory on the slackware dev box

        2. From the kernel source dir, run

make oldconfig

and answer the questions.

  4. Build the kernel and modules (run

make

)

  5. Switch to a safe location (e.g. /root) and get iscsitarget (

wget

the latest tar.gz from http://iscsitarget.sourceforge.net)

  6. Untar it (

tar xvf

)

  7. CD into the dir it creates and run

make KSRC=/usr/src/linux-2.6.32.9

to build it.

  8. Run

make KSRC=/usr/src/linux-2.6.32.9 ARCH=i686 install DESTDIR=/work/install

to install pretending destdir is the root.

  9. CD to the

/work/install

dir and run

makepkg

to build the slackware package for unraid.

 10. Copy to unraid, and run

installpkg

to install iscsi on the unraid box.

 11. Edit the config file at

/etc/iet/ietd.conf

 12. Start the iscsi target by running

/etc/rc.d/iscsi-target start

(It's stopped again by running /etc/rc.d/iscsi-target stop)

 14. Use globalSAN iSCSI to connect from a Mac.

        1. Add a target. The target name is the Target option in the iscsi target config file.

        2. Add a connection (just enter the unraid's ip address)

        3. Click connect.

 15. I could only connect to unraid's flash drive, since that's the only file system with a format the mac could recognise. See http://lime-technology.com/forum/index.php?topic=10082.0

Link to comment

I don't know if it's safe to write to the disks in the array using this method. Does it break unRAID's parity???

If you connect to /dev/md1 through /dev/md20 you are probably safe to write to the array.

 

If you connect to dev/sdX or /dev/hdX, you will corrupt parity if you attempt to write to the array.

Link to comment

And that's due to /dev/sdX being the actual disk, and /dev/mdX being the point where they're mounted, right?

Wrong.

 

/dev/sdX is the physical disk.

/dev/mdX is the unRAID protected device that uses one of the assigned physical disks as defined on the "Devices" page in combination with all the other physical disks and parity to protect you from a single disk failure.

 

/dev/mdX uses the first partition of the physical disk it is affiliated with, typically /dev/sdX1 or /dev/hdX1.

 

/mnt/disk1 is where /dev/md1 is mounted. /mnt/disk1 is the mount point.

/mnt/disk2 is where /dev/md2 is mounted. /mnt/disk2 is the mount point.

...

/mnt/disk20 is where /dev/md20 is mounted. /mnt/md20 is the mount point.

Link to comment
  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.