Can't create a disk volume on reused hard drives (FreeNAS 8.0.4)

Discussion in 'Storage' started by Chris Cantwell, Apr 3, 2012.

  1. Chris Cantwell New Member

    Member Since:
    Apr 3, 2012
    Message Count:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Chattanooga, Tennessee, United States
    Chris Cantwell, Apr 3, 2012

    I have two SATA hard drives that had a FreeBSD 8.1 installation on them (UFS, geom mirror), and I wanted to reuse them for FreeNAS. On my system, the CF reader, the DVD drive and the two hard drives are installed on separate SATA ports.

    I downloaded and installed FreeNAS 8.0.4 on a 4GB CF card. I successfully accessed the FreeNAS web GUI from another computer on my network. I then tried to create a ZFS mirrored disk volume using the two SATA hard drives using the volume name "test". At first it looked like it worked, and the volume was displayed on the left side under "Volumes" as /mnt/test, but the volume was not displayed on the right side, and an error message on the top menu bar said "An error occurred!" I tried creating different ZFS volume configurations, and different UFS volume configuration, with identical results. I then connected a blank hard drive to the system, and was able to create a ZFS volume right away with no errors.

    It appears that FreeNAS will not erase an existing FreeBSD UFS configuration when creating a new disk volume. Has anyone else seen this error? I imagine it would work if I erased the disk first, but I shouldn't have to do that.

    Thanks,
    Chris
  2. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Apr 3, 2012

    Hi Chris,

    Yes, this has been a problem plaguing users for awhile. I opened another ticket for it the other night, for now you need to wipe your disks from the command line. There's a link in my tutorial below, and actually the official docs have a section about it *somewhere*.

    http://protosd.blogspot.com/2011/12/useful-commands-for-diagnosingmanaging.html

    Look for the section on Wiping Disks, the list of sections at the top of the page is clickable and will take you directly to the section.
  3. jenksdrummer New Member

    Member Since:
    Jun 7, 2011
    Message Count:
    35
    Likes Received:
    0
    Trophy Points:
    0
    jenksdrummer, Apr 4, 2012

    note which disk it is...if you get it wrong, you could destroy your data.

    I did the same thing last night to clean out partition info on my disks...

    from a root shell, get to the /dev directory.

    ls - note your disks...make sure you see it listed. Mine, for example:

    ada0
    ada0p2
    ada1
    ada2
    ada2p2
    ada3
    ada3p2


    Something like that - lol...

    I did the following:

    dd if=zero of=ada0 bs=1G

    Let that run for about 10 minutes...then just did a control-c to kill it.

    Rebooted and then ada0 was all that was listed. Wiped out all the partition information and zeroed around 18G worth of the disk by the time I was done. Repeated on the other 3 disks, and they were effectively clean disks again.
  4. sudleyplace New Member

    Member Since:
    Apr 25, 2012
    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    0
    sudleyplace, Apr 25, 2012

    I, too, have two previously formatted 500GB disks (from 0.7.??? as Software RAID, although I never got the RAID up and running).
    From /dev I tried

    dd if=zero of=ada1 bs=1g

    to which 8.0.4 replied

    dd: ada1: Operation not permitted

    I'm trying to create a RAID1 on these two disks, but the Create Volume UI (RAID, ada1 & ada2, UFS, mirror) succinctly replies with "Error occurred!". I thought that by wiping the disks (there's no data on them) I could get Create Volume to work. No luck.

    I also tried Import Volume on each disk (e.g., RAIDada1, ada1, UFS) to which it replied "The selected disks were not verified for this import rules."

    Any help would be greatly appreciated.
  5. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Apr 25, 2012

    The info is in the FAQ for wiping disks.... of=/dev/ada1 Links are in signature below.....
  6. sudleyplace New Member

    Member Since:
    Apr 25, 2012
    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    0
    sudleyplace, Apr 25, 2012

    1. If you mean question 20 in http://protosd.blogspot.com/2011/12/protosds-unofficial-freenas-8-faq.html, then I'm puzzled.

    That's what I'm doing and am still getting "Operation not permitted". I wrote in my message that from the /dev directory I was typing, dd if=zero of=ada1 bs=1g count=1, but in case it made a difference, I just tried dd if=/dev/zero of=/dev/ada1 bs=1g count=1 and still got "Operation not permitted". I also tried the second command you mention

    dd if=/dev/zero of=/dev/ada1 bs=1m oseek=`diskinfo ada1 | awk '{print int($3 / (1024*1024)) - 4;}'`

    and got the same response: "Operation not permitted".

    BTW, the diskinfo arg in your answer to Q20 is ada0 -- I assume you meant ada1.

    2. One more piece of info: I just noticed that when FreeNAS shuts down it says (in bold) something like

    GEOM_MIRROR: Device WDCRAID: provider mirror/WDCRAID destroyed.
    GEOM_MIRROR: Device WDCRAID destroyed.

    Now WDCRAID is the old name for the Software RAID I was trying to create under 0.7.???. I found it in /dev/mirror/WDCRAID and /dev/mirror/WDCRAIDs1. I tried to move those files to another directory but was told I couldn't as this was a "Read-only file system". Is there a way to zap those files (or make them work)?

    3. Is there an equivalent set of shell commands that emulates what "Create Volume" does so I can try them individually from the shell and see where the error occurs and what it says?

    4. I took out the two disks from the FreeNAS machine and put them into a Windows machine, and initialized each (I think it just wrote an MBR), partitioned without formatting, and then put them back into the FreeNAS machine with no change in behavior from "Create Volume" or the above dd commands. I can format them under Windows as NTFS, which I'll try as long as I can reformat them as UFS (or ZFS) for mirroring later on under FreeNAS. Is that feasible?

    Many thanks for your help!
  7. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Apr 25, 2012

    Thanks for catching that typo in the FAQ, it's fixed now!

    How are you getting to the command prompt to run the commands, from the console or Putty?

    You're already trying some of them, the "operation not permitted" is a pretty good clue to why the GUI is failing.

    Can you post the output of "gpart show" and "glabel status" without the quotes?



    If you do a complete format, not the quick format, that should work without any problems reformatting them to UFS/ZFS later.

    If you can answer the questions above, doing it without Windows should go much faster once we discover what the issue is.
  8. sudleyplace New Member

    Member Since:
    Apr 25, 2012
    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    0
    sudleyplace, Apr 25, 2012

    Was using the console, choosing option 9 (Shell). Now I'm using Putty.

    Code (text):
    1. admin@freenas-> gpart show
    2. =>     63  8204175  da0  MBR  (3.9G)
    3.        63  1930257    1  freebsd  [active]  (943M)
    4.   1930320       63       - free -  (32K)
    5.   1930383  1930257    2  freebsd  (943M)
    6.   3860640     3024    3  freebsd  (1.5M)
    7.   3863664    41328    4  freebsd  (20M)
    8.   3904992  4299246       - free -  (2.1G)
    9.  
    10. =>       34  976773101  ada0  GPT  (466G)
    11.          34  976773101     1  freebsd-ufs  (466G)
    12.  
    13. =>      0  1930257  da0s1  BSD  (943M)
    14.         0       16         - free -  (8.0K)
    15.        16  1930241      1  !0  (943M)
    16.  
    17. =>       63  976773042  mirror/WDCRAID  MBR  (466G)
    18.          63  976768002               1  !6  (466G)
    19.   976768065       5040                  - free -  (2.5M)
    20.  
    21. admin@freenas-> glabel status
    22.           Name  Status  Components
    23.  ufs/FreeNASs3     N/A  da0s3
    24.  ufs/FreeNASs4     N/A  da0s4
    25.      ufs/Disk1     N/A  ada0p1
    26. ufs/FreeNASs1a     N/A  da0s1a
    I'll wait on that.
  9. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Apr 25, 2012

    I think you need to do "gmirror clear WDCRAID" or "gmirror remove WDCRAID" from the command line. I'm not up on the gmirror stuff, but I think it's something along those commands.


    EDIT: Here's a link on the gmirror command:

    http://man.cx/gmirror(8)
  10. sudleyplace New Member

    Member Since:
    Apr 25, 2012
    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    0
    sudleyplace, Apr 25, 2012

    The commands are
    Code (text):
    1. gmirror remove -v WDCRAID /dev/ada1
    amd
    Code (text):
    1. gmirror remove -v WDCRAID /dev/ada2
    And that worked! It allowed me to go back to "Create Volume" and create (WDCRAID, ada1, ada2, ufs, mirror) the mirror drives, and then share them via CIFS.

    Well done! Nice job on a tough problem.
  11. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, Apr 25, 2012

    Glad I could help, thanks for reporting back on your success!
  12. jason00084 New Member

    Member Since:
    Aug 10, 2012
    Message Count:
    1
    Likes Received:
    0
    Trophy Points:
    0
    jason00084, Aug 10, 2012

    YES YES YES! Thank you!
  13. dw235 New Member

    Member Since:
    Nov 13, 2013
    Message Count:
    1
    Likes Received:
    0
    Trophy Points:
    1
    dw235, Nov 14, 2013

    Also wanted to thank you and add that I had a similar issue with old raid settings being associated with an old server setup. In my case, before I could create a volume, I had to use:

    Code (text):
    1. graid remove -v RAIDNAME /dev/ada1
    2. graid remove -v RAIDNAME /dev/ada2
    This thread was very helpful to this server newbie.

Share This Page