iscsi 怎么搞

时间:2023-03-08 21:34:28

I recently reinstalled the software on my NAS (open media vault) and tidied up the host name etc. As part of this I changed the name of the iSCSI target. This meant that my media PC wouldn’t boot over the network (I set it up using XBMCbuntu using this guide – http://www.heath-bar.com/blog/?p=184). To solve this I managed to mount the partition on the NAS server itself and modify the necessary boot parameters.

To mount it I did the following:

    1. Install kpartx:

sudo apt-get install kpartx

    1. Create a loopback device. This create /dev/mapper/loop0pX where X is the parition number

sudo /sbin/losetup /dev/loop0 /dev/mapper/Target-LogicalVolume

    1. Mount the parition:

sudo mount /dev/mapper/loop0p1 /tmp/iscsi-target-mnt

The reason I created the loopback device was because I kept receiving these errors:

$ sudo kpartx -a /dev/mapper/Target-LogicalVolume
device-mapper: reload ioctl failed: Invalid argument
create/reload failed on Target-LogicalVolume1
device-mapper: reload ioctl failed: Invalid argument
create/reload failed on Target-LogicalVolume2
device-mapper: reload ioctl failed: Invalid argument

Credit to http://www.skytale.net/blog/categories/5-Linux for pointing me in the right direction.