如何让 freebsd 显示启动器来自 zpool 的可安装目标?
在全新安装的 FreeBSD 10.2(主机名bohr
)上,我创建了一个名为 zpooltank
的单个 vdev,它是镜像中的 2 个磁盘;然后我使用 zfs 创建了一个 4GB 卷(images
)。我为指向 的组和目标(用于测试)设置了一个无需身份验证的 iSCSI LUN。Linux images
、FreeBSD 和 OS X 启动器可以发现目标并进行连接,但它们都找不到我可以格式化或挂载的卷。
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
}
}
/dev/sdd
因此,这是一个具有代表性的 Linux 启动器,请注意输出中缺少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
OS X 上的结果类似,连接成功但无法访问diskutil
。我也尝试使用 freebsd box 作为启动器,它可以建立连接,但仍然无法访问任何设备。回到 bohr 看另一个建立连接的示例,但是
root@bohr:~ # iscsictl -L
Target name Target portal State
iqn.2015-09.com.example:images 192.168.1.148 Connected: da0
我遵循 FreeBSD 手册中的 zfs 和 iscsi 操作。
答案1
好的,所以我需要通过特殊设备 /dev/zvol 路由我的 LUN。所以path /tank/volumes/images
我需要path /dev/zvol/tank/volumes/images
。就是这样。