Monthly Archive for June, 2008

Bug in net/iscsi-target?

I found that the block count sent from net/iscsi-target to a initiator is round to 2^31:

(In FreeBSD, iSCSI Target)

Starting iscsi_target.
Reading configuration from `/usr/local/etc/iscsi/targets’
target0:rw:10.1.1.0/24
       extent0:/dev/stripe/gs0:0:2500582432768
DISK: 1 logical unit (4883950064 blocks, 512 bytes/block), type iscsi fs
DISK: LUN 0: 2384741 MB disk storage for “target0”
TARGET: TargetName is iqn.1994-04.org.netbsd.iscsi-target

(In Debian Linux, iSCSI initiator)

scsi 3:0:0:0: Direct-Access     NetBSD   NetBSD iSCSI     0    PQ: 0 ANSI: 3
sd 3:0:0:0: [sdc] 588982768 512-byte hardware sectors (301559 MB)
sd 3:0:0:0: [sdc] Write Protect is off
sd 3:0:0:0: [sdc] Mode Sense: 0e 00 00 08
sd 3:0:0:0: [sdc] Got wrong page
sd 3:0:0:0: [sdc] Assuming drive cache: write through
sd 3:0:0:0: [sdc] 588982768 512-byte hardware sectors (301559 MB)
sd 3:0:0:0: [sdc] Write Protect is off
sd 3:0:0:0: [sdc] Mode Sense: 0e 00 00 08
sd 3:0:0:0: [sdc] Got wrong page
sd 3:0:0:0: [sdc] Assuming drive cache: write through
sdc: unknown partition table
sd 3:0:0:0: [sdc] Attached SCSI disk

I don’t know if it is a iSCSI protocol or a implementation limitation.

FreeBSD: i386 inside a jail in amd64

The key point: make a symlink of jailed /libexec/ld-elf.so.1 to /libexec/ld-elf32.so.1. Of course, your kernel should have COMPAT_IA32 option compiled.

# cd /usr/src && make TARGET_ARCH=i386 TARGET=i386 buildworld
# mkdir -p /home/jails/i386 && make TARGET_ARCH=i386 TARGET=i386 DESTDIR=/home/jails/i386 installworld
# make TARGET_ARCH=i386 TARGET=i386 DESTDIR=/home/jails/i386 distribution
# ln -s /home/jails/i386/libexec/ld-elf.so.1 /home/jails/i386/libexec/ld-elf32.so.1

Then, edit rc.conf in jail to run sshd and start jails. Some utilities, like w/ps/top can not run because they retrieve data from FreeBSD kernel, and the kernel returns 64-bit structures, not 32-bit.

w
4:37AM  up 12 days,  8:40, 1 user, load averages: 0.03, 0.18, 0.20
USER             TTY      FROM              LOGIN@  IDLE WHAT
w: kinfo_proc size mismatch (expected 768, got 1088): No such file or directory

I am doing further test to make sure there aren’t any mines :)