[Stgt-devel] [PATCH] iscsi: add assign_lun script

FUJITA Tomonori tomof
Sun Dec 30 12:05:02 CET 2007


From: Erez Zilber <erezz at voltaire.com>
Subject: [Stgt-devel] [PATCH] iscsi: add assign_lun script
Date: Sun, 30 Dec 2007 10:51:16 +0200

> Add a script that will create a target, add a device to
> the target and define the initiator that can connect to it.

Can you move this to usr/scripts? I guess that this could be improved
to handle other protocols later on.

There would be a better name since this script does more than
assigning a logical unit, that is, creates a new target, add a lun,
and enable an initiator to access to the target.


> Signed-off-by: Erez Zilber <erezz at voltaire.com>
> ---
>  usr/iscsi/scripts/assign_lun |  127 ++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 127 insertions(+), 0 deletions(-)
>  create mode 100755 usr/iscsi/scripts/assign_lun

(snip)


> +#!/bin/bash
> +
> +verify_params()
> +{
> +	# Make sure that the device exists
> +	if ! [ -b $dev ]; then
> +		echo "$dev is not a device";
> +		exit 1;

Hmm, would be better to have:

        if ! [ -b $dev -o -f $dev ]; then

We can use a regular file as a logical unit.



More information about the stgt mailing list