Other iSCSI LUN questions

I am creating a FreeBSD iSCSI-Target test machine and after reading the doc's I wonder about the disk.

FreeBSD resides on a 2GB CF card
My target 0 is a 500GB Seagate HDD

For my LUN 0 I want to use a simple setup first.
Single disk. The whole disk. No RAID.

How do I prepare the drive? Simply write zeros? Does it get locally partitioned-formated-mounted at all?

ctl.conf
For LUN0 path would I use this- /dev/ada0 ? All examples show zvol.
The handbook has an example with /data/target0-0 Perhaps I mount my disk at that spot?

Can this be done with a single dedicated drive?
 
Looking at this thread I wonder if I can use the whole harddisk as a block device as I thought.
Maybe I need to create a file on my harddisk as my target 0?
https://forums.freebsd.org/threads/46791/

From the handbook:
'The path /data/target0-0 line defines the full path to a file or zvol'
Using a whole hard disk should work fine. ctl.conf(5) says:
The path to the file, device node, or zfs(8) volume used to back the LUN.
ctld doesn't care if it's a hard disk or a ZVOL because they are both exposed as a device (i.e. use the same abstraction, part of geom(4)) by the kernel. You could also partition your disk and you'd get a bunch of new devices files that only support writing to one partition.

There is a nice (if a little old) introduction to GEOM by Poul-Henning Kamp: http://www.bsdcan.org/2004/papers/geom.pdf
 
Working no problems with LUN path /dev/ada1
ctladm devlist shows my LUN but size seems off.

Time to setup the ISCSI-initiator.

Had a good chuckle there on his statement.
"it used to be that the disk you have at boot would stick around and no new disks would appear"
 
Got my iSCSI target 0 disk connected and formatted from a FreeBSD client. It was 466GB which sounds right. I used gpart MBR with a freebsd slice.

How can I access the target 0 LUN filesystem locally from the ISCSI target fileserver?
 
How can I access the target 0 LUN filesystem locally from the ISCSI target fileserver?
I've never tried it but it should be accessible like any other disk. You may get into trouble if the file system is both locally mounted and exported with iSCSI though. It's usually not a good idea to mount filesystems twice, definitely not when it's actually two different systems.
 
From my reading it appears much of my trouble is due to file locking and iSCSI's lack of it.
Only a single initiator at a time per LUN is what seems safe.
 
An iSCSI LUN is not really any different to a basic SCSI disk. iSCSI has nothing to do with the file system, or any sort of file locking. It just provides a raw disk.

You can't mount a SCSI/iSCSI/SATA/whatever disk on two systems at the same time unless the file system is designed for that purpose. For example I believe VMFS is deigned to allow multiple VMWare systems to mount the same iSCSI disk at the same time and has fairly simple file locking built in to make sure two hosts don't try using the same file at the same time.

(Just doing a quick Google to check the above I came across this webpage which seems to cover it well - http://www.techrepublic.com/blog/da...ple-hosts-to-connect-to-a-single-iscsi-array/)
 
To expand on usdmatt's comments a little and put them another way, iSCSI isn't really an alternative to or replacement for NFS or SMB. It's not really meant for file sharing, but for extending a single system's storage by abstracting that storage over a network.
 
Back
Top