Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to re-create or clone an existing iSCSI target not backed by a ZFS volume? I ask because upon rebooting a X4500 Thumper, I was affected by this bug: http://wesunsolve.net/bugid/id/6803721 The same bug is also here, https://defect.opensolaris.org/bz/show_bug.cgi?id=7482, but I am suddenly unauthorized to view that page.

Consequently, the LUN parameters for one our iSCSI targets, displayed when executing 'iscsitadm list target -v', are now all unknown. The iSCSI target can be connected to from its Windows Server 2008 initiator, but no disk is ever mounted. The actual data exists in the backing store directory (/export/pool1/iscsi/iqn.1900.fakeiqn/lun.0).

For some additional information, this iSCSI target was created in the following manner:

1) zfs create pool1/iscsi

2) iscsitadm modify admin --base-directory /export/pool1/iscsi

3) iscsitadm create target --size 1T this.is.a.long.target.name.affected.by.the.bug.above

4) The base directory is laid out as follows (ls -al /export/pool1/iscsi):

drwxr-xr-x 2 root sys 3 Jan 30 10:10 iqn.1900.fakeiqn.target

lrwxrwxrwx 1 root sys 87 Nov 4 2010 this.is.a.long.target.name.affected.by.the.bug.above -> /export/pool1/iscsi/iqn.1900.fakeiqn.target

If it is not possible to re-create or clone this existing iSCSI target, can the LUN data be retrieved any other way?

Thank you for your help.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I seemed to have answered my own question.

I was able to recover the data by dd'ing the data from the failed iSCSI target to a new iSCSI target backed by a ZFS volume. These are the steps I performed:

1) zfs create -V 1T pool1/new_target

2) zfs shareiscsi=on pool1/new_target

3) iscsitadm list target -v pool1/new_target | grep 'Backing store'

4) Take note of pool1/new_target's Backing store path (/dev/zvol/rdsk/pool1/new_target in this case)

5) Because the failed iSCSI target is not backed by a ZFS volume Step 4 will not work to find the Backing store for the failed iSCSI target. The data for the failed iSCSI target is located in the Base Directory found using iscsitadm show admin. cd to that directory and follow the path until you find the lun.# file. (/export/pool1/iscsi/iqn.1900.fakeiqn.target/lun.0)

6) dd if=/export/pool1/iscsi/iqn.1900.fakeiqn.target/lun.0 of=/dev/zvol/rdsk/pool1/new_target bs=8k (The block size of the new ZFS volume is 8k)

This took about 2 days to dd the data, but it was successful and I was able to mount the new iSCSI target from the Windows initiator and see all of the data.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.