Current-Users archive

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

Re: iscsi target on a zfs zvol?





On 10 July 2022 20:40:56 (+01:00), Michael van Elst wrote:

> hauke%Espresso.Rhein-Neckar.DE@localhost (Hauke Fath) writes:
>
> >I would like to set up an iscsi target backed by a zfs zvol, to serve=20
> >as a Mac time machine volume.
I have been using iSCSI target backed by a zvol for quite some time. Initially I tried the built-in target (always on -current, whatever was the version at the time), but found it to be less reliable than the pkgsrc version. >
> Independent of your problem you should use 'istgt' from pkgsrc.
>
>
>
863:/u/sources/netbsd-developer/src/external/bsd/iscsi/lib/../dist/src/lib/=

>disk.c:720:=20
> >***ERROR*** error reading "target0"
> ># hexdump -C -n 512 /dev/zvol/rdsk/tank/time_machine_1=20
> >00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =20
> >at which point
> >DISK: LUN 0: 2097152 MB disk storage for "target0"

I would check the permissions of /dev/zvol/rdsk... (that is from elsewhere - I also use zvol-backed disks for my NVMM virtual machines, the default wouldn't work if I start the VM as a user).


I can't verify the exact setup unfortunately - the laptop I was using for all that finally packed yesterday after some 9 years of faithful work and I will have to look for another suitable hardware to get my daily NetBSD fix... >
>
> >Looks like an initialization issue on behalf of iscsi-target. Does that=20
> >ring a bell for anyone?
>
> Probably unrelated to ZFS, this reminds me of:
>
> # stat -s /dev/rvnd0a
> st_dev=43010 st_ino=65103 st_mode=020640 st_nlink=1 st_uid=0 st_gid=5 st_rdev=10496 st_size=0 st_atime=1590051866 st_mtime=1590051866 st_ctime=1590051866 st_birthtime=1590051866 st_blksize=65536 st_blocks=0 st_flags=0
>
> # hexdump -C /dev/rvnd0a | head -1
> 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |............
>
> # stat -s /dev/rvnd0a
> st_dev=43010 st_ino=65103 st_mode=020640 st_nlink=1 st_uid=0 st_gid=5 st_rdev=10496 st_size=10485760 st_atime=1657481715 st_mtime=1590051866 st_ctime=1590051866 st_birthtime=1590051866 st_blksize=65536 st_blocks=0 st_flags=0
>
> Before opening the device with hexdump, the st_size field is 0.
>
> The size is cached in the vnode, but only determined when you open the
> device. The information gets lost again when the vnode is expired,
> which only happens when there is a memory shortage.
>
>

--
Sent with Vivaldi Mail. Download Vivaldi for free at vivaldi.com


Home | Main Index | Thread Index | Old Index