1. Update postponed

    The update wouldn't apply cleany so the forum has been restored to it's original state. Thanks!

How to replace a hard drive using shell or ssh

Discussion in 'FreeNAS 4 N00bs' started by JonnyAlpha, Jan 29, 2013.

  1. JonnyAlpha Member

    Member Since:
    Jul 12, 2012
    Message Count:
    87
    Likes Received:
    0
    Trophy Points:
    6
    JonnyAlpha, Jan 29, 2013

    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
  2. JonnyAlpha Member

    Member Since:
    Jul 12, 2012
    Message Count:
    87
    Likes Received:
    0
    Trophy Points:
    6
    JonnyAlpha, Jan 30, 2013

    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 : (
  3. JonnyAlpha Member

    Member Since:
    Jul 12, 2012
    Message Count:
    87
    Likes Received:
    0
    Trophy Points:
    6
    JonnyAlpha, Jan 30, 2013

    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

Share This Page