Re: Format disk using dd command (2830 Views)
Reply
Regular Advisor
Jojo Castro
Posts: 142
Registered: ‎07-02-2007
Message 1 of 8 (2,838 Views)
Accepted Solution

Format disk using dd command

Hi All, I have external EMC devices that were originally used by different OS.

Now that we have migrated said devices to HP-UX, we need to reformat the disk.

As in clean and wipe all the info from it.

They were used as "ASM" orginially.

I have tried pvcreate and pvformat but to no avail.

EMC is suggesting to use "dd" command.

 

Herewith are the list of devices. Can someone help me with the correct and "safe" syntax?

 

crw-rw----   1 ora11g2    dba        188 0x100000 Feb 23  2013 c16t0d0

crw-rw----   1 ora11g2    dba        188 0x110000 Feb 24  2013 c17t0d0

crw-rw----   1 ora11g2    dba        188 0x11a300 Feb 24  2013 c17t10d3

crw-rw----   1 ora11g2    dba        188 0x11a200 Feb 24  2013 c17t10d2

crw-rw----   1 ora11g2    dba        188 0x108700 Feb 24  2013 c16t8d7

crw-rw----   1 ora11g2    dba        188 0x109100 Feb 24  2013 c16t9d1

crw-rw----   1 ora11g2    dba        188 0x119100 Feb 24  2013 c17t9d1

crw-rw----   1 ora11g2    dba        188 0x119200 Feb 24  2013 c17t9d2

crw-rw----   1 ora11g2    dba        188 0x119300 Feb 24  2013 c17t9d3

crw-rw----   1 ora11g2    dba        188 0x119400 Feb 24  2013 c17t9d4

crw-rw----   1 ora11g2    dba        188 0x119500 Feb 24  2013 c17t9d5

crw-rw----   1 ora11g2    dba        188 0x119600 Feb 24  2013 c17t9d6

crw-rw----   1 ora11g2    dba        188 0x119700 Feb 24  2013 c17t9d7

crw-rw----   1 ora11g2    dba        188 0x11a000 Feb 24  2013 c17t10d0

crw-rw----   1 ora11g2    dba        188 0x11a100 Feb 24  2013 c17t10d1

crw-rw----   1 ora11g2    dba        188 0x109000 Feb 24  2013 c16t9d0

crw-rw----   1 ora11g2    dba        188 0x108600 Feb 24  2013 c16t8d6

crw-rw----   1 ora11g2    dba        188 0x119000 Feb 24  2013 c17t9d0

crw-rw----   1 ora11g2    dba        188 0x118700 Feb 24  2013 c17t8d7

crw-rw----   1 ora11g2    dba        188 0x118600 Feb 24  2013 c17t8d6

crw-rw----   1 ora11g2    dba        188 0x109200 Feb 24  2013 c16t9d2

crw-rw----   1 ora11g2    dba        188 0x109300 Feb 24  2013 c16t9d3

crw-rw----   1 ora11g2    dba        188 0x109400 Feb 24  2013 c16t9d4

crw-rw----   1 ora11g2    dba        188 0x109500 Feb 24  2013 c16t9d5

crw-rw----   1 ora11g2    dba        188 0x109600 Feb 24  2013 c16t9d6

crw-rw----   1 ora11g2    dba        188 0x109700 Feb 24  2013 c16t9d7

crw-rw----   1 ora11g2    dba        188 0x10a000 Feb 24  2013 c16t10d0

crw-rw----   1 ora11g2    dba        188 0x10a100 Feb 24  2013 c16t10d1

crw-rw----   1 ora11g2    dba        188 0x10a200 Feb 24  2013 c16t10d2

crw-rw----   1 ora11g2    dba        188 0x10a300 Feb 24  2013 c16t10d3

crw-rw----   1 ora11g2    dba        188 0x10a400 Feb 24  2013 c16t10d4

crw-rw----   1 ora11g2    dba        188 0x11a400 Feb 24  2013 c17t10d4

 

Thanks!

 

Valued Contributor
RAJD1
Posts: 60
Registered: ‎10-09-2011
Message 2 of 8 (2,830 Views)

Re: Format disk using dd command

Hi,

 

For this purpose ,you can use:

 

# dd if=/dev/zero of=/dev/rdsk/c16t0d0

 

# dd if=/dev/null of=/dev/rdsk/c16t0d0 bs=10240 count=100  

 

You can try this and see how it goes, hope it will clean up all the previous data it was having. 

You can also use mediainit , but it takes longer time to finish.  Once dd clears it up , you can run # pvcreate -f <disk>   , and then you can go ahead with creating VG and LV's  & FS.

 

HTH

Raj D.

Acclaimed Contributor
Torsten.
Posts: 23,263
Registered: ‎10-02-2001
Message 3 of 8 (2,828 Views)

Re: Format disk using dd command

There is no need to "format" these disks in any way, just do a "pvcreate" and they are ready to use for LVM, all data will be overwritten.


Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Regular Advisor
Jojo Castro
Posts: 142
Registered: ‎07-02-2007
Message 4 of 8 (2,822 Views)

Re: Format disk using dd command

Thanks Raj D. :) 

Trusted Contributor
Kris_Knigga
Posts: 64
Registered: ‎06-28-2011
Message 5 of 8 (2,808 Views)

Re: Format disk using dd command


Torsten. wrote:

There is no need to "format" these disks in any way, just do a "pvcreate" and they are ready to use for LVM, all data will be overwritten.


Torsten is right: pvcreate is the way to go.  If it compains, throw a "-f" on it to force.  Writing zeros over dozens of LUNs could take a long time and it probably doesn't really buy you anything.

 

Give this a whirl:

pvcreate -f /dev/rdsk/c16t0d0

 

Also, you might want to change the ownership of those DSFs to the normal bin:sys.


Kris Knigga
Acclaimed Contributor
Dennis Handly
Posts: 25,047
Registered: ‎03-06-2006
Message 6 of 8 (2,802 Views)

Re: Format disk using dd command

># dd if=/dev/null of=/dev/rdsk/c16t0d0 bs=10240 count=100 

 

Using /dev/null won't help.  It will get EOF on the read and never write.

Advisor
cdemelsl
Posts: 12
Registered: ‎01-13-2008
Message 7 of 8 (2,799 Views)

Re: Format disk using dd command

Hi,

 

See if you can use mediainit.

 

WCI

Acclaimed Contributor
Torsten.
Posts: 23,263
Registered: ‎10-02-2001
Message 8 of 8 (2,793 Views)

Re: Format disk using dd command

As said, any "format" is not needed. If you feel you need to do this anyway, investigate if the array itself can do anything for you. I would expect problems with mediainit on an array, at least it could run for days or weeks on large luns ...

Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.