Operating System - HP-UX
1753766 Members
5470 Online
108799 Solutions
New Discussion юеВ

Re: Used dd to clone system disk, VG is now "unused"

 
Gary Lau
New Member

Used dd to clone system disk, VG is now "unused"

I attempted to use "dd" to create a backup copy of the system HD. The command I used was:

dd if=/dev/rdsk/c2t0d0 of=/dev/rdsk/c3t2d0 bs=4096k

With the original and destination HD's present, SAM reported:
Path(s) Device File(s) Use VG Names Paths Size(GB) Descrip
--------------------------------------------------------------------------------
0/1/1/0.0.0 /dev/dsk/c2t0d0 LVM vg00 1 68.37 HP 73
0/0/2/0.0.0.0 /dev/dsk/c0t0d0 unused - 1 0.00 TEAC
0/1/1/1.2.0 /dev/dsk/c3t2d0 unused - 1 68.37 HP 73


The dd command executed uneventfully. When I shutdown and removed the original system disk and replaced it with the cloned copy, it appeared to work, but when I viewed the new HD under SAM, the VG now is reported as "unused":

Path(s) Device File(s) Use VG Names Paths Size(GB) Descrip
--------------------------------------------------------------------------------
0/0/2/0.0.0.0 /dev/dsk/c0t0d0 unused - 1 0.00 TEAC
0/1/1/0.0.0 /dev/dsk/c2t0d0 unused - 1 68.37 HP 73


I don't understand the consequences of the VG being unused. Have I created a useful backup disk, or is this trouble waiting to happen? Is it just a matter of issuing a vgcreate command?

Thanks, Gary

(Running HP-UX 11.31 on an RX2600)
9 REPLIES 9
Gary Lau
New Member

Re: Used dd to clone system disk, VG is now "unused"

Hi Pete,

One of the links you provided appeared to show the required steps to repair the LV info on the cloned disk: http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1083682

I'll attach the contents below, with my notes and system responses in []'s

- start of quoted text -
boot into LVM maintanence mode from your cloned disk:

From hpux prompt type:

hpux -lm [boots to single-user mode]

Then vgexport the root volume group:

vgexport /dev/vg00
[/dev/vg00 has been sucessfully removed.]

Then recreate the vg00 group and node for your system:

mkdir /dev/vg00 [ok]
mknod group c 64 0x000000 [ok]

Then vgimport your disk:

vgimport /dev/vg00 /dev/dsk/c4t0d0 [I used c2t0d0, to match my original system disk]
[Creating "/etc/lvmtab_p".
Physical volume /dev/dsk/c2t0d0 contains no lvm information]

Next, take care of the lvnboot information:

vgchange -a y /dev/vg00
[vgchange: Volume group "/dev/vg00" does not exist in /etc/lvmtab file
vgchange: Volume group "/dev/vg00" does not exist in /etc/lvmtab_p file]
[An ls -a of lvmtab & lvmtab_p shows only 12 & 28 bytes. I gave up here.]

lvrmboot -r /dev/vg00
lvlnboot -b /dev/vg00/stand
lvlnboot -r /dev/vg00/root
lvlnboot -d /dev/vg00/swap
lvlnboot -s /dev/vg00/swap

lvlnboot -R
sync
sync
reboot

This should take care of it.

- end of quoted text -

To recap, I replaced the original boot disk with the dd-cloned copy.

Any feedback would be much appreciated, as I know only enough of lvm commands to be dangerous!

Thanks, Gary
Tim Nelson
Honored Contributor

Re: Used dd to clone system disk, VG is now "unused"

Not that the dd method isn't great but is there really a need to go through this ?

Depending on your OS version why not use DRD (Dynamic Root Disk )? It is free, supported, allows for staged patch installs etc...

Can be found at the friendly neighborhood software.hp.com site.

Ganesan R
Honored Contributor

Re: Used dd to clone system disk, VG is now "unused"

Hi,

From your quote
>>>To recap, I replaced the original boot disk with the dd-cloned copy.<<<

replaced or swapped?

OK. The important point here is, as long as you are putting the clone disk on the same hardware path/slot of primary disk and try to boot it will work. Because as far as LVM is concern, it is going to read the disk as per the path information on /etc/lvmconf file.

But booting from the clone disk by keeping the disk other than primary disk path will not work. Because LVM refers different hardware path and disk is in different path.
In this case you should first boot the system into maintanance mode and export and import the VG to update the LVM configurations and /etc/lvmconf file to point to clone disk path.


Best wishes,

Ganesh.
Gary Lau
New Member

Re: Used dd to clone system disk, VG is now "unused"

I had pulled out the original disk and replaced it in the same scsi slot with the cloned disk.

The DRD application looks interesting, installing it now and I'll report how it turns out. I don't understand why cloning the root disk isn't a more common task.

Gary
Andrew Rutter
Honored Contributor

Re: Used dd to clone system disk, VG is now "unused"

hi,

DRD is the way to go, in my opinion.

dont know why you have to install it though, its installed by default on 11.31. there is newer versions though than what i have used.

dd'ing a root disk is only as good as no changes are made? once you have, the dd disk is old.

with DRD you can mount/patch and update the copy and test it.

I would imagine that when you did the dd disk it was probably the Block specified that has thrown it out?

you would probably be better with a 1024k size

Andy
Gary Lau
New Member

Re: Used dd to clone system disk, VG is now "unused"

You're right - drd is there by default.

I tried it using the "/opt/drd/bin/drd clone -v -x overwrite=true -t /dev/dsk/c3t2d0" command and discovered that I need to also issue the "drd activate" command with both disks present to make the clone bootable. But I find that the clone must be placed and booted in the same scsi slot as when it was cloned. So it's not quite the drop-in replacement for the original disk that I was looking for. And more troublesome, the original disk must now be placed in the clone's slot to boot. Was there some command switch to the activate command that I missed?

Thanks, Gary
Victor Sien
Advisor

Re: Used dd to clone system disk, VG is now "unused"

Not sure if you eventually figured this out already. When using drd clone, the cloned disk is ready to boot. so you can change your boot path using setboot to the path of the new disk. you dont need to move the disks.
Bart Paulusse
Respected Contributor

Re: Used dd to clone system disk, VG is now "unused"

Hi Gary,

by using drd activate, you're configuring your newly cloned disk to be the bootdisk. So the disk on hw path of your clonedisk will be used for next boot. The hw path of your original disk is not used.

What is it you're trying to accomplish with cloning your root disk?
1. A backup in case your root disk crashes?
2. Or a fallback disk in case a patch installation leaves you with a broken system?

1. You can use drd (but consider MirrorDisk/ux). Just don't use drd activate.
In case your root disk crashes, boot from hw path of the drd disk.
2. install the patchbundle on the drd disk (drd runcmd swinstall...), use drd activate to boot from the drd disk. If after the reboot you need to recover, simply issue drd activate again and reboot. Now your original root disk will be used again.

regards,

Bart