Operating System - HP-UX
1832861 Members
2917 Online
110048 Solutions
New Discussion

Re: Restoring external disk from crashed workstation

 
SOLVED
Go to solution
Dr. Martin Bäker
Occasional Advisor

Restoring external disk from crashed workstation

Recently, my HP C160 (HP-UX 10.20) crashed due to a processor
failure. The workstation had an external data disk for the
/home-directories, which was vg01.

In order to restore the data on the disk (as usual, our backup did not
work properly...), I want to add this disk to another HP-workstation
(C180), also with HP-UX 10.20. This workstation also has an external
disk, which is also called vg01.

What I want to do is plug in the old disk to save the data via network
to our data server.

So the question is how to do it.

If I understand correctly, the following procedure should be possible:


1. Add the disk to the C180 (with a different SCSI-switch-number)

2. Reboot and go to maintenance mode by doing

ISL> hpux -lm

3. Do a vgimport - but here is the problem: Can I import the disk as vg02 now?
Or do I have to use vg01, as it was used before? In this case, how do
I get rid of the other vg01-disk?

vgimport -v /dev/vg02 /dev/dsk/...

Can I do vgimport without a map-file? If not, I know that vgscan can
do the trick, but I do not know how to do it exactly.

Do I have to mkdir vg02 first if I do it this way and to do an mknod?
If so, what are correct parameters to mknod? Is it

mknod /dev/vg02/group 64 0x010000

?

4. After that I have to do

vgchange -a y vg02

in order to activate the volume and can then mount it, right?

5. Question is, is it then possible to mount it to another name, like
/home2, as /home is of course already occupied, or do I have to rename
the /home-directory on the C180 and then mount the external disk as
/home?

Sorry if all this has been discussed before here, but I could not find
the exact answers to these questions in the archives and am afraid of
destroying the data if I do something wrong.
a real Klingon never comments his code.
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Restoring external disk from crashed workstation

You can vgimport the data disk and any VG you like as long as it does not currently exist on the target machine. If vg02 is not defined feel free to use it. A good way to identify existing disks and VG's is to issue a "strings /etc/lvmtab" command.


You next task is to create a
/dev/vg04 directory and a device node under it).

mknod c /dev/vg04 64 0x040000.

Note that the first two octal digits of the minor device number must be unique within the system. By convention,
0x010000 is used for vg01, 0x020000 is used for vg02, and so on but any unique minor device number will work.

You then run then vgimport command, vgchange -a y /dev/vg04, create amountpoints, and mount the filesystems.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Restoring external disk from crashed workstation

Hi:

You are thinking correctly. Yes, you can (should) 'vgimport' the disk with a new volume group name. In fact, that is the way to rename a volume group. Yes, too, you can mount filesystems on the imported disks under any directory name you choose.

The absence of 'vgimport' mapfiles is immaterial. In their absence the logical volume names will be build by default ("lvol1", "lvol2", etc. for each successfile logical volume. If this is not desired, you can pre-construct a mapfile that looks like this:

1 mylvol1
2 mylvol2
...

To 'vgimport' and change the name to 'vg02' do:

# mkdir /dev/vg02
# mknod /dev/vg02/group c 64 0x020000
# vgimport -m mymapfile /dev/vg02 /dev/dsk/cXtYdZ
# vgchange -a y /dev/vg02

Now for each logical volume create a directory on which to mount it and mount it. You can edit 'etc/fstab' if you like and do a 'mount -a' or you can mount each one individually.

When you are done using the imported disk, simply use 'vgexport' to remove knowledge of it from the system. This will remove the 'dev/vg02/' directory and files and appropriately cleanup 'etc/lvmtab'. You will need to delete your mountpoints and you're done!

Regards!

...JRF...
Regards!

...JRF...