This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

How to replace an HDD by another one in ZFS ?

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

Hello,

In ZFS I don't found how to replace an HDD by another one for increasing global capacity by changing all HDD one by one, and also if an HDD doesn't work well.

Thanks

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

Nobody know please ?

Thanks

BeNooL
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by BeNooL »

You have the options under Disks|ZFS|Pools|Tools. The command is replace.

If I'm not mistaken and if you dedicate the whole drive to ZFS, you simply replace all drives with larger ones (repeat for each disk if in an array) and then the additional space will become available.

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

BeNooL wrote:If I'm not mistaken and if you dedicate the whole drive to ZFS, you simply replace all drives with larger ones (repeat for each disk if in an array) and then the additional space will become available.
Thanks BeeNooL

That's I was thinking because I don't found any menu to replace a disk.

I will search the menu replace in Disks|ZFS|Pools|Tools.

Thanks you :D

kenZ71
Advanced User
Advanced User
Posts: 379
Joined: 27 Jun 2012 20:18
Location: Northeast, USA
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by kenZ71 »

CorbeilleNews wrote:
BeNooL wrote:If I'm not mistaken and if you dedicate the whole drive to ZFS, you simply replace all drives with larger ones (repeat for each disk if in an array) and then the additional space will become available.
Thanks BeeNooL

That's I was thinking because I don't found any menu to replace a disk.

I will search the menu replace in Disks|ZFS|Pools|Tools.

Thanks you :D
Yup, that's all you need to do. Ridiculously easy.
11.2-RELEASE-p3 | ZFS Mirror - 2 x 8TB WD Red | 28GB ECC Ram
HP ML10v2 x64-embedded on Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz

Extra memory so I can host a couple VMs
1) Unifi Controller on Ubuntu
2) Librenms on Ubuntu

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

Yes, I don't saw it because the menu were not that I tought. Now It's ok, thanks you so much, I can start the NAS now !!! :)

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

Is anyone can explain me the method to replace a disk because this method doesn't function (perhaps it is not the good method) :

I wanted to use the replace command in the tools menu but I think that before I have to add the new HDD by choising the attach command : if I don't do this it looks not possible to replace the old disk by the new one.

So, I try to attach the new HDD with the attach command but when I validate nothing happen even after waiting an hour (all diks are empty) : I can only see the line :

Résult of the command:
attach...

What can I do ?

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by raulfg3 »

basically, you need to replace one disk by big disk, do a scrub to recostruct data, chaeck that your pool is online and not degraded, continue to next disk.

When all disk are changed in the last scrub, the size of pool are expanded automatic. ( if option autoexpand is set to on) <- is set to on by default.
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

raulfg3 wrote:basically, you need to replace one disk by big disk, do a scrub to recostruct data, chaeck that your pool is online and not degraded, continue to next disk.

When all disk are changed in the last scrub, the size of pool are expanded automatic. ( if option autoexpand is set to on) <- is set to on by default.
I tried this for the first disk but after the first scrub (HDD Led Light Off and no more informations in the command line in the GUI) (hard disk runs during several minutes because I just have 15 GB of data to try how to do) the pool is still degraded and even after rebooting the system.

What can I do ?

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by raulfg3 »

go to Disks|ZFS|Pools|Information and post your pool information, mine is:

Code: Select all

pool: NAS-A
 state: ONLINE
 scan: scrub repaired 0 in 18h57m with 0 errors on Mon Jun 11 09:45:17 2012
config:

	NAME        STATE     READ WRITE CKSUM
	NAS-A       ONLINE       0     0     0
	  raidz1-0  ONLINE       0     0     0
	    ada1    ONLINE       0     0     0
	    ada2    ONLINE       0     0     0
	    ada3    ONLINE       0     0     0
	    ada4    ONLINE       0     0     0
	    ada5    ONLINE       0     0     0

errors: No known data errors

  pool: NAS-B
 state: ONLINE
 scan: scrub repaired 0 in 4h1m with 0 errors on Tue Apr 24 02:47:20 2012
config:

	NAME        STATE     READ WRITE CKSUM
	NAS-B       ONLINE       0     0     0
	  raidz1-0  ONLINE       0     0     0
	    da0     ONLINE       0     0     0
	    da1     ONLINE       0     0     0
	    da2     ONLINE       0     0     0
	    da3     ONLINE       0     0     0
	    da4     ONLINE       0     0     0
	    da5     ONLINE       0     0     0

errors: No known data errors
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

sleid
PowerUser
PowerUser
Posts: 774
Joined: 23 Jun 2012 07:36
Location: FRANCE LIMOUSIN CORREZE
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by sleid »

Hi,

Normally the disk out of service must be taken offline and replaced, the new drive must be online, then possibly a scrub but reconstruction must be done alone.
With 3 terabytes of data it takes 15 hours ....
12.1.0.4 - Ingva (revision 7852)
FreeBSD 12.1-RELEASE-p12 #0 r368465M: Tue Dec 8 23:25:11 CET 2020
X64-embedded sur Intel(R) Atom(TM) CPU C2750 @ 2.40GHz Boot UEFI
ASRock C2750D4I 2 X 8GB DDR3 ECC
Pool of 2 vdev Raidz1: 3 WDC WD40EFRX + 3 WDC WD40EFRX

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by raulfg3 »

18hours in my case
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

sleid wrote:Hi,

Normally the disk out of service must be taken offline and replaced, the new drive must be online, then possibly a scrub but reconstruction must be done alone.
With 3 terabytes of data it takes 15 hours ....
What do you want to say with offline : computer turned off or ?

Same question with replaced ?

Sorry for that questions but sometimes It's so clear for people but not for others :D Perhaps I do something bad.

Could you tell me If I create well my area :

1. I add each of my 4 disks in disk management
2. In ZFS I create a virtual device (Called VD1) with 4 disks in RaidZ2 (later I will create a bigger system but first it is just to learn and well control Nas4Free)
3. I create a Pool (called Pool1) with my virtual disk (VD1)
4. I create a volume (called VOL1) with my pool (Pool1)
5. I add services to share my datas

I'm trying to reinstall all to be sure I will sent the zpool information.

After creating my pool I have this message :

pool: Pool1
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
Pool1 ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
ada0.nop ONLINE 0 0 0
ada1.nop ONLINE 0 0 0
ada2.nop ONLINE 0 0 0
ada3.nop ONLINE 0 0 0

errors: No known data errors


After I created my volume VOL1 I have this message

Pool Name Size Description
Pool1 VOL1 cannot open 'Pool1/VOL1': dataset does not exist

Thanks for your help

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by raulfg3 »

CorbeilleNews wrote: In ZFS I create a virtual device (Called VD1) with 4 disks in RaidZ2
is a waste of disk using 4 disk in RaidZ2, you waste 2 disk and can not grow the pool ading new disk, only replacing all (four) disk for bigger.

Think about to creat 2 mirrors, you lose 2 disk in redundancy, but can grow the pool adding more mirror to the pool ( only 2 disk a time).

PD: please read more about ZFS and how it works:

http://constantin.glez.de/blog/2010/01/ ... still-best

http://www.solarisinternals.com/wiki/in ... th_SSDs.29
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

raulfg3 wrote: is a waste of disk using 4 disk in RaidZ2, you waste 2 disk and can not grow the pool ading new disk, only replacing all (four) disk for bigger
I know that ! And that's why I precise "later I will create a bigger system but first it is just to learn and well control Nas4Free"

The idea is to create a RaidZ2 of 10 disks of 2 To, I can't imagine to test and learn how Nas4Free runs with this amount of data :lol:

That's why first I test Raidz2 with the minimum of disks to do it : 4 disks
sleid wrote: Normally the disk out of service must be taken offline and replaced, the new drive must be online, then possibly a scrub but reconstruction must be done alone.
With 3 terabytes of data it takes 15 hours ....
What do you want to say with offline : computer turned off or ?

Same question with replaced ?

Sorry for that questions but sometimes It's so clear for people but not for others :D Perhaps I do something bad.

Could you tell me If I create well my area :

1. I add each of my 4 disks in disk management
2. In ZFS I create a virtual device (Called VD1) with 4 disks in RaidZ2 (later I will create a bigger system but first it is just to learn and well control Nas4Free)
3. I create a Pool (called Pool1) with my virtual disk (VD1)
4. I create a volume (called VOL1) with my pool (Pool1)
5. I add services to share my datas

I'm trying to reinstall all to be sure I will sent the zpool information.

After creating my pool I have this message :

pool: Pool1
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
Pool1 ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
ada0.nop ONLINE 0 0 0
ada1.nop ONLINE 0 0 0
ada2.nop ONLINE 0 0 0
ada3.nop ONLINE 0 0 0

errors: No known data errors


After I created my volume VOL1 I have this message

Pool Name Size Description
Pool1 VOL1 cannot open 'Pool1/VOL1': dataset does not exist

Thanks for your help

sleid
PowerUser
PowerUser
Posts: 774
Joined: 23 Jun 2012 07:36
Location: FRANCE LIMOUSIN CORREZE
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by sleid »

Hello,

Disques|ZFS|Pools|Outils
attach
detach
cache add
cache remove
clear
history
offline
online
remove
replace
scrub
spare add
spare remove
upgrade
vdev add

the controls are offered by Nas4Free to aid handling in zfs, you are testing, play with these commands, and see the result.

"What do you want to say with offline : computer turned off or ?" It is no longer a nas whether to turn off to change a disc !

"Same question with replaced ?" ??


"After I created my volume VOL1 I have this message" I gave you some information on the French forum a few days ago.
12.1.0.4 - Ingva (revision 7852)
FreeBSD 12.1-RELEASE-p12 #0 r368465M: Tue Dec 8 23:25:11 CET 2020
X64-embedded sur Intel(R) Atom(TM) CPU C2750 @ 2.40GHz Boot UEFI
ASRock C2750D4I 2 X 8GB DDR3 ECC
Pool of 2 vdev Raidz1: 3 WDC WD40EFRX + 3 WDC WD40EFRX

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

sleid wrote:"After I created my volume VOL1 I have this message" I gave you some information on the French forum a few days ago.
Yes I remember but If first I don't understood, I decided to start without understanding them. Now I think understand them and that dataset are not necessary for me : I just need simple share for all users

But when I try to create my volume (VOL1) I have this message and I don't know why and how to do. I tried to reset all my configuration but it's the same after configuration.

Pool Name Size Description
Pool1 VOL1 cannot open 'Pool1/VOL1': dataset does not exist

Thanks to help me

If you want to reply me privately in french, you can do it, perhaps it will be easier for me.

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

Normally the disk out of service must be taken offline and replaced, the new drive must be online, then possibly a scrub but reconstruction must be done alone.

"What do you want to say with offline : computer turned off or ?" It is no longer a nas whether to turn off to change a disc !
Could you explain me in details the way to change a disk by another one (disk out of order or just to put a bigger one) that become urgent please. I tried several things but none looks the good one :oops:

sleid
PowerUser
PowerUser
Posts: 774
Joined: 23 Jun 2012 07:36
Location: FRANCE LIMOUSIN CORREZE
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by sleid »

Do you have a port sata free?

If so, get your new drive (of equal or greater capacity disk to be replaced) on this port sata in the format ZFS storage pool device.
OFFLINE Put the disk to be replaced
REPLACE this disk with the planned replacement.
Put this new disk ONLINE.
Leave it to ZFS
UPPERCASE are commands Records | ZFS | Pools | Tools
12.1.0.4 - Ingva (revision 7852)
FreeBSD 12.1-RELEASE-p12 #0 r368465M: Tue Dec 8 23:25:11 CET 2020
X64-embedded sur Intel(R) Atom(TM) CPU C2750 @ 2.40GHz Boot UEFI
ASRock C2750D4I 2 X 8GB DDR3 ECC
Pool of 2 vdev Raidz1: 3 WDC WD40EFRX + 3 WDC WD40EFRX

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

sleid wrote:Do you have a port sata free?
Yes but when I will have 10 disks I will have no more SATA port free That's why I want to try without.
sleid wrote: Leave it to ZFS
UPPERCASE are commands Records | ZFS | Pools | Tools
I don't understand : what do you want to say ?

sska
NewUser
NewUser
Posts: 4
Joined: 24 Jun 2012 17:02
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by sska »

CorbeilleNews wrote:Yes but when I will have 10 disks I will have no more SATA port free That's why I want to try without.
"offline" the disk which must be replaced

Code: Select all

zpool offline poolname device
if your controller supports hot-plug - replace the disk
if not - turn off pc - replace the disk - turn on pc
and lastly

Code: Select all

zpool replace poolname old-device new-device

CorbeilleNews
Advanced User
Advanced User
Posts: 261
Joined: 04 Jul 2012 20:40
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by CorbeilleNews »

Is the name of the new device must be the same of the old one : I think about the name I gave in the management disk ?

BeNooL
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by BeNooL »

no it is the device name as in what it has been identified as by the kernel ie. /dev/ada4

If you replace a drive and connect it to the same port you would indeed use a command like:

Code: Select all

zpool replace poolname /dev/ada4 /dev/ada4

stangri
Starter
Starter
Posts: 22
Joined: 01 Aug 2012 15:00
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by stangri »

Uh oh, I need help please. I've tried both GUI and command line commands and nothing seems to work.

Code: Select all

ss4200:~# zpool status -v                                                       
  pool: DATA                                                                    
 state: DEGRADED                                                                
status: One or more devices has been taken offline by the administrator.        
        Sufficient replicas exist for the pool to continue functioning in a     
        degraded state.                                                         
action: Online the device using 'zpool online' or replace the device with       
        'zpool replace'.                                                        
 scan: none requested                                                           
config:                                                                         
                                                                                
        NAME                     STATE     READ WRITE CKSUM                     
        DATA                     DEGRADED     0     0     0                     
          raidz1-0               DEGRADED     0     0     0                     
            ada0                 ONLINE       0     0     0                     
            ada1                 ONLINE       0     0     0                     
            ada2                 ONLINE       0     0     0                     
            4630248456937002447  OFFLINE      0     0     0  was /dev/ad14      
                                                                                
errors: No known data errors                                                    
ss4200:~# zpool replace DATA ad14                                               
cannot replace ad14 with ad14: no such pool or dataset                          
ss4200:~# zpool replace DATA /dev/ad14                                          
cannot replace /dev/ad14 with /dev/ad14: no such pool or dataset                
ss4200:~# zpool replace DATA 4630248456937002447                                
cannot open '4630248456937002447': no such GEOM provider                        
must be a full path or shorthand device name                                    
ss4200:~# zpool replace DATA /dev/ad14 4630248456937002447                      
cannot open '4630248456937002447': no such GEOM provider                        
must be a full path or shorthand device name                                    
ss4200:~# zpool replace DATA /dev/ad14 /dev/4630248456937002447                 
cannot open '/dev/4630248456937002447': No such file or directory
What am I doing wrong?

stangri
Starter
Starter
Posts: 22
Joined: 01 Aug 2012 15:00
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by stangri »

OK, so I've figured the correct replace command and at the end of the silvering I've still got the pool with the degraded status:

Code: Select all

ss4200:~# zpool status -v                                                       
  pool: DATA                                                                    
 state: DEGRADED                                                                
status: One or more devices has experienced an error resulting in data          
        corruption.  Applications may be affected.                              
action: Restore the file in question if possible.  Otherwise restore the        
        entire pool from backup.                                                
   see: http://www.sun.com/msg/ZFS-8000-8A                                      
 scan: scrub in progress since Sat Aug  4 07:07:09 2012                         
    42.1M scanned out of 6.04T at 757K/s, (scan is slow, no estimated time)     
    0 repaired, 0.00% done                                                      
config:                                                                         
                                                                                
        NAME                       STATE     READ WRITE CKSUM                   
        DATA                       DEGRADED     0     0     0                   
          raidz1-0                 DEGRADED     0     0     0                   
            ada0                   ONLINE       0     0     0                   
            ada1                   ONLINE       0     0     0                   
            ada2                   ONLINE       0     0     0                   
            replacing-3            DEGRADED     0     0     0                   
              4630248456937002447  OFFLINE      0     0     0  was /dev/ad14    
              ada3                 ONLINE       0     0     0                   
                                                                                
errors: Permanent errors have been detected in the following files:             
                                                                                
        DATA:<0x3306a>                                                          
        DATA:<0x33077>                                                          
Where it says DATA:<0x3306a> and DATA:<0x33077> used to be two filenames, the files I don't really need ATM, so I have just deleted them and now it says what ti says instead of the filenames.

What do I do now to bring the system to the healthy status?
How do I get rid of that replacing-3 section so it would just say ada3 like it's supposed to?

PS. I've ran scrub, not sure if that'd help when it's finished.

stangri
Starter
Starter
Posts: 22
Joined: 01 Aug 2012 15:00
Status: Offline

Re: How to replace an HDD by another one in ZFS ?

Post by stangri »

Scrub helped, system is healthy now.

Post Reply

Return to “ZFS (only!)”