Operating System - HP-UX
1759886 Members
3280 Online
108889 Solutions
New Discussion юеВ

Re: Using DD to take the image of HP UX 11i v2 & V3

 
Makesh Annamalai
Frequent Advisor

Using DD to take the image of HP UX 11i v2 & V3

Dear All,

I've not used the DD before. I was using IGNITE Image Backup. Since there's a issue in Ignite (ie) could not backup if the Dir Length is more than 136 apprx. So feel to focus on the dd now. Please help !. Sure rewards will be given for valuable answers.

Question :-

Single disks:
Taking an image
restorig the image

Multiple disks:
Multiple disks how do take the image
how do we restore from multiple images.
Can the images be combined.

4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Using DD to take the image of HP UX 11i v2 & V3

Shalom,

The reason ignite exists is partially because of the limitations especially in ease of use of dd.

Lets say our boot disk is /dev/dsk/c1t1d0
We want to make an image to /dev/dsk/c2d1d0

dd if=/dev/dsk/c1t1d0 of=/dev/dsk/c2d1d0

Let it run as long as it needs to.

When its done you'll have an image on the second disk.

You can stick that disk in another machine and use it as the if for your next disk image

As far as multiple disks, you have to do them one at a time. A dd command for each. Same thing for restore, one at a time, taking care to use the right input file in the dd command.

I'm wondering if Ignite is free why you want to do this, but have fun, it will be excruciating I'm sure.

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
A. Clay Stephenson
Acclaimed Contributor

Re: Using DD to take the image of HP UX 11i v2 & V3

There are a couple of things wrong with this:

dd if=/dev/dsk/c1t1d0 of=/dev/dsk/c2d1d0

First you should always use the charaacter (rdsk) raw devices rather than the block (dsk) devices. Secondly, because no blocksize was specified, the default of 512 bytes will be used and the backups will take forever. Your dd should look more like this:

dd if=/dev/rdsk/c1t1d0 bs=256k of=/dev/rdsk/c2d1d0

Now, you should not think of dd images as substitutes for Ignite images but rather as a supplement to Ignite images. I make these dd "lifeboats" weekly and they do work but there are a number of limitations. 1) The filesystems are copied "dirty". 2) In order to serve as a boot disk, the lifeboat disk must be moved to the original boot disk slot. 3) These images really only work for the same machine or an all but identical machine.

Now anyone who has directory names longer than 136 characters deserves to have problems.
If it ain't broke, I can fix that.
Makesh Annamalai
Frequent Advisor

Re: Using DD to take the image of HP UX 11i v2 & V3

Dear All,

Thanks for your time to replay. But i'm facing the promblem of space constraint. I'm using a Rx2620 with 2 Hdd of 146 GB Each.

So in the 2nd HDD i've created the LV by name DD & trying to take the image as a file. But it hits the space problem.

So How do i create the DD image as a file & restore it.

I've used this below command ..

# dd if=/dev/dsk/c2t0d0 of=/dd/106.img

/dev/vg01/lvol25 143327232 143327232 0 100% /dd


This are the file system in the 1st HDD

/dev/vg00/lvol3 1048576 348632 694528 33% /
/dev/vg00/lvol1 524288 265880 256424 51% /stand
/dev/vg00/lvol8 8388608 2327984 6013336 28% /var
/dev/vg00/lvol7 8388608 2709552 5634736 32% /usr
/dev/vg00/lvol6 2097152 19320 2061984 1% /tmp
/dev/vg00/lvol9 10485760 19038 9812559 0% /swdump
/dev/vg00/lvol5 8388608 3586760 4764360 43% /opt
/dev/vg00/lvol4 20971520 45288 20762880 0% /home

Steven E. Protter
Exalted Contributor

Re: Using DD to take the image of HP UX 11i v2 & V3

Shalom again,

Definitely use the rdsk and not the dsk files for the image.

Definitely use the blocksize to speed things up. bs=1024k, something like that. That corrects at least two of my earlier posted mistakes. Regard's to A. Clay for pointing them out.

Take a look at the original disk when setting a blocksize.

dd is not the tool of choice for making usable, portable images of systems. There seems to be a bug in Ignite. Report it, contact your HP rep and find out when its going to be fixed.

Add a fbackup to the process to create a tape of those second nasty little files with Dir Length of more than 136 characters.

Let's assume you've done that good stuff and still need dd.

Here is how we use it:
dd if=/dev/rdsk/c1t1d0 bs=256k of=/dev/rdsk/c2d1d0

Just like A. Clay posted it, for whole disk replication. Not to a logical volume, dd works on a lower level than that.

We use this on systems that are not licensed for mirror/ux, which is another way of preserving the system while not good at creating portable, movable images.

You have two disks, you need to replicate the first one. No need to make it any more complex than that.

I don't know how you'd recover anything usable from the approach in your second post.Perhaps stick the disk in a system and try and use vgimport to bring in and later mount the logical volume.

In your shoes, I'd re-arrange the directories to bring them down under 136 bytes in length.

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