Unable to create volume

Discussion in 'Bug Reporting' started by EvilGenius, Sep 1, 2011.

  1. Offline

    EvilGenius

    Member Since:
    Jul 25, 2011
    Messages:
    9
    Message Count:
    9
    Likes Received:
    0
    Trophy Points:
    0
    EvilGenius, Sep 1, 2011

    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 (text):
    1.  
    2. ada0 at ata2 bus 0 scbus0 target 0 lun 0
    3. ada0: <WDC WD20EARS-00MVWB0 51.0AB51> ATA-8 SATA 2.x device
    4. ada0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
    5. ada0: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
    6. da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
    7. da0: <Mass Storage Device \\001\\000\\000?> Removable Direct Access SCSI-0 device
    8. da0: 40.000MB/s transfers
    9. da0: 3826MB (7837695 512 byte sectors: 255H 63S/T 487C)
    10. ada1 at ata3 bus 0 scbus1 target 0 lun 0
    11. ada1: <WDC WD20EARS-00MVWB0 51.0AB51> ATA-8 SATA 2.x device
    12. ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
    13. ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
    14. GEOM: da0s1: geometry does not match label (16h,63s != 255h,63s).
    15. GEOM: ada0: the secondary GPT table is corrupt or invalid.
    16. GEOM: ada0: using the primary only -- recovery suggested.
    17. GEOM: ada1: the secondary GPT table is corrupt or invalid.
    18. GEOM: ada1: using the primary only -- recovery suggested.
    19. GEOM_MIRROR: Device mirror/mirror0 launched (2/2).
    20. GEOM: mirror/mirror0: corrupt or invalid GPT detected.
    21. GEOM: mirror/mirror0: GPT rejected -- may not be recoverable.
    22.  
    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 (text):
    1.  
    2. Error: [MiddlewareError: Volume creation failed: "geom: Can't store metadata on dev/ada0: Operation not permitted., "]
    3.  
    After doing the debugflags trick, it works and it does so even after a reboot.
  2. Offline

    William Grzybowski FreeNAS Guru

    Member Since:
    May 27, 2011
    Messages:
    1,665
    Message Count:
    1,665
    Likes Received:
    23
    Trophy Points:
    38
    Location:
    Curitiba, Brazil
    William Grzybowski, Sep 1, 2011

    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
  3. Offline

    EvilGenius

    Member Since:
    Jul 25, 2011
    Messages:
    9
    Message Count:
    9
    Likes Received:
    0
    Trophy Points:
    0
    EvilGenius, Sep 1, 2011

    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).
  4. Offline

    gabrielBlack

    Member Since:
    Sep 4, 2011
    Messages:
    2
    Message Count:
    2
    Likes Received:
    0
    Trophy Points:
    0
    gabrielBlack, Sep 4, 2011

    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!
  5. Offline

    EvilGenius

    Member Since:
    Jul 25, 2011
    Messages:
    9
    Message Count:
    9
    Likes Received:
    0
    Trophy Points:
    0
    EvilGenius, Sep 4, 2011

    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.
  6. Offline

    gabrielBlack

    Member Since:
    Sep 4, 2011
    Messages:
    2
    Message Count:
    2
    Likes Received:
    0
    Trophy Points:
    0
    gabrielBlack, Sep 5, 2011

    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 !
  7. Offline

    Adub

    Member Since:
    Nov 7, 2011
    Messages:
    7
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Adub, Nov 7, 2011

    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:
    Edit2: It looks like this ticket may be related https://support.freenas.org/ticket/793 along with 794 possibly.
  8. Offline

    Adub

    Member Since:
    Nov 7, 2011
    Messages:
    7
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Adub, Nov 13, 2011

    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.
  9. Offline

    rnicolas Newbie

    Member Since:
    Sep 20, 2011
    Messages:
    51
    Message Count:
    51
    Likes Received:
    0
    Trophy Points:
    6
    rnicolas, Nov 17, 2011

    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.
  10. Offline

    Adub

    Member Since:
    Nov 7, 2011
    Messages:
    7
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Adub, Nov 18, 2011

    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
  11. Offline

    rnicolas Newbie

    Member Since:
    Sep 20, 2011
    Messages:
    51
    Message Count:
    51
    Likes Received:
    0
    Trophy Points:
    6
    rnicolas, Nov 18, 2011

    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
  12. Offline

    Adub

    Member Since:
    Nov 7, 2011
    Messages:
    7
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Adub, Nov 18, 2011

    I don't understand why running zeros on the disk with dd won't work, when formatting in another machine does?
  13. Offline

    Grauniad

    Member Since:
    May 9, 2012
    Messages:
    8
    Message Count:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Guildford Surrey
    Grauniad, May 11, 2012

    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.
  14. Offline

    paleoN FreeNAS Guru

    Member Since:
    Apr 22, 2012
    Messages:
    1,403
    Message Count:
    1,403
    Likes Received:
    15
    Trophy Points:
    38
    paleoN, May 11, 2012

    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 (text):
    1. sysctl kern.geom.debugflags=0x10
    2. dd if=/dev/zero of=/dev/ada1 bs=1m count=1
    3. dd if=/dev/zero of=/dev/ada1 bs=1m oseek=`diskinfo ada1 | awk '{print int($3 / (1024*1024)) - 4;}'`
    4.  
    (dd commands from protosd's blog)

    After which you have to reboot if I remember correctly.
  15. Offline

    ProtoSD FreeNAS Guru

    Member Since:
    Jul 1, 2011
    Messages:
    3,358
    Message Count:
    3,358
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, May 11, 2012

    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! ;)
  16. Offline

    Grauniad

    Member Since:
    May 9, 2012
    Messages:
    8
    Message Count:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Guildford Surrey
    Grauniad, May 11, 2012

    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.
  17. Offline

    paleoN FreeNAS Guru

    Member Since:
    Apr 22, 2012
    Messages:
    1,403
    Message Count:
    1,403
    Likes Received:
    15
    Trophy Points:
    38
    paleoN, May 11, 2012

    @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.
  18. Offline

    Grauniad

    Member Since:
    May 9, 2012
    Messages:
    8
    Message Count:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Guildford Surrey
    Grauniad, May 12, 2012

    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.

Share This Page