How to replace a hard drive using shell or ssh

Status
Not open for further replies.

JonnyAlpha

Contributor
Joined
Jul 12, 2012
Messages
128
Hi;

I need to replace a possible defect HDD however I am having trouble doing so using the GUI.

I have clicked replace and the drive is now OFFLINE and my pool is in a degraded state. The temp replacement HDD is attached, when I click replace again I get the drop down box with the offline HDD listed, I can select the replacement HDD from the drop down list but when I select it I get an error.

If this is a GUI problem how can I do it using shell or ssh?

Thanks
 

JonnyAlpha

Contributor
Joined
Jul 12, 2012
Messages
128
OK found a string of commands in the FAQ however it does not seem to be working. I have offlined the HDD, powered off and removed the drive. I have powered back on but I cannot replace the drive.

The drive I have juts removed in the was listed as ada0 the other two drives in the vdev where ada1 and ada2, now I have disconnected the faulty drive and inserted the temp replacement the temp replacement has become ada0 so when I now try the zpool replace command it does not work as I cannot replace ada0 with ada0 - such device in the pool???

PLEASE HELP this is doing my head in : (
 

JonnyAlpha

Contributor
Joined
Jul 12, 2012
Messages
128
SOLVED

Once the old drive was taken OFFLINE FreeNAS renames it with a psuedo name using a string of numbers so I had to issue the following command:
zpool replace -f FreeNAS 17975696266601533088 ada0

I was then returned to the command line and entered:
zpool status

And saw that the zpool was carrying out a scrub. The scrub finished but I now have 1.40K write errors showing against the new drive ada0 is this normal or have I just replaced a bad drive with a worst one??

I did another scrub and the 1.40K figure under the WRITE remained however I have just noticed that ada0 the new drive now has a state of FAULTED!! The pool STATE is DEGRADED

I entered the following command in shell to remove the old HDD:

zpool detach FreeNAS 17975696266601533088

And the device has now disappeared from the pool, I'll reboot and see if this clears?

NOPE now the HDD shows up in the View Disks but when looking at the volume the device now has a psuedo numerical string name with a state of not available!!

GRRRRR
 
Status
Not open for further replies.
Top