I want to wipe hard disk which is behind the raid controller. I am able to break the raid. After that, i m getting /dev/sg2 not /dev/sda like.

# lsscsi -g
[1:1:0:0]  disk  Hitachi HDxxxx  jp40  ---   /dev/sg2   
[1:1:1:0]  disk  SAMSUNG HDxxxx  1AA0  ---   /dev/sg3

so i have to write this using /dev/sg2 handle. so what is the way to wipe the disk using /dev/sg2 handle.


Use dd:

dd if=/dev/zero of=/dev/sg2 bs=1M

More secure with random bytes:

dd if=/dev/urandom of=/dev/sg2 bs=1M
|improve this answer|||||
  • thnks for the reply. that's ok i can erase that one, but a problem is occurring that in LSI raid contoller it is showing only one that is /dev/sg0 .like # lsscsi -g [0:0:27:0] enclosu LSI Corp SAS... 0717 --- dev/sg0 in it there are 2 disk and it is not showing disk individually so how to wipe these disks individually. – Ashish Gahlaut Dec 15 '16 at 9:32
  • after running this (dd if=/dev/zero of=/dev/sg2 bs=1M) command, i m getting error # dd if=/dev/zero of=/dev/sg2 bs=1M dd: error writing '/dev/sg2': Invalid argument 1+0 records in 0+0 records out 0 bytes copied, 0.00156275 s, 0.0 kB/s – Ashish Gahlaut Dec 15 '16 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.