Page 1 of 1

can not format HDD

Posted: 29 May 2014 18:52
by tynolol
Hello,

I have a NAS whith 8 HDD :

five 3To HDD
four 2To HDD

I already created a RAIDZ-2 with the five 3TO HDD and I want to create a RAID5 with the four 2To HDD.

But they don't appear in the format menu so I can't format them in software RAID as you can see below :

Image

But the appear in the disk management menu :

Image

WTF ??

Thank you
Best regard

Re: can not format HDD

Posted: 29 May 2014 22:28
by crowi
one of your drives is still listed as RAID5 device.
You can try using the shell and do gpart destroy on ada0, ada2, ada3, ada7
Then import the drives and see if it worked

Re: can not format HDD

Posted: 30 May 2014 16:18
by tynolol
Ok I will try it in few days when I'll be back home.
thks :)

Re: can not format HDD

Posted: 15 Jun 2014 15:15
by tynolol
hello,

Je tente de faire la commande "gpart destroy ada0" mais j'ai "access denied" comme réponse.

je tente sudo gpart destroy ada0

réponse sudo : not found

Je suis connecté sous mon nom utilisateur habituel qui fait partie des groupe wheel (principal) et admin (secondaire)

Re: can not format HDD

Posted: 15 Jun 2014 16:42
by b0ssman
english please.

are you logged in as root?
it would be /dev/ada0

Re: can not format HDD

Posted: 15 Jun 2014 16:57
by tynolol
b0ssman wrote:english please.
My apologizes !

I was saying that when I try gpart destroy command it doesn't works I have those error messages :

access denied

or

sudo : not found.

But now I logged as root and when I try gpart destroy ada0 (for example) I have this message :

invalid number of arguments

I will try gepart destroy /dev/ada0

edit : gepart destroy /dev/ada0 : invalid number of arguments

Re: can not format HDD

Posted: 15 Jun 2014 17:03
by b0ssman
see the faq

http://wiki.nas4free.org/doku.php?id=faq:0129

do that and reboot

Re: can not format HDD

Posted: 15 Jun 2014 17:15
by tynolol
It does not works :( :

Code: Select all

Welcome to NAS4Free!
nas4free:~# ./wipe.sh
./wipe.sh: Command not found.
nas4free:~# 

Re: can not format HDD

Posted: 15 Jun 2014 17:22
by b0ssman
you have to create that file

Re: can not format HDD

Posted: 15 Jun 2014 17:25
by tynolol
how to? where should I create it?

I am not an SSH expert :s

edit : I think I get it, but which one of the two scripts should I use?

Re: can not format HDD

Posted: 15 Jun 2014 17:37
by b0ssman
you can create it on windows and copy it to a share

however you should become familiar with the shell. see
http://wiki.nas4free.org/doku.php?id=faq:0128
and
http://linuxcommand.org/learning_the_shell.php

Re: can not format HDD

Posted: 15 Jun 2014 17:43
by tynolol
I started nano and I paste one of the two script, then I saved the file as whipe.sh.

Then I did this :

Code: Select all

  GNU nano 2.2.6               File: wipe.sh                                    

#!/bin/bash
echo "What disk do you want"
echo "to wipe? For example - ada1 :"
read disk
echo "OK, in 10 seconds I will destroy all data on $disk!"
echo "Press CTRL+C to abort!"
sleep 10
diskinfo ${disk} | while read disk sectorsize size sectors other
do
    # Delete MBR, GPT Primary, ZFS(L0L1)/other partition table.
    /bin/dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} count=8
    # Delete GEOM metadata, GPT Secondary(L2L3).
    /bin/dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} oseek=$(expr
$sectors - 8) count=8
done




                               [ Wrote 15 lines ]

 

Code: Select all

nas4free:~# ./wipe.sh
./wipe.sh: Permission denied.
nas4free:~# sudo wipe.sh
sudo: Command not found.
nas4free:~#
Thanks for the two links

Re: can not format HDD

Posted: 15 Jun 2014 17:48
by b0ssman
please read the faq carefully.
it says
Make /mnt/wipe.sh executable

do that with chmod a+x wipe.sh

Re: can not format HDD

Posted: 15 Jun 2014 17:53
by tynolol
Ok thank you It work but I think there is an error in the script (In the FAQ it says Make sure you preserve the integrity of each line if you copy and paste the script, but maybe have I something to adapt to my config that I have not done)

Code: Select all

nas4free:~# chmod a+x wipe.sh
nas4free:~# ./wipe.sh
What disk do you want
to wipe? For example - ada1 :
ada0
OK, in 10 seconds I will destroy all data on ada0!
Press CTRL+C to abort!
8+0 records in
8+0 records out
4096 bytes transferred in 0.260799 secs (15706 bytes/sec)
expr: syntax error
./wipe.sh: line 14: 3907029168: command not found
dd: no value specified for oseek
nas4free:~# 

Re: can not format HDD

Posted: 15 Jun 2014 17:59
by b0ssman
you entered a new line in the file where you should not have on line 14

Re: can not format HDD

Posted: 15 Jun 2014 18:11
by tynolol
ok it works I did this for all the HDD which doesn't appear in format menu and I rebooted. But it still doesn't appear in format menu :(

Re: can not format HDD

Posted: 15 Jun 2014 18:27
by b0ssman
then reinstall nas4free. there might be stale data in the config now.

Re: can not format HDD

Posted: 15 Jun 2014 19:16
by tynolol
fine I reinstalled nas4free and it's ok all HDD are present in format menu ! thank you very much b0ssman !