{"id":672,"date":"2016-05-31T07:56:56","date_gmt":"2016-05-31T05:56:56","guid":{"rendered":""},"modified":"2018-11-22T22:41:42","modified_gmt":"2018-11-22T21:41:42","slug":"linux-mint-mouting-freenas-iscsi-disk","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/linux-mint-mouting-freenas-iscsi-disk\/","title":{"rendered":"Linux Mint &#8211; Mouting a FreeNAS iSCSI disk"},"content":{"rendered":"<p>I&#8217;m trying to solve a problem of network backuping on our FreeNAS server. I&#8217;ve already tried CIFS (where were some issues &#8211;\u00a0<a href=\"http:\/\/https:\/\/nil.uniza.sk\/linux-howto\/linux-mint-problem-access-freenas-cifs-share\" target=\"_blank\" rel=\"noopener\">Linux Mint &#8211; problem to access a FreeNAS CIFS share<\/a>) however I have there a performance issue, especially working with huge number of files produced by the backup proces (deja-dup backup over the net). As the second alternative I&#8217;m going to try iSCSI to map a network disk\/file from a freenas server.<\/p>\n<h2>Prerequisities a<span style=\"line-height: 1em;\">nd initial state:<\/span><\/h2>\n<p>I&#8217;m using following software versions and I had configured following:<\/p>\n<ul>\n<li>a host machine with installed Linux Mint 17.3 Rosa Cinammon 64bit<\/li>\n<li>a NAS storage with installed FreeNAS version 9.10STABLE. The FreeNAS should be operational and working, configured with appropriate Storage zvol \u00a0(Storage -&gt; Create zvol), \u00a0turned on iSCSI service (Service -&gt; iSCSI), \u00a0configured Portals (Sharing -&gt; Block (iSCSI) -&gt; Portals), configured Initiators (Sharing -&gt; Block (iSCSI) -&gt; Initiators), Targets\u00a0Sharing -&gt; Block (iSCSI) -&gt; Targets), Extents (Sharing -&gt; Block (iSCSI) -&gt; Extents) and Associated Targets (Sharing -&gt; Block (iSCSI) -&gt; Associated Targets). Some guides partially describing these iSCSI steps are \u00a0at\u00a0<a href=\"http:\/\/thesolving.com\/storage\/how-to-create-an-iscsi-target-with-freenas\/\">http:\/\/thesolving.com\/storage\/how-to-create-an-iscsi-target-with-freenas\/<\/a> or\u00a0<a href=\"http:\/\/blogbt.net\/index.php\/2014\/07\/vcap-dca-setting-external-storage-iscsi-on-freenas\/\">http:\/\/blogbt.net\/index.php\/2014\/07\/vcap-dca-setting-external-storage-iscsi-on-freenas\/<\/a><\/li>\n<li>additionally I have configured and joined the freenas machine into our windows domain managed by AD controller<\/li>\n<\/ul>\n<h2>Mouting iSCSI<\/h2>\n<p>1) Using iSCSI terminology we need an iSCSI initiator, to do thath we must install required package, so we will install Open-iSCSI:<\/p>\n<pre># sudo apt-get install open-iscsi open-iscsi-utils<\/pre>\n<div>2) then we will configure it. So open<\/div>\n<pre>sudo vim \/etc\/iscsi\/iscsid.conf<\/pre>\n<div>and comment manual and ucomment automatic startup<\/div>\n<pre># node.startup = manual\r\nnode.startup = automatic<\/pre>\n<p>3) now we should check if our freenas target is available (my Freenas target is called &#8222;targetpalo&#8220;, freenas IP address 192.168.10.5). Discovering iSCSI targets we&#8217;ll type the isciadm command :<\/p>\n<pre># iscsiadm --mode discovery --type sendtargets --portal &lt;IP-address&gt;<\/pre>\n<p>where<\/p>\n<ul>\n<li>&#8211;mode (or -m):\u00a0determines the mode that iscsiadm executes in.<\/li>\n<li>-type (-t):\u00a0specifies the type of discovery.<\/li>\n<li>-portal (-p):\u00a0indicates the target IP address.<\/li>\n<\/ul>\n<p>in my case<\/p>\n<pre>sudo iscsiadm -m discovery -t sendtargets -p 192.168.10.5<\/pre>\n<div><\/div>\n<div>and the answer is, where i can see my iscsci freenas target (the targetname <span style=\"font-size: 12px; background-color: #eeeeee;\">iq<\/span><span style=\"font-size: 12px;\"><span style=\"background-color: #d3d3d3;\">n.2005-10.org.freenas.<\/span><\/span><span style=\"font-size: 12px;\"><span style=\"background-color: #d3d3d3;\">ctl:<\/span><\/span><span style=\"font-size: 12px;\"><span style=\"background-color: #d3d3d3;\">targetpalo<\/span><\/span>))<\/div>\n<pre>192.168.10.5:3260,257 iqn.2005-10.org.freenas.ctl:<span style=\"background-color: #ffff00;\">targetpalo<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>4) Finding a target, we should be able to connect and log into it, of course depending on our target setup (you may require to enter user credentials.). Login to the iSCSI node:<\/p>\n<pre># iscsiadm --mode node --targetname IQN --portal IP_ADDRESS --login<\/pre>\n<p>in my case<\/p>\n<pre>sudo iscsiadm -m node --targetname iqn.2005-10.org.freenas.ctl:targetpalo -p 192.168.10.5 --login<\/pre>\n<div><\/div>\n<div>where we may observe the answer<\/div>\n<pre>Logging in to [iface: default, target: iqn.2005-10.org.freenas.ctl:targetpalo, portal: 192.168.10.5,3260] (multiple)\r\nLogin to [iface: default, target: iqn.2005-10.org.freenas.ctl:targetpalo, portal: 192.168.10.5,3260] successful.<\/pre>\n<div>or typing<\/div>\n<pre>dmesg | grep sd\r\n[1176867.785410] sd 7:0:0:0: Attached scsi generic sg3 type 0\r\n[1176867.786252] sd 7:0:0:0: [sdc] 314572800 512-byte logical blocks: (161 GB\/150 GiB)\r\n[1176867.786253] sd 7:0:0:0: [sdc] 16384-byte physical blocks\r\n[1176867.788167] sd 7:0:0:0: [sdc] Write Protect is off\r\n[1176867.788170] sd 7:0:0:0: [sdc] Mode Sense: 73 00 10 08\r\n[1176867.788690] sd 7:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA\r\n[1176867.794430]  sdc: unknown partition table\r\n[1176867.800728] sd 7:0:0:0: [<span style=\"background-color: #ffff00;\">sdc] Attached SCSI disk<\/span><\/pre>\n<div>or<\/div>\n<pre>fdisk -l\r\n...\r\nDisk \/<span style=\"background-color: #ffff00;\">dev\/sdc<\/span>: 161.1 GB, 161061273600 bytes\r\n255 heads, 63 sectors\/track, 19581 cylinders, total 314572800 sectors\r\nUnits = sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 16384 bytes\r\nI\/O size (minimum\/optimal): 16384 bytes \/ 1048576 bytes\r\nDisk identifier: 0x00000000\r\n\r\nDisk \/dev\/sdc doesn't contain a valid partition table<\/pre>\n<div>or<\/div>\n<div>\n<pre>lsblk\r\nNAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT\r\nsda      8:0    0 xxx,1G  0 disk \r\n\u2514\u2500sda1   8:1    0 xxx,1G  0 part \/\r\nsdb      8:16   0   xxxT  0 disk \r\n\u2514\u2500sdb1   8:17   0   xxxT  0 part \/home\r\n<span style=\"background-color: #ffff00;\">sdc      8:32   0   150G  0 disk <\/span>\r\nsr0     11:0    1  1024M  0 rom<\/pre>\n<\/div>\n<div><\/div>\n<div><span style=\"color: #333333; font-family: Ubuntu, Ubuntu Beta, Bitstream Vera Sans, DejaVu Sans, Tahoma, sans-serif;\"><span style=\"font-size: 13px; line-height: 19.5px;\">Note: The<\/span><\/span> output example above shows my iSCSI disk as a\u00a0<strong>sdc<\/strong> drive, your output may be different.<\/div>\n<p>&nbsp;<\/p>\n<p>5) Now we have to format the device (using GNU parted, fdisk or gnome-disk-utility). The disk will appear in my case as a new &#8222;\/dev\/<span style=\"background-color: #ffff00;\">sdc<\/span> hard drive.<\/p>\n<p>&nbsp;<\/p>\n<p>6) Finally, add an entry to \/etc\/fstab to mount the iSCSI drive during boot:<\/p>\n<pre>\/dev\/sdc       \/home\/palo\/Backup        ext4    defaults,auto,_netdev 0 0<\/pre>\n<p>and run<\/p>\n<pre>sudo mount -a<\/pre>\n<p>That is it!<\/p>\n<h2>Other sources<\/h2>\n<ul>\n<li><a title=\"http:\/\/www.open-iscsi.org\/\" href=\"http:\/\/www.open-iscsi.org\/\">Open-iSCSI Website<\/a><\/li>\n<li><a title=\"http:\/\/wiki.debian.org\/SAN\/iSCSI\/open-iscsi\" href=\"http:\/\/wiki.debian.org\/SAN\/iSCSI\/open-iscsi\">Debian Open-iSCSI page<\/a><\/li>\n<li><a href=\"https:\/\/help.ubuntu.com\/lts\/serverguide\/iscsi-initiator.html\">Ubuntu \u00a0iSCSI Initiator guide<\/a><\/li>\n<li><a href=\"https:\/\/community.linuxmint.com\/tutorial\/view\/1446\" target=\"_blank\" rel=\"noopener\">Linux mint &#8211;\u00a0Mounting iSCSI volumes through IPv4<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>\n\tI&#39;m trying to solve a problem of network backuping on our FreeNAS server. I&#39;ve already tried CIFS (where were some issues &#8211;&nbsp;<a href=\"http:\/\/https:\/\/nil-test.kis.fri.uniza.sk\/linux-howto\/linux-mint-problem-access-freenas-cifs-share\" target=\"_blank\">Linux Mint &#8211; problem to access a FreeNAS CIFS share<\/a>) however I have there a performance issue, especially working with huge number of files produced by the backup proces (deja-dup backup over the net). As the second alternative I&#39;m going to try iSCSI to map a network disk\/file from a freenas server.<\/p>","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[685],"tags":[967,969,965,963],"class_list":["post-672","post","type-post","status-publish","format-standard","hentry","category-linux_-_howto-en","tag-freenas","tag-iscsi","tag-linux","tag-mint"],"taxonomy_info":{"category":[{"value":685,"label":"Linux - HOWTO"}],"post_tag":[{"value":967,"label":"freenas"},{"value":969,"label":"iscsi"},{"value":965,"label":"linux"},{"value":963,"label":"mint"}]},"featured_image_src_large":false,"author_info":{"display_name":"admin","author_link":"https:\/\/nil.uniza.sk\/en\/author\/admin\/"},"comment_info":3,"category_info":[{"term_id":685,"name":"Linux - HOWTO","slug":"linux_-_howto-en","term_group":0,"term_taxonomy_id":683,"taxonomy":"category","description":"","parent":0,"count":71,"filter":"raw","cat_ID":685,"category_count":71,"category_description":"","cat_name":"Linux - HOWTO","category_nicename":"linux_-_howto-en","category_parent":0}],"tag_info":[{"term_id":967,"name":"freenas","slug":"freenas","term_group":0,"term_taxonomy_id":965,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":969,"name":"iscsi","slug":"iscsi","term_group":0,"term_taxonomy_id":967,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":965,"name":"linux","slug":"linux","term_group":0,"term_taxonomy_id":963,"taxonomy":"post_tag","description":"","parent":0,"count":5,"filter":"raw"},{"term_id":963,"name":"mint","slug":"mint","term_group":0,"term_taxonomy_id":961,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=672"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/672\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}