45Drives Knowledge Base |
KB450410 - Adding new Luns to iSCSI Configuration https://knowledgebase.45drives.com/kb/kb450410-adding-new-luns-to-iscsi-configuration/ |
This guide details the process of creating a new iSCSI lun and adding it to the configuration. Replace variables in the example comamnds defined with curly braces with the correct name, i.e. {pool_name } -> pool1.
cd /{pool_name}/images dd if=/dev/zero of={lun_name} bs=1 count=0 seek=(size of LUN)
# cd /tank_mirror/images # dd if=/dev/zero of=testlun bs=1 count=0 seek=1T 0+0 records in 0+0 records out 0 bytes copied, 9.8113e-05 s, 0.0 kB/s
targetcli
/> cd backstores/fileio /backstores/fileio> create {lun_name} /{pool_name}/images/{lun_name}
/backstores/fileio> create testlun /tank_mirror/images/testlun Created fileio testlun with size 1099511627776
/backstores/fileio> ls o- fileio ..................................................................................................... o- testlun ...................................................................... o- alua ....................................................................................................... o- default_tg_pt_gp ...........................................................................
cd /iscsi/{target_name}/tpg1/luns/ create /backstores/fileio/{lun_name}
/> cd /iscsi/iqn.2023-02.labtest:test.environment/tpg1/luns/ /iscsi/iqn.20...ent/tpg1/luns> create /backstores/fileio/testlun Created LUN 2. Created LUN 2->2 mapping in node ACL iqn.1991-05.com.microsoft:win-9171j57n62e Created LUN 2->2 mapping in node ACL iqn.1991-05.com.microsoft:win-clvclj26v2c
/iscsi/iqn.20...ent/tpg1/luns> exit Global pref auto_save_on_exit=true Last 10 configs saved in /etc/target/backup/. Configuration saved to /etc/target/saveconfig.json