Tried to change drive from UFS to ZFS, now can't Create Volume

Status
Not open for further replies.

freshfeesh

Explorer
Joined
Oct 10, 2011
Messages
72
Still in the playing around stage with my new NAS box using old hardware. I had 3 drives installed, all formatted as UFS volumes. For testing purposes, I wanted to get rid of all the UFS volumes, then turn one of the drives into a ZFS volume. I'm at what I'd call a power user level of Windows ability, but all the unix nomenclature for things is Greek to me. The only thing I see that resembles deleting a volume (icon with a big red X on it) is called export, so I did that to all three volumes. I get appropriate warnings about loosing my data, so I think that they're getting wiped clean. I didn't check the box for "mark disk as new", because I thought the next step was going to overwrite everything anyway. Now, though, I can't create either a new UFS or ZFS volume. When I go into the create volume window, I see all the disks with open check boxes next to them. But when I try create a new volume from one of the disks, I get a message that flashes at the top of the GUI saying "Error: [MiddlewareError: Unable to GPT format the disk "ada3"]", and the console readout at the bottom says "[a bunch of stuff, then...] operation not permitted". This happens the same for trying to create UFS or ZFS partitions, and for all three disks. I wasn't able to make anything happen with either Import volume or Auto Import volume. What do I do now?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
This falls under the "I just found a bug" category. The workaround involves wiping the disks from the command prompt at the console (#9 on the menu). Here is the section of the FAQ (#20) that talks about wiping your disks. You'll need to write down the device names for the disks you see in the GUI, such as 'ada3', and then do a 'gpart show ada3' (change the ada3 for your disk names). The big long number on the first line is the number you'll want to use for sectors. Take ~10 off that number just to be safe and do the 'dd' commands, changing the 'ada1' in those commands with the name of each of your disks, you'll have to do this for all three. After you do that, give the GUI a try again, and your post will get moved to the 'bug reporting' section after you post back your results.

With GPT partitioning scheme, the partition table is stored at the beginning (primary) and end (backup) of the disk. So if you don't zero out the WHOLE disk, the backup GPT table gets loaded.

To fix the above problem you have to do both of these commands and replace ada1 with your disk/device name:

dd if=/dev/zero of=/dev/ada1 bs=512 count=2
dd if=/dev/zero of=/dev/ada1 bs=512 skip=sectors

Sectors = the length of your disk reported by fdisk (usually the big long number), minus 1 or 2.
 

freshfeesh

Explorer
Joined
Oct 10, 2011
Messages
72
Between posting and seeing your response, I did the old restart trick. I was then able to successfully make a volume out of each one of the disks. After exporting each of those I get a repeat of the above when trying to create volumes again. So it looks like the quick work around is a restart. This still looks like a bug to me, so I'll still try your CLI operations above to get the results for the bug report. It will likely be a couple days before I get to that.

Thanks.
 

freshfeesh

Explorer
Joined
Oct 10, 2011
Messages
72
OK, beginning with a state like I first described where I'm not able to import or create volumes, I successfully executed the first part using "gpart show" to get the big number on the first line for each of the three disks. In response to the first "dd" command, I got "dd /dev/ada0: Operation not permitted". I repeated this for the remaining two disks with the same results. I then tried the second dd command on ada0 (using 10 less than the big number), and again got "not permitted".

After a restart, a repeated my prior success with creating a volume, using ada0. I then tried the command line sequence with ada1. Gpart show gave me the same answer as last time. The first dd command gave a new error: "unknown operand if/dev/zero". I did type in the whole command "dd if/dev/zero of=/dev/ada1 bs=512 count=2". I got the same message after the second dd command.

It could very well be that I'm doing something wrong. To this point I've only interacted with the GUI, and have virtually no experience with command line interfaces. Is there anything else that would be useful for bug reporting purposes to try? For my part, I'm OK with just doing restarts and moving on.

Thanks
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
dd if/dev/zero
unknown operand if/dev/zero

dd if/dev/zero of=/dev/ada1 bs=512 count=2

You missed the '=' after the 'if', that's why you were getting the errors.

I think there's enough info to reproduce the problem.

I didn't check the box for "mark disk as new"
You should have checked the box to wipe the disks, maybe something can be done to clarify the process so other people don't misunderstand also.
 

freshfeesh

Explorer
Joined
Oct 10, 2011
Messages
72
I retraced my steps. After getting back to the error state, and being sure to include "=" after"if", I get the same results that I reported above that occurred before the restart -- "Operation not permitted". It looks like I copied the command correctly that round. Post restart, when the GUI is successful anyway, using the correct syntax gives '2+0 records in' , '2+0 records out' , 1024 bytes transferred in *** sec...' after the first dd command, and after the second dd command I waited 15 minutes without getting the prompt, and "create volume" from the GUI gave an error until after restart, at which point it created a volume without trouble.

I don't expect the documentation to be all there and I expect to have to muddle through to get this project done, but when the team gets around to it, it would be great to have general documentation that considers power Windows users. I've built my pcs for the last 6 years, swapped out a bunch of parts, and have done a lot of mucking around in general, but I still have no idea what 'import' and 'export' mean relative to disks. A few google searches didn't turn up relevant results (oddly), and I didn't see anything in the online html documentation. The FreeBSD handbook didn't yield an answer readily either.

Re: the check box -- it does prevent me from having to restart to create a new volume on the disk. Note that without checking the box, I'm unable "import" or "auto import", which I would expect to be able to do after a basic "export", just based and the normal definition of those words. The only things that I'm able to do after exporting without the box checked is restart and create a new volume, or impaort the larger of the two volumes that freenas creates automatically on the disk.
 
Status
Not open for further replies.
Top