SOLVED Is it possible to change RAID configuration

metalhusky

Dabbler
Joined
Oct 7, 2019
Messages
14
Hi,

so I am a newbie when it comes to NAS and RAID,

I tried searching, but I couldn't find much.

So, when building my machine people told me to just do it in RAID 1, that way my files will be safe and it makes sense, so I did it, and I knew that out of 2 x 4TB HDDs I'll be able to use only 3,8TB or so, I was fine with that, now I'm kind of regretting it because I am at 82% used already,



so I would like to know if it is possible to "unraid" (haha), my HDDs, so that 1 still has all my data on it, and the other one acts just as a second storage HDD.



I don't want the data to be striped btw, just use it as 2 standalone HDDs.

The data on those HDDs is not terribly important, its mainly just movies, music, and games from GOG, so, if, IF, a drive fails... I mean whatever. Not a biggie.

My System is a pretty standard one:

Asus J4105
2 x 4TB WD Red
120 GB SSD with FreeNAS on it
8GB RAM


Thanks





EDIT: SOLUTION


thanks to sretalla
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
You can remove one of the disks from a mirror to leave yourself with a single-disk pool.

The way to do that is from the Storage, Pools, (configuration/cog icon), status. Then the ... for the disk to remove and select detach.
 

metalhusky

Dabbler
Joined
Oct 7, 2019
Messages
14
You can remove one of the disks from a mirror to leave yourself with a single-disk pool.

The way to do that is from the Storage, Pools, (configuration/cog icon), status. Then the ... for the disk to remove and select detach.
ok, i detached one of the discs, and got an alert :

Pool myNASstorage state is DEGRADED: One or more devices has been taken offline by the administrator. Sufficient replicas exist for the pool to continue functioning in a degraded state.
Wed, 18 Mar 2020 19:05:17 GMT

Then i went to pools and now there is an option to wipe, on the one that is detached, should i do it and then how do i add it back just as storage?
And also, should i just leave the one that is attached like that? In the "degraded" state?

firefox_ddbwpIQH8J.png firefox_IMy68K4KZb.png
 

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
I am very interested in this thread. My 4 disk setup of a pair of mirrors has been working well, until recently the pool was flagged as degraded. I was able to identify the bad disk, and removed it. I am ordering a replacement drive, and have a complete backup of everything on a different device.

Surprisingly, the pool now appears as healthy, even though 1 of the mirrors incomplete. How can removing the bad disk, with no replacement make the Raidz2 setup healthy ? It now shows the pool as 2 mirred vdevs..I have 75% of the original setup ... I am missing something here ...
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Pool myNASstorage state is DEGRADED
OK, so let's look into what's going on... can you go to the CLI and show us the output from zpool status -v ?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
even though 1 of the mirrors incomplete. How can removing the bad disk, with no replacement make the Raidz2 setup healthy ? It now shows the pool as 2 mirred vdevs
Just to be clear, you don't appear to have RAIDZ2 at all from what you have said. If you can also share your zpool status -v output, we can dig into it.
 

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
Just to be clear, you don't appear to have RAIDZ2 at all from what you have said. If you can also share your zpool status -v output, we can dig into it.
Sure - thx
View attachment 36663
Originally it was set up with 4 drives, of 2 mirrors. Now I have 3 drives and 1 mirror.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
View attachment 36663
I can't get to that... can you try another way? best is if you can use ssh or putty from your computer and copy/paste directly from the text into code tags in the forum.
 

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
1584622361111.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
Better, now I can see.

This is exactly as you described, 2 mirrors, 1 mirror with 2 disks (mirror-1) striped with a single disk.

This is a valid setup if it was intentionally like this (although I agree it's not a setup that anyone really wants).

So what to do?

If you have a new disk inserted, you will need to partition it manually and then manually attach it to the single disk to get back to a pair of mirrors. Let's assume the new disk is ada3 and is already blank/wiped (if not, gpart destroy -F /dev/ada3)...

gpart create -s gpt /dev/ada3

Then we create the swap and data partitions:

gpart add -s 2G -t freebsd-swap /dev/ada3

gpart add -t freebsd-zfs /dev/ada3

now we will find the gptid of the data partition

gpart list

You will get some kind of output like this:
Code:
Geom name: ada3
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 67108823
first: 40
entries: 128
scheme: GPT
Providers:
1. Name: ada3p1
   Mediasize: 2147483648 (2.0G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 20480
   Mode: r1w1e1
   efimedia: HD(1,GPT,1491bc93-69c9-11ea-b524-5d55812e7307,0x28,0x400000)
   rawuuid: 1491bc93-69c9-11ea-b524-5d55812e7307
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2147483648
   offset: 20480
   type: freebsd-swap
   index: 1
   end: 4194343
   start: 40
2. Name: ada3p2
   Mediasize: 32212213760 (30G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 2147504128
   Mode: r1w1e2
   efimedia: HD(2,GPT,1b28c891-69c9-11ea-b524-5d55812e7307,0x400028,0x3bfffb0)
   rawuuid: 1b28c891-69c9-11ea-b524-5d55812e7307
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 32212213760
   offset: 2147504128
   type: freebsd-zfs
   index: 2
   end: 67108823
   start: 4194344
Consumers:
1. Name: ada3
   Mediasize: 34359738368 (32G)
   Sectorsize: 512
   Mode: r2w2e5


What you're looking for is the rawuuid of the data partition (so in the section for ada3p2): 1b28c891-69c9-11ea-b524-5d55812e7307 in this example

Then use that in the command to attach the new one to the existing lonely disk:
zpool attach <poolname> gptid/<gptid from zpool status of lonely disk> gptid/<rawuuid of data partition from gpart list>

zpool status -v to show it's all good.

I saw an issue with the ashift property when doing it on my test setup and needed to use -o ashift=9, but I don't think you will see this with real disks
 
Last edited:

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
BRILLIANT !!! Thank you so much for this -- you saved me some real heartache ! The data is resilvering now...

1584629329707.png
 
Last edited:

tfran1990

Patron
Joined
Oct 18, 2017
Messages
293
In what application would you want to do this?
Also kappclark, how did you do this?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
In what application would you want to do this?
Also kappclark, how did you do this?
Either in the Shell option in the GUI or in an SSH client (depends on what Operating System you're using... for Windows, Putty is the option most people use, in macOS, ssh is part of the terminal, just type ssh root@freenas.local ).
 

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
In what application would you want to do this?
Also kappclark, how did you do this?
I did it in the shell of the FreeNas GUI ... could not have done this w/o the excellent guidance provided by sretalla..
 

tfran1990

Patron
Joined
Oct 18, 2017
Messages
293
i ment like how did you do the accident.
selected mirror drop down accidentally checked the box when building the pool?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
@metalhusky Still waiting for you to post your zpool status -v to continue helping you get to the original requested situation.
 

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
The drive itself failed - seagate Barracuda ... upgrading to 11.3 then shutting down and starting up, the second disk of the first mirror bacame MIA, hence the warning of a degraded pool...had a spare drive which is what I used to replace failed drive...made sure I had current backup of data, then went ahead with repair...
 

metalhusky

Dabbler
Joined
Oct 7, 2019
Messages
14
@metalhusky Still waiting for you to post your zpool status -v to continue helping you get to the original requested situation.
Hi,
sorry, I can't reply that fast, I work in the medical sector here, we have more important things to teal with right now then my private NAS server. So might take some time for me to write back.

But here firefox_5oVRaD9dDU.png firefox_MfLyrR8Vp6.png

It only says "Degraded" when one of the Discs is detached.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
OK, so it looks to me like the disk was not detached and we still have a mirror. If you follow the steps in the GUI, as we covered at the top, and this time offline the disk first, then detach it.

If that's not getting us the result, we'll go to the command line.

Also to confirm, when you say detach, we're talking about in the GUI, not actually detaching it from the hardware perspective.
 

metalhusky

Dabbler
Joined
Oct 7, 2019
Messages
14
OK, so it looks to me like the disk was not detached and we still have a mirror. If you follow the steps in the GUI, as we covered at the top, and this time offline the disk first, then detach it.

If that's not getting us the result, we'll go to the command line.

Also to confirm, when you say detach, we're talking about in the GUI, not actually detaching it from the hardware perspective.


ok, here, i don't know what else i even can do here.

looks like this dude here has something similar
 
Top