NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: iscsifs



On Wed, 25 Aug 2010, Brook Milligan wrote:
Stephen Borrill writes:
> >     amd64# iscsifs -v -h 127.0.0.1 -u nobody /mnt
> >     [no response of any kind on the terminal]
>
> Correct operation is "no response of any kind on the terminal" - iscsifs
> does not detach from the terminal. On another terminal type mount to see
> what, if anything, has actually happened.

This was the point I was missing.  Thanks.  By the way, would it not
be useful to have some command line option that allowed iscsifs to go
into the background?

Yes, it would. And going onto your later question about rc.d scripts, it would make that job easier. I've got a stack of changes to submit to iscsi-initiator (new name for iscsifs), so I'll add that to the list.

When I run iscsifs on the amd64/5.0.2 machine, I do in fact see stuff
under /mnt on another terminal.  Thus, something changed between 5.0
and 5.0.2 to make this work and 5.2 may not be required.

5.1 is still recommended though.

    # mount
    /dev/puffs on /mnt type puffs|refuse:mnt (nosuid, nodev)
    [ ... other stuff deleted ... ]

    # ls -lR /mnt
    total 64
    drwxr-xr-x  2 root  wheel  512 Aug  2 09:06 127.0.0.1

    /mnt/127.0.0.1:
    total 64
    drwxr-xr-x  2 root  wheel  512 Aug  2 09:06 target0

    /mnt/127.0.0.1/target0:
    total 448
    lrw-r--r--  1 root  wheel          9 Aug  2 09:06 hostname -> 127.0.0.1
    lrw-r--r--  1 root  wheel          9 Aug  2 09:06 ip -> 127.0.0.1
    lrw-r--r--  1 root  wheel         16 Aug  2 09:06 product -> NetBSD iSCSI
    -rw-r--r--  1 root  wheel  104857600 Aug  2 09:06 storage
    lrw-r--r--  1 root  wheel         43 Aug  2 09:06 targetname -> 
iqn.1994-04.org.netbsd.iscsi-target:target0
    lrw-r--r--  1 root  wheel          8 Aug  2 09:06 vendor -> NetBSD
    lrw-r--r--  1 root  wheel          4 Aug  2 09:06 version -> 0

Interestingly, if I use "-h localhost" in the iscsifs command it
fails, although other hostnames work fine and localhost is resolved by
the nameserver.

I bet this is because it's resolving to ::1 (IPv6), but the target isn't bound to that.

Now, I'm guessing that the current way to mount iscsifs as something
useful is to write up a script to run during the boot process that
will:

- run iscsifs in the background
- run vnconfig on the exposed storage
- mount /dev/vnd?a somewhere

and do the reverse on shutdown.

Are there any such scripts out there that are trying to do this using
the facilities of rc.subr so that they can be used within /etc/rc.d?

I'm not aware of any yet. But, as above, changes could be made to the initiator to make this task easier.

There are a couple of problems with the vnd approach. If the target dies, then it leaves the initiator side in a horrible mess. The initiator doesn't attempt reconnection, the vnd is still configured but backed by nothing. When this happens it can be impossible to cleanly shut the machine down.

iscsifs does have the option to generate device files, but to be of any use there is no point in just creating one - we really need both character and block device nodes to be created as well as nodes for the disklabel slices on the device.

--
Stephen



Home | Main Index | Thread Index | Old Index