Files
minimal-setups/attic/public/howtos/iscsi-on-linux/index.html
Wolfgang Hottgenroth b2249c06e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
mdwiki test starts
2025-04-14 22:22:45 +02:00

183 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>iSCSI on Linux - Minimal Setups</title>
<meta name="generator" content="Hugo 0.140.2">
<link href="http://172.16.3.33:1313//index.xml" rel="alternate" type="application/rss+xml">
<link rel="canonical" href="http://172.16.3.33:1313/howtos/iscsi-on-linux/">
<link rel="stylesheet" href="http://172.16.3.33:1313/css/theme.min.css">
<link rel="stylesheet" href="http://172.16.3.33:1313/css/chroma.min.css">
<script defer src="http://172.16.3.33:1313//js/fontawesome6/all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js" integrity="sha256-H3cjtrm/ztDeuhCN9I4yh4iN2Ybx/y1RM7rMmAesA0k=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js" integrity="sha256-4XodgW4TwIJuDtf+v6vDJ39FVxI0veC/kSCCmnFp7ck=" crossorigin="anonymous"></script>
<script src="http://172.16.3.33:1313/js/bundle.js"></script><style>
:root {}
</style>
<meta property="og:url" content="http://172.16.3.33:1313/howtos/iscsi-on-linux/">
<meta property="og:site_name" content="Minimal Setups">
<meta property="og:title" content="iSCSI on Linux">
<meta property="og:description" content="Preparation Install open-iscsi, at least on Debian systems.
Use an iSCSI target from Linux In our setup a Synology NAS at 172.16.200.19 provides the targets.
First, run
iscsiadm -m discovery -t sendtargets -p 172.16.200.19 to discover all provided targets.
You get something like this
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7 Now, connect to the target using">
<meta property="og:locale" content="en_us">
<meta property="og:type" content="article">
<meta property="article:section" content="howtos">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="iSCSI on Linux">
<meta name="twitter:description" content="Preparation Install open-iscsi, at least on Debian systems.
Use an iSCSI target from Linux In our setup a Synology NAS at 172.16.200.19 provides the targets.
First, run
iscsiadm -m discovery -t sendtargets -p 172.16.200.19 to discover all provided targets.
You get something like this
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7 Now, connect to the target using">
<meta itemprop="name" content="iSCSI on Linux">
<meta itemprop="description" content="Preparation Install open-iscsi, at least on Debian systems.
Use an iSCSI target from Linux In our setup a Synology NAS at 172.16.200.19 provides the targets.
First, run
iscsiadm -m discovery -t sendtargets -p 172.16.200.19 to discover all provided targets.
You get something like this
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7 [fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7 Now, connect to the target using">
<meta itemprop="wordCount" content="256"><script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
</head>
<body>
<div class="container"><header>
<h1>Minimal Setups</h1>
</header>
<div class="global-menu">
<nav>
<ul>
<li class=""><a href="/keys/">Keys</a></li>
<li class=""><a href="/about/">About</a></li></ul>
</nav>
</div>
<div class="content-container">
<main><h1>iSCSI on Linux</h1>
<h2 id="preparation">Preparation</h2>
<p>Install <code>open-iscsi</code>, at least on Debian systems.</p>
<h2 id="use-an-iscsi-target-from-linux">Use an iSCSI target from Linux</h2>
<p>In our setup a Synology NAS at 172.16.200.19 provides the targets.</p>
<p>First, run</p>
<pre tabindex="0"><code> iscsiadm -m discovery -t sendtargets -p 172.16.200.19
</code></pre><p>to discover all provided targets.</p>
<p>You get something like this</p>
<pre tabindex="0"><code> 172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-GitLab.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Bitwarden.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Nextcloud.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-MariaDB.db1c0541e7
172.16.200.19:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7
[fe80::211:32ff:febe:da31]:3260,1 iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7
</code></pre><p>Now, connect to the target using</p>
<pre tabindex="0"><code> iscsiadm -m node --targetname &#34;iqn.2000-01.com.synology:nas.Target-Backup.db1c0541e7&#34; \
--portal 172.16.200.19 --login
</code></pre><p>A new SCSI device will be created. Check the name of the device using &lsquo;&lsquo;dmesg&rsquo;&rsquo;. You see something like this</p>
<pre tabindex="0"><code> [16924536.979916] scsi host13: iSCSI Initiator over TCP/IP
[16924537.010635] scsi 13:0:0:1: Direct-Access SYNOLOGY iSCSI Storage 4.0 PQ: 0 ANSI: 5
[16924537.011449] sd 13:0:0:1: Attached scsi generic sg10 type 0
[16924537.012597] sd 13:0:0:1: [sdj] 209715200 512-byte logical blocks: (107 GB/100 GiB)
[16924537.012827] sd 13:0:0:1: [sdj] Write Protect is off
[16924537.012828] sd 13:0:0:1: [sdj] Mode Sense: 43 00 10 08
[16924537.013111] sd 13:0:0:1: [sdj] Write cache: enabled, read cache: enabled, supports DPO and FUA
[16924537.013361] sd 13:0:0:1: [sdj] Optimal transfer size 16384 logical blocks &gt; dev_max (8192 logical blocks)
[16924537.018630] sd 13:0:0:1: [sdj] Attached SCSI disk
</code></pre><p>Now use <code>fdisk</code>, <code>mkfs</code> and if you like <code>blkid</code> on the new device and put it into the <code>/etc/fstab</code>.</p>
<p>===== Authenticated target =====</p>
<pre tabindex="0"><code> iscsiadm --mode node --targetname &#34;iqn.2007-01.org.debian.foobar:CDs&#34; -p 192.168.0.1:3260 --op=update --name node.session.auth.authmethod --value=CHAP
iscsiadm --mode node --targetname &#34;iqn.2007-01.org.debian.foobar:CDs&#34; -p 192.168.0.1:3260 --op=update --name node.session.auth.username --value=$Id
iscsiadm --mode node --targetname &#34;iqn.2007-01.org.debian.foobar:CDs&#34; -p 192.168.0.1:3260 --op=update --name node.session.auth.password --value=$MDP
iscsiadm --mode node --targetname &#34;iqn.2007-01.org.debian.foobar:CDs&#34; -p 192.168.0.1:3260 --login
</code></pre><div class="edit-meta">
</div>
<nav class="pagination"><a class="nav nav-prev" href="http://172.16.3.33:1313/howtos/ca-certificate-in-debian/" title="How to add a CA certificate in Debian"><i class="fas fa-arrow-left" aria-hidden="true"></i>&nbsp;Prev - How to add a CA certificate in Debian</a>
<a class="nav nav-next" href="http://172.16.3.33:1313/howtos/magnifikat/" title="Magnifikat">Next - Magnifikat <i class="fas fa-arrow-right" aria-hidden="true"></i></a>
</nav><footer>
</footer>
</main>
<div class="sidebar">
<nav class="slide-menu">
<ul>
<li class=""><a href="http://172.16.3.33:1313/">Home</a></li>
<li class=" has-sub-menu"><a href="http://172.16.3.33:1313/blog/">Blogs<span class="mark closed">+</span></a>
<ul class="sub-menu">
<li class=""><a href="http://172.16.3.33:1313/blog/tetris/">2024-05-27<br/> Tetris </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/rgb-driver/">2024-05-25<br/> PL 9823 meets MSP430 </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/timeserver2/">2025-03-13<br/> Stratum 1 NTP Server participating in ntppool.org </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/timeserver/">2025-02-11<br/> Just another Stratum 1 Timeserver </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/debouncing/">2018-04-30<br/> Yet Another Debouncing Method </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/three-phase-inverter-ng/">2016-12-19<br/> Three Phase Inverter - Second Service </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/three-phase-inverter/">2016-10-14<br/> Three Phase Inverter </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/theremin/">2013-07-01<br/> Theremin </a></li>
<li class=""><a href="http://172.16.3.33:1313/blog/email-childprot/">2013-06-27<br/> Children Protection for Postfix-based EMail-Server </a></li>
</ul>
</li>
<li class=" has-sub-menu"><a href="http://172.16.3.33:1313/articles/">Articles<span class="mark closed">+</span></a>
<ul class="sub-menu">
<li class=""><a href="http://172.16.3.33:1313/articles/quotes/"> Quotes </a></li>
</ul>
</li>
<li class="parent has-sub-menu"><a href="http://172.16.3.33:1313/howtos/">HowTos<span class="mark opened">-</span></a>
<ul class="sub-menu">
<li class=""><a href="http://172.16.3.33:1313/howtos/colors-in-minicom/"> Colors in Minicom </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/engel-des-herrn/"> Engel des Herrn </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/occ-in-nextcloud-pod/"> Execute occ in Nextcloud pod </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-backup/"> Gitlab Backup and Restore </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-change-baseurl/"> Gitlab Change BaseURL in Database </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/gitlab-upgrades/"> Gitlab Upgrades </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/ca-certificate-in-debian/"> How to add a CA certificate in Debian </a></li>
<li class="active"><a href="http://172.16.3.33:1313/howtos/iscsi-on-linux/"> iSCSI on Linux </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/magnifikat/"> Magnifikat </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/neovim/"> Neovim Setup </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/putty-and-hardware-keys/"> PuTTY and OPENGPG hardware keys </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/resize-hdd-on-running-system/"> Resize HDD on running system </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/snmpwalk-with-numeric-and-text-output/"> snmpwalk with numeric and text output of oid </a></li>
<li class=""><a href="http://172.16.3.33:1313/howtos/prince-of-persia-1/"> Solution for Prince of Persia 1 </a></li>
</ul>
</li>
</ul>
</nav>
<div class="sidebar-footer"></div>
</div>
</div><a href="#" id="backtothetop-fixed" class="backtothetop"
data-backtothetop-duration="600"
data-backtothetop-easing="easeOutQuart"
data-backtothetop-fixed-fadeIn="1000"
data-backtothetop-fixed-fadeOut="1000"
data-backtothetop-fixed-bottom="10"
data-backtothetop-fixed-right="20">
<span class="fa-layers fa-fw">
<i class="fas fa-circle"></i>
<i class="fas fa-arrow-circle-up"></i>
</span></a>
</div>
</body>
</html>