*New 11.4 series Release:
2020-07-03: XigmaNAS 11.4.0.4.7633 - released!

*New 12.1 series Release:
2020-04-17: XigmaNAS 12.1.0.4.7542 - released


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

How do I remove / replace a disk in a SoftRAID1 array?

Software RAID information and help
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

How do I remove / replace a disk in a SoftRAID1 array?

#1

Post by Schof »

Running 9.2.0.1 - Shigawire (revision 943).

Had a drive from my SoftRAID1 array die on me so trying to replace it with an identical one. Followed directions from wiki but after rebooting the server (step 4) I am unable to forget the array (get geom: No such device: error).

In Disks|Management the old drive appears with status CHANGED (Device Serial : 'W1F11AJF' to 'Z500Z3AS').

Should I Clear config and Import software raid disks?


In Disks|Software RAID|RAID1|Management the raid volume is showing as stopped, however, I am able to access the CIFS/SMB share from my Windows PC.

Please let me know what I need to do to get NAS4Free to use the new drive to replace the old one and rebuild the array.

Thanks!


Aside: As someone has previously mentioned, the directions in the aforementioned FAQ appear outdated. In Disks|Software RAID|RAID1|Tools there is a Disk dropdown which is never mentioned in Steps 2), 5) or 6).

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#2

Post by Parkcomm »

Just to clear, forget does not forget the array, it forgets the device.

To be on the safe side run

Disks|Software RAID|RAID1|Tools|List

and

Disks|Software RAID|RAID1|Tools|Status

and make sure everything is ok.

Then run Clear config and Import software raid disks
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#3

Post by Schof »

Trying to get the List / Status of the volume results in the same error as when I tried to forget the device, namely geom: No such device. I believe this is because the raid volume status is Stopped. Despite that the volume mount point is functional.

Any other suggestions or do I just run a Clear config and Import software raid disks?

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#4

Post by Parkcomm »

I wouldn't Clear config and Import software raid disks just yet - you'll be importing the on disk config, but we know that's faulty.

Just set up a softraid (mirror) with a couple of USB sticks, pulled out one of the sticks and rebuilt the raid. See if this works - I'll show the command line but it can be done from the GUI menu

Code: Select all

mightymouse: ~# gmirror forget GRaid
 mightymouse: ~# gmirror status
        Name    Status  Components
mirror/GRaid  COMPLETE  da2 (ACTIVE)
 mightymouse: ~# gmirror remove GRaid da1
gmirror: No such provider: da1.
 mightymouse: ~# gmirror insert GRaid da1
 mightymouse: ~# gmirror status
        Name    Status  Components
mirror/GRaid  DEGRADED  da2 (ACTIVE)
                        da1 (SYNCHRONIZING, 28%)
If any of these steps fail - please post the error here. One questions, geom: No such device the devices are showing up in the disk management menu and they have been formatted for soft raid??
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#5

Post by Schof »

I'll have to dig up some USB drives to give your test a try.

In the meantime, here's a screenshot of the Disks and Software Raid volumes.
NAS.jpg
As you can see the replacement drive is recognized, I just don't know how to indicate that it is the drive to use for the raid volume so I can rebuild it.

Only the ad0 and 4TbRaidSet are recognized as drives that I can format.
You do not have the required permissions to view the files attached to this post.

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#6

Post by Parkcomm »

Gotcha - yeah Clear config and Import software raid disks

Then you should be able to use ada2 in the gui tools.
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#7

Post by Schof »

Did a Clear config and Import software raid disks and nothing changed in Disks|Management but my raid volume disappeared from Disks|Software RAID|RAID1|Management. However, it is still mounted with an OK status.

I tried adding the raid volume back but the status reverts back to what it was in prior to me doing any of these changes (I.e. still looks like the screenshot I provided previously).

I tried manually changing the device serial number (in a backup config file I had from before when I added the new drive) and restoring that config file. Everything looks good in Disks|Management but the raid volume size is still Unknown and the status is still Stopped.

Any other ideas?

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#8

Post by Parkcomm »

How comfortable are you with the terminal - just use the text in green above (you'll have to change the devises and the name of the raid as appropriate). If you get any error messages, paste them here.
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#9

Post by Schof »

I don't mind using the terminal but I can't execute the full code because the mirror is not showing up (only shows mirror/4TbRaidSet) when I check the status. As a result I can't forget the old drive and insert the new one.

I am not familiar with the inner workings of FreeBSD but it would appear as though the mirror metadata is corrupted somehow which is why the Raid volume won't load. Obviously it is still there is some form or fashion because the mount point is still up and running.

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#10

Post by Parkcomm »

OK - please post (please cut and paste and use )tags) the output of the following:

Code: Select all

mount
geom mirror list
geom mirror status
Last edited by Parkcomm on 17 Sep 2015 05:11, edited 1 time in total.
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#11

Post by Parkcomm »

I'm going to hit the sack now - but here is the process:
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#12

Post by Schof »

Here are the results:

Code: Select all

/$ mount
/dev/md0 on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
procfs on /proc (procfs, local)
/dev/ufsid/52f6b83ed12be259 on /mnt/nas (ufs, local, journaled soft-updates, acls)
/dev/ufsid/51870a0f6b110147 on /mnt/nas2 (ufs, local, journaled soft-updates, acls)
/dev/md1 on /var (ufs, local)
/dev/ada0a on /cf (ufs, local, read-only)

/$ geom mirror list
Geom name: 4TbRaidSet
State: COMPLETE
Components: 2
Balance: round-robin
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 3190923207
Providers:
1. Name: mirror/4TbRaidSet
   Mediasize: 4000787029504 (3.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e3
Consumers:
1. Name: ada4
   Mediasize: 4000787030016 (3.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   State: ACTIVE
   Priority: 1
   Flags: NONE
   GenID: 0
   SyncID: 1
   ID: 318324315
2. Name: ada3
   Mediasize: 4000787030016 (3.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: NONE
   GenID: 0
   SyncID: 1
   ID: 332299725

/$ geom mirror status
             Name    Status  Components
mirror/4TbRaidSet  COMPLETE  ada4 (ACTIVE)
                             ada3 (ACTIVE)
Funny, I came across that link earlier which led me to my conclusion about the metadata. There are so many steps involved I am going to try and back up as much of the data as a I can first to ensure I don't do something wrong and lose all of my data.

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#13

Post by Parkcomm »

yes - good idea:

now if you run Glabel status and see what those /dev/ufsid labels point to,

If one is /mirror/4TbRaidSetp1 and the other is ada1p1 (or more unlikely ada2p1) follow the procedure in the Freebsd handbook.

(obviously step 1 is baking up your data)

Explanation - it looks like the mirror metadata has be compromised, but the underlying partition and data is in tact
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#14

Post by Schof »

Running glabel list provides exactly what you thought it would:

Code: Select all

# glabel list
Geom name: ada0a
Providers:
1. Name: ufsid/52dcd5c641489a93
   Mediasize: 131088384 (125M)
   Sectorsize: 512
   Mode: r0w0e0
   secoffset: 0
   offset: 0
   seclength: 256032
   length: 131088384
   index: 0
Consumers:
1. Name: ada0a
   Mediasize: 131088384 (125M)
   Sectorsize: 512
   Mode: r0w0e0

Geom name: ada1p1
Providers:
1. Name: ufsid/51870a0f6b110147
   Mediasize: 3000592941056 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   secoffset: 0
   offset: 0
   seclength: 5860533088
   length: 3000592941056
   index: 0
Consumers:
1. Name: ada1p1
   Mediasize: 3000592941056 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e2

Geom name: mirror/4TbRaidSetp1
Providers:
1. Name: ufsid/52f6b83ed12be259
   Mediasize: 4000786989056 (3.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e1
   secoffset: 0
   offset: 0
   seclength: 7814037088
   length: 4000786989056
   index: 0
Consumers:
1. Name: mirror/4TbRaidSetp1
   Mediasize: 4000786989056 (3.7T)but 
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e2
I tried following the instructions in 18.3.3. Creating a Mirror with an Existing Drive but was stopped at the second step!?!

Code: Select all

# diskinfo -v ada1 | head -n3
ada1
        512             # sectorsize
        3000592982016   # mediasize in bytes (2.7T)

# geom zero load
geom: Command 'load' not available.
One step forward, two steps back!

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#15

Post by Parkcomm »

My guess is you've already loaded geom zero - you can't load it twice.

Run - here's what it looks like after its loaded (don't worry about the numbers)

Code: Select all

 mightymouse: ~# geom zero load
 mightymouse: ~# geom zero list
Geom name: gzero
Providers:
1. Name: gzero
   Mediasize: 1152921504606846976 (1.0E)
   Sectorsize: 512
   Mode: r0w0e0

 mightymouse: ~# 
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#16

Post by Parkcomm »

I've just been looking for an easier option - the page from the handbook makes everything so hard.

I can work one out (actually if you have a spare disk you could create the mirror and copy the data across), but I though i should warn you, if you follow the tutorial, you can't import the raid back into the GUI.
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Schof
Starter
Starter
Posts: 21
Joined: 06 Aug 2012 21:58
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#17

Post by Schof »

I thought that geom might have already been loaded but that wasn't the case:

Code: Select all

# geom zero list
geom: Command 'list' not available.
At any rate, using the GUI is paramount. Unfortunately I don't have any spare drives laying around so will have to copy the data off and then set up the mirror.

Thank you very much for the help, it is much appreciated!

User avatar
daoyama
Developer
Developer
Posts: 422
Joined: 25 Aug 2012 09:28
Location: Japan
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#18

Post by daoyama »

geom zero is FreeBSD 10.x only.
You cannot use in 9.x.
NAS4Free 10.2.0.2.2115 (x64-embedded), 10.2.0.2.2258 (arm), 10.2.0.2.2258(dom0)
GIGABYTE 5YASV-RH, Celeron E3400 (Dual 2.6GHz), ECC 8GB, Intel ET/CT/82566DM (on-board), ZFS mirror (2TBx2)
ASRock E350M1/USB3, 16GB, Realtek 8111E (on-board), ZFS mirror (2TBx2)
MSI MS-9666, Core i7-860(Quad 2.8GHz/HT), 32GB, Mellanox ConnectX-2 EN/Intel 82578DM (on-board), ZFS mirror (3TBx2+L2ARC/ZIL:SSD128GB)
Develop/test environment:
VirtualBox 512MB VM, ESXi 512MB-8GB VM, Raspberry Pi, Pi2, ODROID-C1

User avatar
Parkcomm
Advanced User
Advanced User
Posts: 388
Joined: 21 Sep 2012 12:58
Location: Australia
Status: Offline

Re: How do I remove / replace a disk in a SoftRAID1 array?

#19

Post by Parkcomm »

Of course you are right daoyama - I'd forgotten that.

Damn - this is like a Chinese puzzle.

I think I'm out of ideas
NAS4Free Embedded 10.2.0.2 - Prester (revision 2003), HP N40L Microserver (AMD Turion) with modified BIOS, ZFS Mirror 4 x WD Red + L2ARC 128M Apple SSD, 10G ECC Ram, Intel 1G CT NIC + inbuilt broadcom

Post Reply

Return to “Software RAID”