Moving and iSCSI file extent not working?

Status
Not open for further replies.

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
Hello,

I am running FreeNAS-8.3.1-RELEASE-p2-x64 (r12686+b770da6_dirty) version of FreeNas and I am in the process of adding additional storage. One of the tasks I am trying to do is move an iSCSI file extent to a new Volume (zfs drive set). Do do this, I setup the new zfs volume, then I logged into the shell, used rsync to copy the file to the new location. Once this was done, I updated the location of the extent in the GUI and restarted the iSCSI service. The issue is, now the iSCSI drive shows up as invalid on the system that was using it (Windows 2012 server -- "The disk structure is corrupted and unreadable").

Based on this I have two questions:
- Should I be able to simple move the file extent? or is that a bad idea
- If i should be able to move, any idea on why I can no longer access it?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I think you should shutdown the iscsi service, make the copy, then point iscsi to the new location and start it up.
 

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
Well after playing with this for 2 full days, I have to admit, the iSCSI support in FreeNas is making me a little nervous. Even pointing back to the original file is not bringing the data back online. Right now, I am very glad I was working with test data -- if this had been real data, I'd be in a bad place right now :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
There's alot of rules for using iSCSI. If you haven't used iSCSI alot you may not be aware of the issues...
 

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
I have ready the manual -- the entire manual actually. Is there something specific you think I missed?

Also I checked out your guide (not the Google docs version isn't working -- I get a 404) and there is only 1 comment in the entire thing about ISCSI. Is there something in there that I am missing.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It's not in the manual because its not specific to FreeNAS. It's how iSCSI works and there are various limitations, advantages, and disadvantages. The manual mostly covers setting up iSCSI(as well as setting up CIFS, AFP, FTP, etc.) and leaves it to the user to understand what each has to offer so that the user can best chose for their situation.

The best advice I can give is to look for a list of do's and don'ts for iSCSI or an in-depth guide to how to properly use iSCSI without losing data.. I'm not very knowledgable on iSCSI, but I see a lot more people that appear to get it wrong than get it right.

And just to clarify, the issues may or may not be with FreeNAS. But more than likely if you got it working in FreeNAS and then it stopped working and you know your settings are correct the issue is probably with your understanding of iSCSI and not with how its implemented in FreeNAS. You should figure out what you are doing wrong(for instance, 2 machines accessing the same iSCSi device = corruption) before you continue.
 

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
I appreciate the thoughts. I have been using FreeNas since the beta versions of v8 (multiple installations, 10+ TB of storage on several) and I have been using iSCSI for over 10 years on various platforms (linix, windows, vmware, etc) -- I even helped beta test the Windows Initiator. Simply switching the path the to the file extent on the FreeNas configuration should have had zero impact on anything and even if the implementation of iSCSI on FreeNas didn't like that, switching it back to the original file (I left that file completely untouched) should have brought everything back online (which it did not). This makes me curious as to why not.

Has anyone tried this in the past? Was it successful?
 
D

dlavigne

Guest
Was iSCSI running while it was being copied? That definitely can cause corruption. Otherwise, md5 the two files to see if the new one changed.
 

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
That's not a bad idea - however by pointing back to the original file extent is should still start working again.

Note: I was able to reproduce this issue now several times. I created a VM, setup iSCSI with a file extent, mounted it to a Windows 7 computer. Copied several files. Then disconnected it from Windows 7, stopped the iSCSI service on FreeNas, copied the file to another volume, updated the file extent, started iSCSI, and reconnected the Windows 7 machine -- the drive was no corrupt.

Is it possible this is a bug?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Doubtful. My guess is user error somewhere. The steps you mentioned above are the only proper way to copy an iSCSI device.

Unless you can provide steps that are repeatable its hard to even file a bug report.
 

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
I was pretty sure I gave the steps :) Here is what I have done (twice on a physical system and twice on a vmware test environment)

- Install FreeNas (lastest build)
- Create two zfs volumes (3 drives each)
- Create iSCSI file extent
- Create connection to iSCSI mount point on Windows 7 computer
- Format Drive
- Copy Files to drive
- Disconnect from Windows 7 computer
- Stop iSCSI service on FreeNas
- Log into shell
- Copy (with all attributes) iSCSI file to new zfs volume
- Edit file extent location
- Start iSCSI service on FreeNas
- Reconnect to iSCSI mount point on Windows 7 computer

At this point -- Windows only sees the drive as raw and provides and error that it is corrupt.

And the steps to attempt a "rollback" where
- Disconnect the iSCSI connection on Windows 7
- Stop iSCSI service on FreeNas
- Edit file extent and point back to ORIGINAL file (this file was untouched)
- Start iSCSI service on FReeNas
- Connect the iSCSI connection on Windows 7

Windows still reports the drive as raw and corrupt.

I have recreated this issue 3 times now so I am fairly comfortable saying that this could be a bug.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
When you say "disconnect the iscsi connection on windows 7" what do you mean? Is it any different if you shutdown the Windows machine instead?
 

ravensorb

Dabbler
Joined
Jan 18, 2012
Messages
37
I mean load up the iSCSI initiator, select the connection and click "disconnect". This is the same behavior as gracefully ejecting a USB drive on a Windows. It flushes all writes, closes all file handles, and remove the connection (as well as informs the iSCSI host that there is a disconnect requested).
 
D

dlavigne

Guest
If you think it is a bug, please create a ticket at support.freenas.org.
 
Status
Not open for further replies.
Top