1

I am trying to have some disk available to a Windows Core Server through a ISCSI on Ubuntu 16.04. I tried NFS but it is not available for Core edition and samba is not what I need.

The thing is, I have disks available /dev/sdb and /dev/sdc for this purpose and I cannot figure out how to make them available. All the info I seem to find is for windows or by making an image of X size but then it will only take as much space as wherever the OS is.

I first tried iscsitarget but after looking more into it, one of the modules is not build for my kernel and I cannot seem to find any info on how to make it work. I really thought I could use it at first since almost all the tutorials use this so if it ever starts to work I'd still like to know. Here is the conf file with an img as path :

Target iqn.2015-05.com.exemple:storage.sys0
        Lun 0 Path=/storage/volume0/lun0.bin,Type=fileio

If I go with targetcli, I find myself with the same problem (how to add a disk instead of image). Here is how to create the img, I cannot seem to find what the conf file is :

create disk01 /var/iscsi_disks/disk01.img 10G 

For now these are the only two options I found on how to do a iscsi target and both only simply say how to make an img. How would I make them use a whole disk ?

EDIT: as asked in comments

lsblk

NAME                        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb                           8:16   0  1,7T  0 disk 
└─sdb1                        8:17   0  1,7T  0 part 
sr0                          11:0    1 1024M  0 rom  
sdc                           8:32   0  3,3T  0 disk 
└─sdc1                        8:33   0  3,3T  0 part 
sda                           8:0    0 67,8G  0 disk 
├─sda2                        8:2    0    1K  0 part 
├─sda5                        8:5    0 67,3G  0 part 
│ ├─serveur--nas--vg-swap_1 253:1    0   32G  0 lvm  [SWAP]
│ └─serveur--nas--vg-root   253:0    0 35,3G  0 lvm  /
└─sda1                        8:1    0  487M  0 part /boot

cat /proc/partitions

major minor  #blocks  name

   8        0   71041024 sda
   8        1     498688 sda1
   8        2          1 sda2
   8        5   70539264 sda5
   8       16 1756495872 sdb
   8       17 1756493824 sdb1
   8       32 3513778176 sdc
   8       33 3513776128 sdc1
  11        0    1048575 sr0
 253        0   36999168 dm-0
 253        1   33505280 dm-1
5
  • What does your iscsi configuration file look like? The Lun line should reference the drive, i.e. /dev/sdb
    – longneck
    Jul 26, 2017 at 17:49
  • Well you are asking me a very good question. I know I should edit the conf file to tell it where the image is (if I where to create an image) but I have no idea where the drive would be. My config file is very much whatever it is after a clean install.
    – Carobell
    Jul 26, 2017 at 18:19
  • Could you please add the output of lsblk and of cat /proc/partitions Jul 27, 2017 at 12:50
  • Do you want to export an entire disk as a LUN? Or you want to create a RAID1 (mirror) array out of those 2 disk and export only a slice of this array? Jul 27, 2017 at 12:54
  • Both "disks" are already a RAID10 and a RAID6 array. Edited OP with outputs
    – Carobell
    Jul 27, 2017 at 13:04

1 Answer 1

1

To use a whole disk as an iSCSI target, just specify the disk in your configuration file:

Target iqn.2015-05.com.exemple:storage.sys0
    Lun 0 Path=/dev/sdb,Type=fileio
3
  • I suspect that it is that simple, but for some reason it does not work for me. The job to enable/restart iscsitarget fails and I have no error code for it. I tested with an image and it worked so I can only suppose there is something missing for the disk to work ?
    – Carobell
    Jul 26, 2017 at 19:11
  • The more I look into it, iscsitarget cannot be used with my kernel ?? The more I look into it and while I can install it, it is not usable becasue of some dkms.conf. I am editing my question to write this new info.
    – Carobell
    Jul 27, 2017 at 12:08
  • Huh, quite strange. What's exactly with dkms in this scenario?
    – Strepsils
    Aug 7, 2017 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .