R
R
rra012019-04-26 15:21:28
ubuntu
rra01, 2019-04-26 15:21:28

Backing store path: None - No LUN is created on /dev/mapper/games0.img.cow.0 Why?

Hello.
I decided to create in my grid (all Win7 clients) a diskless system based on iSCSI.
As an Ubuntu target.
Been researching the issue on Ubuntu 14.04 for a while.
I did it according to this instruction: https://interface31.ru/tech_it/2016/08/nastroyka-i... I
figured it out more or less .... Even something worked ....
But when it came to putting it into practice, decided to install Ubuntu 18.04
How did everything.
Everything is based on this script:

#Copy on write for vblade server v0.5
#toxicnaan guess what goes here gmail.com
#this uses raw device mapper commands, if your using either LVM,LVM2,DM,LOOP
#then run it at your own risk!
#This will be like crossing the streams, it will be bad, very bad.
#don't run this if you don't understand whats going on
#if this script murders your dog/cat, deletes your server, or causes a war
#you can't blame me.
 
#useage makecow.sh 'image file name'
#image file name is an image that you want booted over aoe.
 
#takes a current imagefile, and makes 8 cow devices using loop and devicemapper
#it uses sparse files to cut down on diskspace
#using this script allows for many machines booting over aoe to use
#the same primary disk image.
#all writes your clients with go into the cow files.
 
#you need to be root to run this.
#for extra fun, try placing your cow files on a suitable large ram disk
#like /dev/shm for extra speeeeeeeeeeeeeed!
#vblade dirly run in background, targets range from 0 0 to 0 7.
 
#big greets to the masters of #etherboot on freenode. Thanks for all
#your help getting gpxe working for me!!!!!!
#no thanks to device mapper documentation!!!!
 
 
modprobe dm_mod
modprobe dm_mirror
modprobe dm_snapshot
 
IMAGE_FILE=$1
 
img_loop_dev=`losetup -f`
 
losetup -v -f $IMAGE_FILE
 
cow_size=`blockdev --getsize $img_loop_dev`
echo $cow_size
chunk_size=64
 
FILE=$IMAGE_FILE
 
for loopnumber in 0  1  2  3
do
dd if=/dev/zero of=/storage/clon/$FILE.cow.$loopnumber bs=512 count=0 seek=$cow_size
COWLOOPDEV=`losetup -f`
losetup -v -f /storage/clon/$FILE.cow.$loopnumber
echo "0 $cow_size snapshot $img_loop_dev $COWLOOPDEV p $chunk_size" | dmsetup create $FILE.cow.$loopnumber
 
vblade 0 $loopnumber enp4s0 /dev/mapper/$FILE.cow.$loopnumber &
 
echo $COWLOOPDEV  is attached to /storage/clon/$FILE.cow.$loopnumber
done
 
losetup -a
dmsetup table

I create a disk image:
mkdir /storage
dd if=/dev/zero of=/storage/games0.img bs=1M count=2048

I run the script:
makecow.sh games0.img
As a result, I get the following contents of the directories:
[email protected]:/storage# ls -lh /dev/mapper/
итого 0
crw------- 1 root root 10, 236 апр 26 12:45 control
lrwxrwxrwx 1 root root       7 апр 26 12:49 games0.img.cow.0 -> ../dm-0
lrwxrwxrwx 1 root root       7 апр 26 12:49 games0.img.cow.1 -> ../dm-1
lrwxrwxrwx 1 root root       7 апр 26 12:49 games0.img.cow.2 -> ../dm-2
lrwxrwxrwx 1 root root       7 апр 26 12:49 games0.img.cow.3 -> ../dm-3

[email protected]:/storage# ls -lh /storage/clon/
итого 256K
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.0
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.1
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.2
-rw-r--r-- 1 root root 4,9G апр 26 12:49 games0.img.cow.3

tgt config, target00.conf:
# create new
# naming rule : [ iqn.(year)-(month).(reverse of domain name):(any name you like) ]
<target iqn.2019-04.ru.home:target00>
    # provided devicce as a iSCSI target
    backing-store /dev/mapper/games0.img.cow.0
</target>

With this layout, the LUN is not registered in the backing-store!
[email protected]:/etc/tgt/conf.d# tgtadm --mode target --op show
Target 1: iqn.2019-04.ru.home:target00
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 1
            Initiator: iqn.1991-05.com.microsoft:work3 alias: none
            Connection: 1
                IP Address: xx.xx.xx.138
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
    Account information:
    ACL information:
        ALL

Backing store path: None
Why?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question