recover the data from FreeNAS crashed system

Status
Not open for further replies.

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
Hi I have PC with
40GB drive - FreeNAS installed

1TB
1TB
1TB
All the above 3 drives are configured as RAID giving me total space of 3TB.
Somehow today my FreeNAS cannot boot; Is there anyway to recover all the data from 3TB drive.

I tried fresh installation of FreeNAS on usb and trying to import the volume; Clicking on Auto import volume list the zfs on drop down list. Selecting the zfs/volume name and clicking on Import Volume does nothing.

Help will be much appreciated, thank you.
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
if 3 drives of iT each will show up as 3T usable disk then the only possibility is raid0 ( all disks concatinated to one
volume with no redundancy)

whats the output of the command 'zpool import'

Will zpool import -f lead somewhere ?
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
hi peterh
here are the screenshots with zpool commands

scr1fq.jpg

scr2jc.jpg


after following commands nothing happened for 2 minutes but it threw few errors as ahcich1: timeout on slot 20 port 0
scr3s.jpg


scr4y.jpg


I then went to the webpanel; there was nothing imported
43562270.jpg


I clicked on Auto import volume its just stayed on Loading....
86812064.jpg


I then restarted the system and straight way went to webpanel; Then clickin on Auto Import volume shows my pool; I then clicked on Import Volume but nothing happened
73537622.jpg


I then refreshed the page and I can see /mnt/rgsnasvol1 within Volumes on left.
69586256.jpg


Clicking on change permissions throws following error
45282576.jpg



Sorry for the lots of screen shots and thank you for taking time to look at it.
 

StephenFry

Contributor
Joined
Apr 9, 2012
Messages
171
Have you tried importing it using its numeric id (161...) instead of its name?

edit: that suggestion is still an option, but try this first:

in my recent testing, I have seen a lot of scenarios where pools weren't properly importable. Too many, actually - but I had already committed to FreeBSD/NAS and ZFS so stuck with it. These were pools just like yours, where nothing "pool-wise" had changed, just the FreeNAS install had gone pear-shaped. This is a serious problem in FreeNAS (and/or ZFS?) as far as I'm concerned: importing pools should be much much more reliable.

However, what you could try is to EXPORT the healthy, online pool from the CLI and then do an import from the GUI. This helped me a few times. You may have to do this from a fresh FreeNAS install, that has no previous knowledge of your pool.
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
Somehow after a new installation of Freenas on new hard disk took me much further.
I can now auto mount volume; The list all volumes shows the drive; it shows all three raid drives and says all disks are online. I have enabled and re-configured the iscsi target.
Now from Windows 7 machines i successfully managed to connect using iscsi initiator But from disk management it shows unallocated drive; does that mean all data is lost.
I have tried connecting via Window Server 2008R2 and another win 7 machines using iscsi initiator but it still displays unallocated space from disk management.
a01vs.jpg

a02qn.jpg

a03t.jpg
 

StephenFry

Contributor
Joined
Apr 9, 2012
Messages
171
Since FreeNAS reports all is fine and even tells us that 671GB is used, I wouldn't worry about data loss.

What about a CIFS/SMB share? I'm not too experienced with iSCSI and a simple Windows share might be a way to see your data. Configuring iSCSI can then be next on the list.
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
my Freenas was only configured with iSCSI. CIFS/SMB were not enabled.
I tried enabling them and browsing shares from other windows machines but no luck with the data access
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
I enabled the ISCSI and configured the ISCSI settings. Now from Windows machines I tried setting up the ISCSI Initiator and from Disk Management it shows Unallocated disk space.
I tried connecting from different Windows machines aswell but still all it shows is Unallocated disk space.

Anyone here in this forum has any advice on this; I will be much appreciated.
 

praecorloth

Contributor
Joined
Jun 2, 2011
Messages
159
I enabled the ISCSI and configured the ISCSI settings. Now from Windows machines I tried setting up the ISCSI Initiator and from Disk Management it shows Unallocated disk space.
I tried connecting from different Windows machines aswell but still all it shows is Unallocated disk space.

Anyone here in this forum has any advice on this; I will be much appreciated.

Possibly NTFS is thoroughly jacked. Maybe try mounting the iSCSI target with a Linux box and using chkdsk.ntfs on it.

WARNING:
Linux's NTFS support is technically hacked together since Microsoft doesn't want Linux reading/writing natively to NTFS. There is the possibility of corruption to your data if you go this route. In the couple of years I've been working with NTFS in Linux, I haven't seen it, but it is still a possibility. However, at this point having had two Windows boxes look at it, I would think it is best to come to terms with the possibility that the data may be lost anyways.

If you want to do this and you are unfamiliar with Linux, I can assist further with it. Just get an Ubuntu (server or desktop) started on the network, and we'll go from there.
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
it looks like smthing within the pool is corrupted But it imports fine from GUI and I can see the pool info which says healthy.
imagebsc.jpg

imagevba.jpg


But GUI shows as follows:
a01vs.jpg


@praecorloth
I will try your options probably tuesday as I need a spare machine to install ubuntu; could you please let me know what shall i do after installing ubuntu.
 

praecorloth

Contributor
Joined
Jun 2, 2011
Messages
159
Alright, once your Ubuntu machine is up and on the network we'll install the iscsi initiator, and then check to see if your data is readable in Linux. If not, we'll run a file system check. Let me just say up front that I am going to get detailed in what the various commands do. It's not because I think you're slow or anything, I just don't know what your skill level with Linux is, and also I would like to make this detailed for others who might happen across it.

Start off by getting to the command line. If you've got server installed, you're likely at the command line, if you've got the desktop edition installed, hit ctrl+t to open a new terminal window.


Code:
# sudo bash
enter your password

# apt-get install open-iscsi
it will download the iscsi initiator

# iscsiadm -m discovery -t sendtargets -p 192.168.0.200
replacing 192.168.0.200 with whatever your iscsi target's IP is
this will return a line similar to...
192.168.0.200:3260,1 iqn.2012-03-07.term.skynet.codex

# iscsiadm --mode node --targetname iqn.2012-03-07.term.skynet.codex --portal 192.168.0.200:3260 --login
it should think for a moment and then let you know that the login is successful
at this point you should have another /dev/sdX device. The letter of the device is dependent upon how many drives you have in the system that Linux is running on. For example, in my laptop, I have two actual hard drives, so I have /dev/sda and /dev/sdb. By adding the iscsi target, I have created /dev/sdc. You can find out what device to work with by doing the following...

# ls -la /dev/sd*
This will give you a list of all /dev/sd devices. Assuming the login to the iscsi target was successful, the /dev/sd device with the letter furthest along the alphabet will be your iscsi target. For this example, let's say it's /dev/sdc. Now if Linux is able to read the partition tables correctly you may see, /dev/sdc, /dev/sdc1, /dev/sdc2, etc. The numbers are partitions, with /dev/sdc itself representing the entire drive.
If you have been able to get this far, we're in good shape. The next thing to do will be to try to mount a partition and see if you can read the data.

# mkdir /mnt/iscsi
Just creating a mount point for a partition

# mount /dev/sdc1 /mnt/iscsi
Assuming no errors occur, the first partition of your iscsi target is now mounted at /mnt/iscsi. Now, the moment of truth.

# ls -la /mnt/iscsi
Directories are generally listed as blue, files can be all kinds of different colors based on all sorts of different things. But the important question: Are your files there?
If they are there, this is your chance to use the Linux machine to simply copy those files to another location to make sure you have them. I will leave the copy operation up to your own research. It shouldn't be too difficult, especially if you're using Ubuntu Desktop. I will continue on under the assumption that we want to try to fix whatever errors NTFS may have that are preventing Windows from properly mounting the partitions. If you do decide to copy the data off to another location, do not attempt the fix while the copy operation is in progress.

# umount /mnt/iscsi
Just unmounting so that nothing touches the data while we work with it.

# ntfsfix /dev/sdc1
Run this for as many partitions as are on the iscsi target. This will likely take some time.

# iscsiadm --mode node --targetname iqn.2012-03-07.term.skynet.codex --portal 192.168.0.200:3260 --logout
Disconnect the iscsi target.


At this point you can try to mount the iscsi target on your Windows box and with any luck Windows will be able to mount the partition and see the data like nothing happened. Hopefully everything here has been readable.
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
hi praecorloth
thank you for your support
I am stuck on the mounting part and following is the error im getting

root@jdoepc:/# mount /dev/sdb1 /mnt/iscsi
mount: you must specify the filesystem type
 

praecorloth

Contributor
Joined
Jun 2, 2011
Messages
159
Wacky. It likely doesn't know the filesystem type, which means ntfsprogs isn't installed. Use this command as root,

Code:
# apt-get install ntfsprogs


I'm used to Ubuntu having everything it needs to work with NTFS partitions installed automatically. But then again, it's possible that I just install it without thinking about it, and since I don't reinstall Ubuntu that often, I just forget about it. If the mount command still gives you that error after running this, then instead of using the mount command I listed, try,

Code:
# ntfsmount /dev/sdb1 /mnt/iscsi
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
thank you praecorloth for your support

this is what it throws me

Code:
root@jdoepc:~# ntfsmount /dev/sdb1 /mnt/iscsi
Failed to startup volume: Invalid argument.
Failed to mount '/dev/sdb1': Invalid argument.
The device '/dev/sdb1' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?
Mount failed.
root@jdoepc:~#


The filesystem on that FREENAS 3 x 1TB RAID 0 was ZFS; but the ISCSI that was connected to my windows machine was NTFS. Looks like I am out of luck.
 

praecorloth

Contributor
Joined
Jun 2, 2011
Messages
159
It is starting to look like you may be out of luck, but let's try one more thing. That target cannot mount means that there is likely filesystem damage and it no longer resembles NTFS. In this case let's skip to the filesystem scan and see what happens.

Code:
# ntfsfix /dev/sdb1


Hopefully that program will be smart enough to take a deeper look at the filesystem and put everything straight. That's the last bit of hope I can offer.
 

nazzy

Cadet
Joined
Jun 2, 2011
Messages
3
Since windows can see the drive as unallocated space, have you tried a recovery program. I've used R-Studio from R-Tools Technology and it works good. I think there's a demo.

...I can't see why you RAID 0 the 3 drives, use a parity drive and use native filesystems for a basic nas.
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
Hi praecorloth, following is what i got:

Code:
root@jdoepc:~# ntfsfix /dev/sdb1
Mounting volume... Failed to startup volume: Invalid argument.
FAILED
Attempting to correct errors... FAILED
Failed to startup volume: Invalid argument.
Volume is corrupt. You should run chkdsk.
root@jdoepc:~#



Code:
root@jdoepc:~# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00046f9a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60558   486427648   83  Linux
/dev/sda2           60558       60802     1955841    5  Extended
/dev/sda5           60558       60802     1955840   82  Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 2899.1 GB, 2899102924800 bytes
256 heads, 63 sectors/track, 351085 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disk identifier: 0xb1da3f45

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      266306  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.
root@jdoepc:~# 


@nazzy
I have tried the demo version of R-Studio for Windows; mounted these 3 drives and created a virtual raid. After several hours of scan it gave me following errors:
Code:
Type: System - Read disk Virtual Block RAID 1 at position 998789226496 failed after 2 attempts. Unable to regenerate RAID checksum. 
Type: Disk - Can't regenerate RAID5 parity.
Type: System - Read disk Virtual Block RAID 1 at position 998789414912 failed. Scan process terminated.


Oh my luck!!! Anyway thank you praecorloth & nazzy for your help.
 

praecorloth

Contributor
Joined
Jun 2, 2011
Messages
159
I want to say that may have something to do with sector sizes. The ntfsfix program is attempting to use 512 byte sectors, where as your drives and subsequently your RAID uses 4KB sectors. Unfortunately I do not know that for a fact, nor do I know a work around to even try. So at this point I will offer my condolences on your data loss. :(
 

bickyz

Dabbler
Joined
Nov 2, 2011
Messages
13
praecorloth, you tried your best and my lots of thanks to you for helping me on this.
 
Status
Not open for further replies.
Top