3

How do I make freebsd show initiators a mountable target from a zpool?

On a fresh install of FreeBSD 10.2 (hostname bohr) I made a zpool named tank with a single vdev which is 2 disks in a mirror; then I used zfs to make a 4GB volume (images). I set up an iSCSI LUN with no-authentication for the group and target (for testing) pointing at images. Linux, FreeBSD, and OS X initiators can discover the target and connect but none of them finds a volume that I can format or mount.

root@bohr:/tank/volumes # zfs list
NAME                  USED  AVAIL  REFER  MOUNTPOINT
tank                 4.13G   895G    96K  /tank
tank/volumes         4.13G   895G   100K  /tank/volumes
tank/volumes/images  4.13G   899G    64K  -
root@bohr:/tank/volumes # zpool status
  pool: tank
  state: ONLINE
  scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    tank        ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        ada1    ONLINE       0     0     0
        ada2    ONLINE       0     0     0

errors: No known data errors

root@bohr:~ # cat /etc/ctl.conf
auth-group ag0 {
    chap house shortshortdress
}

portal-group pg0 {
    discovery-auth-group no-authentication
    listen 0.0.0.0
    listen [::]
} 

target iqn.2015-09.com.example:images {
    auth-group no-authentication
    portal-group pg0

    lun 0 {
        path /tank/volumes/images
        size 4G
    }
}

so, here's a representative linux initiator, note the absence of /dev/sdd in the output of fdisk -l:

niels@suse_linux:~> lsscsi
[0:0:0:0]    disk    ATA      WDC WD1600AAJB-5 01.0  /dev/sda
[1:0:0:0]    cd/dvd  HL-DT-ST DVD-ROM GDR8162B 0015  /dev/sr0
[1:0:1:0]    cd/dvd  _NEC     DVD+RW ND-1100A  10FD  /dev/sr1
[2:0:0:0]    disk    ATA      TOSHIBA DT01ACA2 MX4O  /dev/sdb
[3:0:0:0]    disk    ATA      TOSHIBA DT01ACA2 MX4O  /dev/sdc
[21:0:0:0]   disk    FREEBSD  CTLDISK          0001  /dev/sdd

niels@suse_linux:~> sudo /usr/sbin/fdisk -l
root's password:

Disk /dev/sda: 160.0 GB, 159974776832 bytes, 312450736 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c3390

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4208639     2103296   82  Linux swap / Solaris
/dev/sda2   *     4208640    46153727    20972544   83  Linux
/dev/sda3        46153728   312449023   133147648   83  Linux

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/md1: 2000.3 GB, 2000264691712 bytes, 3906766976 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Results on OS X are similar, connection but nothing available to diskutil. I tried using the freebsd box as an initiator also, and it will make the connection, but still no device I can access. Back to bohr for another example of a connection made, but

root@bohr:~ # iscsictl -L
Target name                          Target portal    State
iqn.2015-09.com.example:images 192.168.1.148    Connected: da0

I followed the FreeBSD manual for zfs and iscsi.

2

Ok, so I needed to route my LUN through the special device /dev/zvol. So instead path /tank/volumes/images I needed path /dev/zvol/tank/volumes/images. And that was it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.