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:
- Install kpartx:
- Create a loopback device. This create /dev/mapper/loop0pX where X is the parition number
- Mount the parition:
sudo apt-get install kpartx
sudo /sbin/losetup /dev/loop0 /dev/mapper/Target-LogicalVolume
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.