HelpThatGuy
Cadet
- Joined
- Feb 7, 2014
- Messages
- 5
Big Fat Warning:
Known caveats:
Besides the uknown unknows , there are a few known knowns as well.
These are they:
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
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.
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)
Swap in your physical HDDs
Mark your sparse file device as offline, thus degrading the array
Make your new pool available to the GUI
Remove the unwanted files
Remount your system drive as read-only
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
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