1833187 Members
3080 Online
110051 Solutions
New Discussion

Re: New Disks

 
Himanshu_3
Valued Contributor

New Disks

Hi All,

As per HP documentation if we are adding a new disk in the system and if the disk has been used for some old filesystem or Veritas Volume Manager structures we first need to use dd commands to write the 1024 1K blocks to the top of the disks. example

dd if=/dev/zero of=/dev/rdsk/c0t3d0 bs=1024 count=1024

Only after this pvcreate command is used to create the pysical disk like

pvcreate -f /dev/rdsk/c0t3d0

We have never used the dd command before adding any new disks from SAN storage.

Why do we not need to use the dd command on new disks ?
Are the new disks preconfigured to be used with LVM ?

Cheers,
Himanshu
9 REPLIES 9
A. Clay Stephenson
Acclaimed Contributor

Re: New Disks

The dd command is not really needed although it does no harm. Essentially what you are doing is writing NUL's in the LVM/VxVM reserved areas of the disk but a pvcreate -f will force a write even if it detects previosly used disks.

If you do your dd command the -f option will not be needed.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: New Disks

It really makes more sense and is safer to execute pvcreate without the -f (force) option because it attempts to detect LVM disks that might be in use or prevent you from writing over the LVM/VxVM metadata. I would always start with the pvcreate w/o -f then use the -f option only after making sure that this is the correct disk. The same danger applies to the dd command. It is trivially easy to mistype a single character in a device node name and wipe out valuable data.

New disks come NUL'ed so that they are ready for pvcreate w/o -f.
If it ain't broke, I can fix that.
Rick Garland
Honored Contributor

Re: New Disks

Never heard of dd being used to initialize a new (used) disk.

pvcreate -f will force the LVM to recognize the disk and include it.

Steven E. Protter
Exalted Contributor

Re: New Disks

Shalom Himanshu,

I have never used the dd command when installing new disks.

New disks are not pre-configured for anything LVM or anything else. It should not matter at all when installing a disk whether it has been used again.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: New Disks

Hi:

A 'pvcreate -f' wiil *initialize* the LVM area on a disk that is not recorded in '/etc/lvmtab'. A 'pvcreate' sets the PVID of a physical disk.

In order to use an LVM disk for other volume managers, a 'pvremove' (PVREMOVE) may be necessary. This action clears the LVM structures rather than recreating skeletal ones. The 'dd' action will do the same.

See the manpages for 'pvremove(1M)' for more information.

Regards!

...JRF...
sathish kannan
Valued Contributor

Re: New Disks

Hello Himashu,

I have never used "dd" while adding new disks. If it is a new LUN there is no need to use "dd"

HP may recommend as a precaution to over write the first 1024b especially in a SAN environment to prevent any error message. There is no preconfiguration on any disks for HP LVM. When you initialise the disk using "pvcreate" for HP LVM, the LVM structure is created again similar procedure for other LVM like VXVM.


Regards
Sathish
Don't Think too much
sysadm_1
Valued Contributor

Re: New Disks

Hi Himanshu,

It is not necessory to do a dd before initialising with pvcreate.
pvcreate -f forcefully initailise the disk for usng in LVM.


Himanshu_3
Valued Contributor

Re: New Disks

Thanx to all for sharing your experiences.
Even I have never used dd to create the new disks but since I came across this official HP training manual, I just thought of having views from everyones experiences.

Cheers,
Himanshu
Himanshu_3
Valued Contributor

Re: New Disks

Closing the thread