Unable to create volume

Status
Not open for further replies.

EvilGenius

Cadet
Joined
Jul 25, 2011
Messages
9
I had this problem since version 8 (tried today with 8.01 RC1) but thought always this was my mainboard (a VIA VB8001). Today, new hardware (ASRock E350M1) I had the same issue:

I am unable to create a working zfs volume.
First, I have to execute 'sysctl kern.geom.debugflags=0x10' on a root shell, otherwise I get 'Unable to GTP format disk ada0'.

After executing that, I can create a ZFS (mirror with 2 disks, WD20EARS), the "use 4k" ckeckbox is checked, of course.

All seems fine, I can access the volume, write an read data to/from it.
But after a reboot, I am not able to access the volume.
dmesg says:
Code:
ada0 at ata2 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD20EARS-00MVWB0 51.0AB51> ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada0: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0: <Mass Storage Device \\001\\000\\000?> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 3826MB (7837695 512 byte sectors: 255H 63S/T 487C)
ada1 at ata3 bus 0 scbus1 target 0 lun 0
ada1: <WDC WD20EARS-00MVWB0 51.0AB51> ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
GEOM: da0s1: geometry does not match label (16h,63s != 255h,63s).
GEOM: ada0: the secondary GPT table is corrupt or invalid.
GEOM: ada0: using the primary only -- recovery suggested.
GEOM: ada1: the secondary GPT table is corrupt or invalid.
GEOM: ada1: using the primary only -- recovery suggested.
GEOM_MIRROR: Device mirror/mirror0 launched (2/2).
GEOM: mirror/mirror0: corrupt or invalid GPT detected.
GEOM: mirror/mirror0: GPT rejected -- may not be recoverable.


I had it all up an running on FreeNAS 0.7 without problems, but version 8 with zfs is unusable because of this. I suspect the disks (advanced format) may be the problem...

If I put one of these disks into my linux box, I can import the filesystem without any problem (aside the missing second disk) using fuse-zfs and access the data.

If I use UFS, I first (without the geom.debugflags) get the error:
Code:
Error: [MiddlewareError: Volume creation failed: "geom: Can't store metadata on dev/ada0: Operation not permitted., "]


After doing the debugflags trick, it works and it does so even after a reboot.
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
That happens because your disks are not blank, they already have metadata (looks like geom mirror)...

Try using the Auto Importer to import the mirror, then export it (checking the box to blank disks)
...or wipe the disk data before
 

EvilGenius

Cadet
Joined
Jul 25, 2011
Messages
9
I already blanked some of the first and last sectors of the disks. Seems not enough, so I'll try and zero out the whole disks.

Importing does not work, theres an error (don't remember exactly, but something about not verified circumstances).
 

gabrielBlack

Cadet
Joined
Sep 4, 2011
Messages
2
similar problem, same solution

Hi,

I had a similar problem: using used disks in Freenas, was impossible create a ZFS mirrored raid or a UFS mirrored raid.

Trying these operation, was visualized the errors:

"MiddlewareError Volume creation failed geom Can't store metadata Operation not permitted"
or
"Unable to GPT format the disk "

So I tryed to install both the disks on a Linux machine to reset they with the commands:

dd if=/dev/zero of=/dev/devicename bs=1k seek=$tailBlocks
dd if=/dev/zero of=/dev/devicename bs=1k count=20

with no success.

Reading this post , I tried to set the "kern.geom.debugflags" flag and the problem is gone !!!

I was resigned to fill the entire disc with NULLs.

Could you explain me the purpose of this flag ?

Thank you!
 

EvilGenius

Cadet
Joined
Jul 25, 2011
Messages
9
Gabriel,

please take care if you created a ZFS volume his way. In my case, creation and access succeeded, but the volume was inaccessible after a reboot. The only solution to gain acess to my data again was to mount one of my RAID1-disks on a linux machine using the fuse-zfs driver.

I had to create a UFS volume and delete it using the "destroy data" checkbox. After that, the ZFS volume I created was stable.

I thing that there is plenty of backup information about the volume scattered all over the entire disk. Only the "destroy data" option seems to delete all (or at least enough) of this data. However, zeroing out the entire disk should do it, too, but will take a long time.

Since I do not know much about BSD, this is pure speculation: I think the geom "subsystem" which cares about softraid prevents changes to the disk structure if it finds information about existing geom volumes to prevent data loss.
By setting the debugflags parameter you deactivate/override this protection.
However, as I leraned, this is not always a solution - my ZFS volume containing important data was inaccessible after a reboot because I used this parameter to create the volume instead of going the right way destroying all metadata.
 

gabrielBlack

Cadet
Joined
Sep 4, 2011
Messages
2
True !!!

As you said,

after the reboot, FreeNas doesn't mount the ZFS raid disk and print an error that specify a corruption on the secondary GPT Table.

So I've mounted both the disks, again, in my linux machine and I've erased all with a "dd" on all the disk sectors.

Retrying, all work fine.

So I have a question more: in the old posts about FreeNas, error like this was solved using commands like "gpt" or "gdisk" from the root command line.
In FreeNas 8, these tools are no longer present: why ?

Thank you !
 

Adub

Cadet
Joined
Nov 7, 2011
Messages
7
Okay, I am going through the exact same problem, but zeroing out my drives didn't fix the issue. I did a "dd if=/dev/zero of=/dev/adaX bs=4096k" where X = 0,1,2,3 on all of the drives.

If I use the "sysctl kern.geom....=0x10" trick, I can create a zpool just fine via the WebGUI. However, it becomes unusable after rebooting.

Here is some examples of the setup that I have tried after zeroing out both drives and leaving "kern.geom...." at default.

Using all drives:
http://imageshack.us/f/802/screenshot20111107at103.png/

And the resulting error:
http://imageshack.us/f/835/screenshot20111107at104.png/

skipping ada2, using 3 drives:
http://imageshack.us/f/580/screenshot20111107at104.png/

and the resulting error:
http://imageshack.us/f/21/screenshot20111107at104.png/


What do I need to do in order to get this working properly?

I am using FreeNAS 8.0.2 via a USB install on a 16GB USB stick. The 500GB drives are an assortment that a buddy of mine gave to me because he had gone to 2TB drives.

Oh, and i just logged in and "less-ed" /var/log/messages. I found these interesting bits:
Nov 7 10:40:48 beastnas freenas[1658]: Popen()ing: gpart add -b 128 -t freebsd-swap -s 4194304 ada1
Nov 7 10:40:48 beastnas freenas[1658]: Popen()ing: gpart add -t freebsd-zfs ada1
Nov 7 10:40:48 beastnas freenas[1658]: Popen()ing: gpart bootcode -b /boot/pmbr-datadisk /dev/ada1
Nov 7 10:40:48 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada2 bs=1m count=1
Nov 7 10:40:48 beastnas freenas: dd: /dev/ada2: Operation not permitted
Nov 7 10:40:48 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada2 bs=1m oseek=`diskinfo ada2 | awk '{print int($3 / (1024*1024)) - 4;}'`
Nov 7 10:40:48 beastnas freenas: dd: /dev/ada2: Operation not permitted
Nov 7 10:40:48 beastnas freenas[1658]: Popen()ing: gpart create -s gpt /dev/ada2
Nov 7 10:41:36 beastnas freenas[1658]: Executing: swapoff -a
Nov 7 10:41:36 beastnas freenas[1658]: Executing: geom disk list ada0 | grep 'Stripesize: 4096'
Nov 7 10:41:36 beastnas freenas[1658]: Executing: geom disk list ada0 | grep 'Sectorsize: 512'
Nov 7 10:41:36 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada0 bs=1m count=1
Nov 7 10:41:36 beastnas freenas: 1+0 records in
Nov 7 10:41:36 beastnas freenas: 1+0 records out
Nov 7 10:41:36 beastnas freenas: 1048576 bytes transferred in 0.005632 secs (186184341 bytes/sec)
Nov 7 10:41:36 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada0 bs=1m oseek=`diskinfo ada0 | awk '{print int($3 / (1024*1024)) - 4;}'`
Nov 7 10:41:36 beastnas freenas: dd: /dev/ada0: short write on character device
Nov 7 10:41:36 beastnas freenas: dd: /dev/ada0: end of device
Nov 7 10:41:36 beastnas freenas: 5+0 records in
Nov 7 10:41:36 beastnas freenas: 4+1 records out
Nov 7 10:41:36 beastnas freenas: 4218880 bytes transferred in 0.021563 secs (195653184 bytes/sec)
Nov 7 10:41:36 beastnas freenas[1658]: Popen()ing: gpart create -s gpt /dev/ada0
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart add -b 128 -t freebsd-swap -s 4194304 ada0
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart add -t freebsd-zfs ada0
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart bootcode -b /boot/pmbr-datadisk /dev/ada0
Nov 7 10:41:37 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada1 bs=1m count=1
Nov 7 10:41:37 beastnas freenas: 1+0 records in
Nov 7 10:41:37 beastnas freenas: 1+0 records out
Nov 7 10:41:37 beastnas freenas: 1048576 bytes transferred in 0.007261 secs (144411312 bytes/sec)
Nov 7 10:41:37 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada1
bs=1m oseek=`diskinfo ada1 | awk '{print int($3 / (1024*1024)) - 4;}'`
Nov 7 10:41:37 beastnas freenas: dd: /dev/ada1: short write on character device
Nov 7 10:41:37 beastnas freenas: dd: /dev/ada1: end of device
Nov 7 10:41:37 beastnas freenas: 5+0 records in
Nov 7 10:41:37 beastnas freenas: 4+1 records out
Nov 7 10:41:37 beastnas freenas: 4218880 bytes transferred in 0.023520 secs (179374204 bytes/sec)
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart create -s gpt /dev/ada1
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart add -b 128 -t freebsd-swap -s 4194304 ada1
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart add -t freebsd-zfs ada1
Nov 7 10:41:37 beastnas freenas[1658]: Popen()ing: gpart bootcode -b /boot/pmbr-datadisk /dev/ada1
Nov 7 10:41:38 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada3 bs=1m count=1
Nov 7 10:41:38 beastnas freenas: dd: /dev/ada3: Operation not permitted
Nov 7 10:41:38 beastnas freenas[1658]: Executing: dd if=/dev/zero of=/dev/ada3 bs=1m oseek=`diskinfo ada3 | awk '{print int($3 / (1024*1024)) - 4;}'`
Nov 7 10:41:38 beastnas freenas: dd: /dev/ada3: Operation not permitted
Nov 7 10:41:38 beastnas freenas[1658]: Popen()ing: gpart create -s gpt /dev/ada3

Edit2: It looks like this ticket may be related https://support.freenas.org/ticket/793 along with 794 possibly.
 

Adub

Cadet
Joined
Nov 7, 2011
Messages
7
Um, have any of the FreeNAS developers seen this yet? It's really quite annoying and is preventing me from using FreeNAS period. The ticket is already 2 months old.
 

rnicolas

Explorer
Joined
Sep 20, 2011
Messages
51
I got the same error on one of my test freeNAS boxes.
THe drive I was trying to make into a new volume had originally been used in RAIDZ1 setup.

SO what I did was hook it up to one of my Windows machines and performed the following commands from MS-DOS.

select disk 1 (where 1 is the SATA number I had the drive plugged into my MOBO)
clean
create partition primary
select partition 1 (where 1 is the SATA number I had the drive plugged into my MOBO)
active
format fs=ntfs quick
assign
exit

Hooked it up to my freeNAS box and I was able to add it as a new UFS volume.

But I did this from the same box and now my 2 mirrored drives say DEGRADED. I will reboot and see if that fixes it.
 

Adub

Cadet
Joined
Nov 7, 2011
Messages
7
We're you able to reboot and check the issue?

Also, when you formatted the disk in windows, and then attached it to your freenas box, did you have to use the sysctl kern trick?

Adub
 

rnicolas

Explorer
Joined
Sep 20, 2011
Messages
51
We're you able to reboot and check the issue?

Also, when you formatted the disk in windows, and then attached it to your freenas box, did you have to use the sysctl kern trick?

Adub

This should be done from another machine so you shouldn't have the issue I had.

I didn't use the kern trick, I just edit* created a new volume from the GUI and it worked.

Using freeNAS 8.0.2
 

Adub

Cadet
Joined
Nov 7, 2011
Messages
7
I don't understand why running zeros on the disk with dd won't work, when formatting in another machine does?
 

Grauniad

Cadet
Joined
May 9, 2012
Messages
8
Can i ask, is this issue still being looked at as even with the latest release i have a problem with 2 disks. I used the disks essentially as a test for FN 7 and and then when I had all the kit in place decided to use FN 8. The disks have a UFS mirror that GM reports as healthy with both disks active and no matter what i do i'm unable to import, destroy or otherwise clean the disks - I have tried the above and also tried to use GM to wipe . Whilst I can buy some more it does seem a little extravagant to bin 2 practically unused units.

Any comments or direction gratefully received.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
You can always boot a gparted live and run the dd commands there. Follow the directions on protosd's blog once you open a root shell in gparted live. The device names will be different.

If you insist on doing it from FreeNAS you can try from a root shell:
Code:
sysctl kern.geom.debugflags=0x10
dd if=/dev/zero of=/dev/ada1 bs=1m count=1
dd if=/dev/zero of=/dev/ada1 bs=1m oseek=`diskinfo ada1 | awk '{print int($3 / (1024*1024)) - 4;}'`
(dd commands from protosd's blog)

After which you have to reboot if I remember correctly.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
gmirror destory /mirror-name helps too. If you don't know the name of the mirror, you can do a gpart show I believe to see the "/mirror-name" part of the destroy command.

8.2 is/was supposed to include some GUI tool for wiping disks. I know they're working hard to get all of these types of features included and are a little behind schedule, but it's better late than buggy! ;)
 

Grauniad

Cadet
Joined
May 9, 2012
Messages
8
Thanks to both of you - I have indeed tried both those methods (trawled the forum and FAQ's so as not to be accused of not looking first:) ) which is why I finally tried the latest update as I heard that there was a tool for wiping - maybe i missed it ? The one time I actually WANT to be destructive i can't...

I shall wait then, unless someone else hears something.

Have a good weekend.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
@Grauniad - You could always reinstall FN 7 and delete the mirror there if that's easier for you. The gparted method will definitely work. Feel free to create and format a partition when you are in gparted as well.

@protosd - gmirror is much easier/superior.:) I'll have to try it out later to test removing one drive from my mirror.
 

Grauniad

Cadet
Joined
May 9, 2012
Messages
8
Hello, I ran gmirror deactivate -v ada0 and this said too few arguments but it appears to have worked:
[root@freenas] ~# gpart show
=> 63 7732305 ada1 MBR (3.7G)
63 1930257 1 freebsd [active] (943M)
1930320 63 - free - (32K)
1930383 1930257 2 freebsd (943M)
3860640 3024 3 freebsd (1.5M)
3863664 41328 4 freebsd (20M)
3904992 3827376 - free - (1.8G)

=> 0 1930257 ada1s1 BSD (943M)
0 16 - free - (8.0K)
16 1930241 1 !0 (943M)

=> 34 1953525101 ada0 GPT (932G)
34 94 - free - (47K)
128 4194304 1 freebsd-swap (2.0G)
4194432 1949330703 2 freebsd-zfs (930G)

=> 34 1953525101 ada2 GPT (932G)
34 94 - free - (47K)
128 4194304 1 freebsd-swap (2.0G)
4194432 1949330703 2 freebsd-zfs (930G)

So I now have a volume.

Weird but it works. thanks for the assistance everyone.
 
Status
Not open for further replies.
Top