# [FreeNAS] File system corrupted



## Haring (Jun 19, 2012)

I installed *F*reeNAS 0.7.2 on a PC with two shared hard disks, once had both the real OS and data. One day while *I* was copying data, the computer rebooted with no reason and then *F*reeNAS showed a message error 
	
	



```
hard disk warning cf was not properly dismounted
```
 So I followed the procedures described here http://wiki.freenas.org/faq:0001 but it didn't help me so I formatted the hard disk which had installed the OS and made another installation. The hard disk that before had the OS installed now works, the other disk doesn't and *F*reeNAS shows me again 
	
	



```
hard disk warning cf was not properly dismounted
```

I connected the disk to my laptop to try to rescue data with UFS Explorer, but it shows me a message error that says 
	
	



```
file system corrupted
```

Then in the shell I tried the command (for disk only data) [cmd=]fsck_ufs -p /dev/ad0p1 &[/cmd] but the output is 
	
	



```
Cannot find file system superblock
```

What can I do to find the superblock and fix the problem?

Thanks


----------



## DutchDaemon (Jun 19, 2012)

Disclaimer: *Topics about PC-BSD | FreeNAS | DesktopBSD | m0N0WALL | pfSense | Debian GNU/kFreeBSD*. 

Be very careful when following/applying any advice given here.


----------



## Haring (Jun 19, 2012)

I already posted a topic in the *F*reeNAS forum but they couldn't help me yet, so I tried to post here.


----------



## throAU (Jun 25, 2012)

Essentially the filesystem superblock is missing, and you'll need to restore a copy of it.

When you did a *newfs* on the drive in question (or, the FreeNAS installer did it), what parameters did you use?  If you don't remember, or used the FreeNAS defaults, you'll need to find out what they were.

Once you find out what they were, you may be able to work out how many superblock copies were on the disk, and MAY be able to recover.  This will depend on the disk size and parameters that were passed to newfs by FreeNAS.

Even if you _can_ recover the superblock, there's still no guarantee your data is OK.  The superblock got corrupted for a reason.

Recovery from this WILL involve low level data hackery (with dd) and success will be very dependent on getting the process right, which will be pretty difficult without knowing how your filesystem was created (you'll be shooting blind).

Do you have backups? Because now is the time you may want to consider restoring from them.

edit:
The above is based on info I've seen for similar issues in the past.  I've never done it, so don't ask me how to proceed exactly - I've either given up at this point or restored from backup if I had one.  You're in the situation where you could very easily destroy any chance of data recovery if you get the process wrong.


----------



## tingo (Jun 27, 2012)

If all else fails, you can try sysutils/ffs2recov (no, I do not know how you would get that onto FreeNAS. You'll have to figure that out yourself. Or simply install FreeBSD on another machine and connect your disks to it). If you do try ffs2recov, it should preferably be done on a copy of the disk with the bad filesystem, so you have more chances to recover your data later.


----------

