Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Creating a degraded raidz via sparse files

Status
Not open for further replies.

HelpThatGuy

Neophyte
Joined
Feb 7, 2014
Messages
5
Big Fat Warning:

Doing this, as mentioned by cyberjock, is in no way supported by the FreeNAS staff. You are on your own. Period.

The only reason I feel safe doing this is because I have 2 additional levels of backups and this is for non-critical data in non-critical systems. If this all went to hell for me, I would simply be using it as an opportunity to learn and perhaps contribute to this community.

That being said, if I do find things go to hell, I'll be sure and post here. You can all read about my tale of "dang it" and a lucky few can enjoy a hearty "i warned you".


Known caveats:
Besides the uknown unknows , there are a few known knowns as well.
These are they:
  • Using the command line is not readily supported. Don't expect anyone but yourself to pick up the pieces.
  • Importing volumes created via the command line was only added some time during the 9.x series. If you aren't using the latest version I recommend verifying your version supports this feature.
  • Using a degraded array for anything more than repair seems inherently risky.

Primary Objective:

Create a degraded raidz2 pool with 3 physical disks.

Secondary Objective:

Ensure that when I add the 4th disk, or replace one of the original disks, I am not hobbled by slightly different available space from different HDD models.

Testing:

I always like to test these things out in a virtual machine first. If you stuff anything up all you loose is time. I recommend you do the same.

Guide:

Mount the system drive as read/write
# mount -uw /

Create sparse files for each of your disks. Make sure to allocate slightly less space than your HDDs have. This will provide you with a little bit of wiggle room when adding drives later on that happen to be slightly smaller.

# dd if=/dev/zero of=zfs1 bs=1 count=1 seek=39G
# dd if=/dev/zero of=zfs2 bs=1 count=1 seek=39G
# dd if=/dev/zero of=zfs3 bs=1 count=1 seek=39G
# dd if=/dev/zero of=zfs4 bs=1 count=1 seek=39G


Create the zpool directly from the disks (most other guides seem to add a step which creates a device from each file which is no longer necessary and I found problematic)
# zpool create tank raidz2 /zfs1 /zfs2 /zfs3 /zfs4

Swap in your physical HDDs

# zpool replace tank /zfs1 /dev/ada1
# zpool replace tank /zfs2 /dev/ada2
# zpool replace tank /zfs3 /dev/ada3


Mark your sparse file device as offline, thus degrading the array
# zpool offline tank /zfs4

Make your new pool available to the GUI
# zpool export tank

Remove the unwanted files

# rm /zfs1
# rm /zfs2
# rm /zfs3
# rm /zfs4


Remount your system drive as read-only
# mount -ur /

Finally, go into your GUI and auto-import the volume

Special thanks to:
http://forums.freenas.org/threads/q...rives-i-e-to-allow-migration.7748/#post-31106
http://blog.dest-unreach.be/2012/06/30/create-future-proof-zfs-pools
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
This should be deleted. Whole disk pool devices is not recommended in freenas. We've got guides like yours written by others that *should* work. But sometime it just doesn't work and the pool goes bye-bye suddenly.

In short, doing pools this was is a horrible idea. Doing deliberately degraded arrays is a recipe for failure based on feedback from others.


Sent from my DROID BIONIC using Tapatalk
 

HelpThatGuy

Neophyte
Joined
Feb 7, 2014
Messages
5
This should be deleted. Whole disk pool devices is not recommended in freenas. We've got guides like yours written by others that *should* work. But sometime it just doesn't work and the pool goes bye-bye suddenly.

In short, doing pools this was is a horrible idea. Doing deliberately degraded arrays is a recipe for failure based on feedback from others.


Sent from my DROID BIONIC using Tapatalk


That's alarming! Could you elaborate on the problems, and preferably link to the guides you allude to?
I spent some time searching for the information I mentioned above and didn't find anything like what you mentioned, so some detail here may help the next poor sole from doing something erroneous.
More than happy to edit the post later and add appropriate information.

- Thanks
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I can't elaborate on the problem. We've just seen it end badly and, to be frank, it's not worth my time to solve the problem(and the developers have chosen not to investigate it either because this isn't something you can do from the GUI, therefore it's NOT supported).

Sorry, the guides I've seen before may or may not be deeleted. And to be frank again, its not worth my time because of how stupidly irresponsible it is.

If someone wants detail to help the next poor soul.. here's what you need to know:

DON'T DO THIS!
 

HelpThatGuy

Neophyte
Joined
Feb 7, 2014
Messages
5
I can't elaborate on the problem. We've just seen it end badly and, to be frank, it's not worth my time to solve the problem(and the developers have chosen not to investigate it either because this isn't something you can do from the GUI, therefore it's NOT supported).

Sorry, the guides I've seen before may or may not be deeleted. And to be frank again, its not worth my time because of how stupidly irresponsible it is.

If someone wants detail to help the next poor soul.. here's what you need to know:

DON'T DO THIS!

I'm not looking to have you solve my whole issue, just some pointers in the right direction or some specificity in what is wrong. The only thing I've been able to gleen from your post is the "whole disk pools".

Just spit-balling, these are a list of things which could conceivably be wrong. If you could just pinpoint which of these items is the problem that would be great.

* FreeNAS gui (I believe) normally allocates a "swap" partition which the command lines I've listed above do not currently do.
* Older versions of FreeNAS did not properly replicate command line disk changes into the GUI. Something which was fixed in the more recent series of FreeNAS (I should put a warning about this in the post)
* Creating an array using a fake disk device is unlikley to be a standard use case, and as such "beware, dragons be here".
* After the fake disk is removed, you would be operating on a degraded array. Presumably this should be more risky than RaidZ1?
* Something else which I am not aware of

I appreciate that you are taking time out of your day to answer my questions, but as it stands there simply is not enough to go on. I have searched for FreeNAS and "whole disk devices" and the best I came up with was a bug in a very old version of FreeNAS which was marked as fixed, and without knowing anything more about where the purported problem is I'm not sure what to search for.

- Thanks
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
LOL.. Please read my quote that you quoted. We don't know what is broken. And to be blunt, we don't care either.

We have no clue what is wrong. Basically the people that lost their pools and complained get responses like "your own fault for doing what the manual doesn't tell you to do" and we walk away. We take the stance that if you do things by the manual and things break, then we have a problem. But if you start doing stuff from the CLI, you are totally on your own to support it. If you don't want to own your own problems, then you shouldn't be mucking around with the CLI. ;)

Good luck in whatever decision you make.

And twice now people have asked me to elaborate.. in this thread! I've already said twice now that we don't know and we don't care. There's no information to share.. PERIOD. We just don't give priority to people that do things that are inherently stupid to begin with. Don't like it, FreeNAS forums might not be for you.

I will delete this thread if I get more people asking for info. I have no info except "it's freakin' broken". This kind of thing is precisely why threads like this should be deleted(and why I said this should be deleted back at the beginning). There's nothing useful going to come of it because there's no info. People with the experience to figure out what went wrong wouldn't do things this way, and the people that don't have the experience shouldn't be doing it this way anyway.

I may still just delete this. There's no good going to come from this.
 

jgreco

Resident Grinch
Moderator
Joined
May 29, 2011
Messages
14,448
Could you please elaborate further? I'm sure you're willing to do my homework for me if I just ask a few more times..
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Could you please elaborate further? I'm sure you're willing to do my homework for me if I just ask a few more times..
LOL!
 

jgreco

Resident Grinch
Moderator
Joined
May 29, 2011
Messages
14,448
Oh come on, I'll flutter my eyelashes at you...!
 

HelpThatGuy

Neophyte
Joined
Feb 7, 2014
Messages
5
Clearly this has gotten off course. I'm not trying to have others do work on my behalf, but if your going to say "we've got guides that should work", but I cant find them and you cant point to them, then what was the point in mentioning it? If the response is simply "things don't work" without any further specificity its not terribly helpful either.
The most useful part of this dialog from my point of view is "if you do things on the command line and not via the GUI then you are on your own". Obvious, but worth noting.

From all the searching I've done and from the FreeNAS bug tracker, I can only conclude that someone/some people once had a bad experience with ZFS and the command line - and I might have the same problem. Fair enough, its not like FreeNAS charged me for the privilege. I'm quite impressed with the quality I've seen so far and no software is perfect.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Clearly this has gotten off course. I'm not trying to have others do work on my behalf, but if your going to say "we've got guides that should work", but I cant find them and you cant point to them, then what was the point in mentioning it? If the response is simply "things don't work" without any further specificity its not terribly helpful either.

And that's why I distilled it down to a single sentence above...

If someone wants detail to help the next poor soul.. here's what you need to know:

DON'T DO THIS!

That sums up our entire known knowledge on the subject.

Now you see my dilemma with deleting stuff. I hate deleting stuff because I don't feel it's my job,my duty, or acceptable to silence people, even if I disagree with you, your opinions, or your "facts". Deleting things that have zero value is a different thing though.
 

HelpThatGuy

Neophyte
Joined
Feb 7, 2014
Messages
5
I'm not sure how to say this with the correct tone, but I did want to respond with an honest thank you for this response.
It has helped deescalate what was becoming something of an internet flame war (thank you jgreco for your constructive contributions).

I will edit the above post and add some appropriate warnings. Additionally, if I find anything goes horribly wrong it will provide a good place to post a message on lessons learnt.
It may also be worth you posting a similar warning to the (very old, but eminently googleable) forum post I linked to above. I know I'm not the first to use it as a jumping point.
 

jgreco

Resident Grinch
Moderator
Joined
May 29, 2011
Messages
14,448
thank you jgreco for your constructive contributions

No problem! cyberjock should know by now not to hang "kick me" signs on himself... "I will delete this thread if I get more people asking for info." Really....
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Hey, I'll delete it and not even feel guilty about it. I'm done playing around with this stupid idea of sparse files.
 

syadnom

Newbie
Joined
Mar 6, 2014
Messages
3
just out of curiosity, why would you want to create a degraded array anyway? This is a serious question... I have created degraded arrays specifically for migrations, but differently.

Recently, I did a migration from a storage spaces 'raid1' do a zfs pool but required use of the same disks.
9 disks ( 8 active + spare (plus cold spare)). I pulled both spares and 3 disks out and put them in the zfs box (not freenas). Then I built LARGER sparse files than my disks and created my raidz2 with 5 disks plus 3 sparse files. I failed and removed the sparse files, then copied the contents of the storage spaces box to the degraded array. Once the copy completed, I took the storage spaces pool offline and pulled that final redundant drive and moved it to zfs, put it in the pool, and let the pool rebuild. Then I moved all remaining disks over and imported them.

Because I had at least one drive at the native size, the sparse files could be bigger because the pool would have members of the minimum size.

This is a very one-off situation, but it did work and after the process was complete, I had a 100% proper zfs pool that any zfs system can recognize without issue.

My only other note here is that my objective was to create a completed zfs pool and NOT leave it in a degraded state. I don't know why one might want a degraded pool for anything other than a one-off migration and even then temporarily.
 
Status
Not open for further replies.
Top