# [FreeNAS] Bad superblock on gconcat device



## PotatoMasher (Feb 2, 2011)

Greetings

After searching around on the web about how to solve my issue, I finally concluded that I should ask here. Basically, I would like to know how to fix my filesystem which seems to be corrupted.

To make a one-month story quick, when I run `# fsck_ufs` on my gconcat array, I have the following error message:

```
** /dev/concat/jbod1
Cannot find file system superblock
ioctl (GCINFO): Inappropriate ioctl for device
fsck_ufs: /dev/concat/jbod1: can't read disk label
```

Of course, specifying an alternate superblock does give me another error message:

```
freenas:/# fsck_ufs -b 160 /dev/concat/jbod1
Alternate super block location: 160
** /dev/concat/jbod1
160 is not a file system superblock
```

I have tried with several other potentially good superblock backups
`# newfs -N /dev/concat/jbod1`
and it's still a no-go.

After looking at the page http://forums.freebsd.org/showthread.php?t=16984, I was wondering if it was possible to run fsck_ufs on each of the drives separately since the live CD doesn't seem to support gconcat, knowing that the drives are supposed to be concatenated...

Thanks for any ideas, and here are the specs and setup of the machine if you need them:
Hardware

A8N32SLI-Deluxe
AMD Athlon 64 x2 4200+
2gb of DDR
4x 2TB Western Digital HDD
Software

Ran with a FreeNAS 0.7.2 Sabanda (revision 5266) from LiveCD
Based on FreeBSD 7.3-RELEASE-p2 (revision 199506)
The drives were "softwareJBOD" formatted via webGui
The "softwareJBOD" was then formatted in UFS(GPT and Soft Updates) also via webGui

Regards, PotatoMasher


----------



## sub_mesa (Feb 5, 2011)

I'm missing the 'gconcat status' output?

Also, any partitions on the concat device?

`ls -l /dev/concat/*`

If you want geom_concat available from your livecd, then load the kernel module first:
`kldload geom_concat`


----------



## PotatoMasher (Feb 7, 2011)

First of all, thanks for your answer! I was beginning to feel a little bit helpless on this issue.

Creation of the array (it's a manual creation, there's not metadata stored on the disks):

```
freenas:/# gconcat create jbod1 /dev/ad8 /dev/ad10 /dev/ad12 /dev/ad14
```

Here is the output of the listing of the concat folder:

```
freenas:/# ls -l /dev/concat/*
crw-r-----  1 root  operator    0, 105 Feb  7 16:35 /dev/concat/jbod1
crw-r-----  1 root  operator    0, 106 Feb  7 16:35 /dev/concat/jbod1p1
```

The array seems to have only one partition (or at least it's supposed to..):

```
freenas:/# gconcat status
        Name  Status  Components
concat/jbod1      UP  ad8
                      ad10
                      ad12
                      ad14
```


----------



## PotatoMasher (Feb 10, 2011)

I haven't progressed a lot, only gathered some information that could be useful to someone willing to help.

First of all, this thread Cannot find file system superblock is a very interesting piece of reading for me.

I'm currently running my operations from the FreeNas liveCD, based on FreeBSD 7.3. I do all the command line work via network, with PuTTY.

I also wanted to post out the result of `# newfs -N /dev/concat/jbod1` here, to list the theorical superblock backups:

```
/dev/concat/jbod1: 7630916.3MB (15628116672 sectors) block size 16384, fragment size 2048
	using 41526 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624, 3010976,
 3387328, 3763680, 4140032, 4516384, 4892736, 5269088, 5645440, 6021792,
 6398144, 6774496, 7150848, 7527200, 7903552, 8279904, 8656256, 9032608,
 9408960, 9785312, 10161664, 10538016, 10914368, 11290720, 11667072, 12043424,
 12419776, 12796128, 13172480, 13548832, 13925184, 14301536, 14677888,
 15054240, 15430592, 15806944, 16183296, 16559648, 16936000, 17312352,
```
(lots of numbers were cut, here's the end)

```
15608070304, 15608446656, 15608823008, 15609199360, 15609575712, 15609952064,
 15610328416, 15610704768, 15611081120, 15611457472, 15611833824, 15612210176,
 15612586528, 15612962880, 15613339232, 15613715584, 15614091936, 15614468288,
 15614844640, 15615220992, 15615597344, 15615973696, 15616350048, 15616726400,
 15617102752, 15617479104, 15617855456, 15618231808, 15618608160, 15618984512,
 15619360864, 15619737216, 15620113568, 15620489920, 15620866272, 15621242624,
 15621618976, 15621995328, 15622371680, 15622748032, 15623124384, 15623500736,
 15623877088, 15624253440, 15624629792, 15625006144, 15625382496, 15625758848,
 15626135200, 15626511552, 15626887904, 15627264256, 15627640608, 15628016960
```

None of them has worked out so far using either `# fsck_ufs -b [block_number] /dev/concat/jbod1` or `# fsck_ffs -b [block_number] /dev/concat/jbod1`

I have read that you can manually dd the alternate superblock to the original superblock. Before doing so, I would like to know how to check that the dd'ed blocks are actually a valid superblock... Is there a way to find out?

Also, my 4 hard disks were part of a hardware raid. When I look at my server's screen, I see some error messages:

```
GEOM: concat/jbod1: the secondary GPT table is corrupt or invalid.
GEOM: concat/jbod1: using the primary only -- recovery suggested.
```
As some freenas moderators stated before, I haven't worried much about those errors, but I'm still wondering if it could help resolving my problem if I resolved this issue? I'm referring to http://forums.freebsd.org/showthread.php?t=1556GEOM: adX: the secondary GPT table is corrupt or invalid

I will continue posting my whereabouts here, in case anyone have an idea to help.

Have a nice evening


----------



## PotatoMasher (Mar 4, 2011)

Hello everyone

I have made some progress in the painful way to recover stuff from the drive. After randomly dd'ing and using a small script called "findbill" without any success, I managed to install testDisk.

My question is: On what part of the array should I run testdisk?

In fact, there is two elements in /dev/concat/:

```
freenas:~# ls /dev/concat
JBOD1   JBOD1p1
```

Should I run

```
testdisk /dev/concat/JBOD1
```

or

```
testdisk /dev/concat/JBOD1p1
```


----------

