{"id":2592,"date":"2025-04-18T17:37:11","date_gmt":"2025-04-18T07:37:11","guid":{"rendered":"https:\/\/blog.hegars.com\/?p=2592"},"modified":"2025-04-18T18:03:51","modified_gmt":"2025-04-18T08:03:51","slug":"freebsd-iscsi","status":"publish","type":"post","link":"https:\/\/blog.hegars.com\/?p=2592","title":{"rendered":"FreeBSD iSCSI"},"content":{"rendered":"\n<p>Kinda like TargetCLI on linux -> https:\/\/blog.hegars.com\/?p=433 <\/p>\n\n\n\n<p><a href=\"https:\/\/sporks.space\/2022\/12\/11\/babys-first-iscsi-with-zfs-setup\/\">Baby&#8217;s First iSCSI with ZFS Setup &#8211; the sporks space<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install<\/h2>\n\n\n\n<p>Install stuff<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pkg install vim\npkg install fusefs-ntfs-2022.10.3_1<\/code><\/pre>\n\n\n\n<p>Create a target<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zfs create -V 4GB -o compression=on srv\/target<\/code><\/pre>\n\n\n\n<p>Create \/etc\/ctl.conf to export target<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>portal-group pg0 {\n        discovery-auth-group no-authentication\n        listen 0.0.0.0\n        listen &#91;::]\n}\n\ntarget iqn.2010-04.com.hegars.storage:target0 {\n        auth-group no-authentication\n        portal-group pg0\n\n                lun 0 {\n                        path \/dev\/zvol\/zroot\/target\n                }\n}<\/code><\/pre>\n\n\n\n<p>Start service <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service ctld start<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Connect the client <\/h2>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">RO mount of NTFS volume on Host<\/h3>\n\n\n\n<p>Look at the &#8220;disk&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fdisk \/dev\/zvol\/zroot\/target\r\nWARNING: fdisk is deprecated and is not available in FreeBSD 15 or later.\r\nPlease use gpart instead.\r\n\r\n******* Working on device \/dev\/zvol\/zroot\/target *******\r\nparameters extracted from in-core disklabel are:\r\ncylinders=65270 heads=255 sectors\/track=63 (16065 blks\/cyl)\r\n\r\nFigures below won't work with BIOS for partitions not in cyl 1\r\nparameters to be used for BIOS calculations are:\r\ncylinders=65270 heads=255 sectors\/track=63 (16065 blks\/cyl)\r\n\r\nMedia sector size is 512\r\nWarning: BIOS sector numbering starts with sector 1\r\nInformation from DOS bootblock is:\r\nThe data for partition 1 is:\r\nsysid 238 (0xee),(EFI GPT)\r\n    start 1, size 4294967295 (2097151 Meg), flag 0\r\n        beg: cyl 0\/ head 0\/ sector 2;\r\n        end: cyl 765\/ head 254\/ sector 63\r\nThe data for partition 2 is:\r\n&lt;UNUSED>\r\nThe data for partition 3 is:\r\n&lt;UNUSED>\r\nThe data for partition 4 is:\r\n&lt;UNUSED><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>geom -t\r\nGeom                    Class      Provider\r\nvtbd0                   DISK       vtbd0\r\n  vtbd0                 DEV       \r\n  vtbd0                 PART       vtbd0p1\r\n    vtbd0p1             DEV       \r\n    vtbd0p1             LABEL      gpt\/gptboot0\r\n      gpt\/gptboot0      DEV       \r\n  vtbd0                 PART       vtbd0p2\r\n    vtbd0p2             DEV       \r\n    swap                SWAP      \r\n  vtbd0                 PART       vtbd0p3\r\n    vtbd0p3             DEV       \r\n    zfs::vdev           ZFS::VDEV \r\nzfs::zvol::zroot\/target ZFS::ZVOL  zvol\/zroot\/target\r\n  zvol\/zroot\/target     DEV       <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ntfs_3g \/dev\/zvol\/zroot\/target \/mnt\/ntfs\/ -o ro<\/code><\/pre>\n\n\n\n<p>Speed over 1000\/400 NBN to DC location<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"764\" src=\"https:\/\/blog.hegars.com\/wp-content\/uploads\/2025\/04\/Screenshot-2025-04-01-215506-1024x764.png\" alt=\"\" class=\"wp-image-2599\" srcset=\"https:\/\/blog.hegars.com\/wp-content\/uploads\/2025\/04\/Screenshot-2025-04-01-215506-1024x764.png 1024w, https:\/\/blog.hegars.com\/wp-content\/uploads\/2025\/04\/Screenshot-2025-04-01-215506-300x224.png 300w, https:\/\/blog.hegars.com\/wp-content\/uploads\/2025\/04\/Screenshot-2025-04-01-215506-768x573.png 768w, https:\/\/blog.hegars.com\/wp-content\/uploads\/2025\/04\/Screenshot-2025-04-01-215506.png 1389w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Kinda like TargetCLI on linux -> https:\/\/blog.hegars.com\/?p=433 Baby&#8217;s First iSCSI with ZFS Setup &#8211; the sporks space Install Install stuff Create a target Create \/etc\/ctl.conf to export target Start service Connect the client RO mount of NTFS volume on Host Look at the &#8220;disk&#8221; Speed over 1000\/400 NBN to DC location<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts\/2592"}],"collection":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2592"}],"version-history":[{"count":9,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts\/2592\/revisions"}],"predecessor-version":[{"id":2603,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=\/wp\/v2\/posts\/2592\/revisions\/2603"}],"wp:attachment":[{"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hegars.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}