Operating System - HP-UX
1747987 Members
4904 Online
108756 Solutions
New Discussion юеВ

Re: Format disk using dd command

 
SOLVED
Go to solution
Jojo Castro
Regular Advisor

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!

 

7 REPLIES 7
RAJD1
Valued Contributor
Solution

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.

Torsten.
Acclaimed Contributor

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!   
Jojo Castro
Regular Advisor

Re: Format disk using dd command

Thanks Raj D. :) 

Kris_Knigga
Trusted Contributor

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
Dennis Handly
Acclaimed Contributor

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.

cdemelsl
Advisor

Re: Format disk using dd command

Hi,

 

See if you can use mediainit.

 

WCI

Torsten.
Acclaimed Contributor

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!