Showing results for 
Search instead for 
Did you mean: 

Re: Need Help Accessing Hard Drive

Go to solution
Occasional Advisor

Need Help Accessing Hard Drive

I have a hard drive that one boot on one of my HP-UX machines and I'm not incredibly familiar with the Unix operating system. I have another healthy computer that I added the bad bard drive to so that I can boot in and hopefully still view the files still on this drive. Where do I need to go in order to view the second hard drive in the operating system?


Re: Need Help Accessing Hard Drive

You're not clear on what this second computer is - is it also a HP-UX system? If not you on a hiding to nothing...

I am an HPE Employee
Accept or Kudo
Occasional Advisor

Re: Need Help Accessing Hard Drive

Hi Duncan! Thank you for your response! I appologize for not being clear on this. The second computer is the exact same model and OS as the first computer that's failing. I'm sure that this is a relatively basic operation but I'm used to handling Windows machines and not Unix driven ones. 

The hard drive with the issues isn't able to find vmunix at boot and I'm not sure if this is going to be a hinderance either. I'm just looking for some way to collect the data from it, if at all possible. I was hoping that if I used the working hard drive to boot then I would be able to see the data on the non-booting one.


Re: Need Help Accessing Hard Drive

OK - so the first step is to see if the new system can even see the old disk - start by executing:

ioscan -fnC disk

You should be able to pick out of that output the current disk the system is booted off (confirm with lvlnboot -v) and the "damaged" disk as well...

I am an HPE Employee
Accept or Kudo
Occasional Advisor

Re: Need Help Accessing Hard Drive

Alright. I ran those two lines and got the following output...

>ioscan -fnC disk
Class   I      H/W Path Driver     S/W State          H/w Type                   Description
Disk   0     10/0/14/0.0.0           SDisk Claimed   Device                        Mitsumi CD-ROM FX4830T!B
                                                  /dev/cdrom        /dev/dsk/c0t0d0        /dev/rdsk/c0t0d0

Disk   2      10/0/15/0.5.0          SDisk Claimed     Device                       Seagate ST336607lc
                                                 /dev/dsk/c2t5d0  /dev/rdsk/c2t5d0

Disk   1      10/0/15/0.6.0          SDisk Claimed      Device                       Compaq BD018635cc
                                                 /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0

>lvlnboot -v
Boot definition for colume group /dev/vg00:
Physical volumes belonging in root volume group:
/dev/dsk/c2t6d0 (10/0/15/0.6.0) -- Boot Disk
Boot: lvol1      on:     /dev/dsk/c2t6d0
Root: lvol3     on:     /dev/dsk/c2t6d0
Swap: lvol2    on:    /dev/dsk/c2t6d0
Dump: lvol2   on:    /dev/dsk/c2t6d0, 0
Dump: lvol4   on:   /dev/dsk/c2t6d0, 1

The Compaq is the working disk and the Seagate is the one that won't boot. It seems that the Seagate is showing up in the first one but not the second?


Re: Need Help Accessing Hard Drive

That's all good - next stage is to identify that the disk looks like a LVM disk - so:


pvdisplay /dev/dsk/c2t5d0


Should tell us that... then we'll be looking at the process to import a volume group and mount the disks - what version of HP-UX is this? (uname -a will tell us) 

I am an HPE Employee
Accept or Kudo
Occasional Advisor

Re: Need Help Accessing Hard Drive

This command didn't seem to yield as good of results. Here is the output:

>pvdisplay /dev/dsk/c2t5d0
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/dsk/c2t5d0" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c2t5d0"

>uname -a
HP-UX kmg01s1 B.10.20 A 9000/785 2007904252 two-user license


Re: Need Help Accessing Hard Drive

Wow 10.20 - you do know that is like way, way, WAY out of support yeah? ;op

Anyway that bad output isn't necessarily a problem. Next thing to do is try and import the volume group - to do that you need to establish how many volume groups you already have on your system - you can do that by looking at the the files in /dev as follows:


# ll /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Oct 28  2006 /dev/vg00/group
crw-r-----   1 root       sys         64 0x010000 Jun  5  2009 /dev/vg01/group


So on my system I can see I already have 2 volume groups, vg00 (the root volume group) and vg01 which in my case holds some data. So if I want to add a new volume group to import that disk into the first things is to create a new volume group directory and group file under /dev/ This has to have a unique minor number (the hex output in the above). I can see that 0x000000 and 0x010000 are taken, so I'll use 0x020000:


# mkdir /dev/vgrecovery
# mknod /dev/vgrecovery/group c 64 0x020000
# ll /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Oct 28  2006 /dev/vg00/group
crw-r-----   1 root       sys         64 0x010000 Jun  5  2009 /dev/vg01/group
crw-r-----   1 root       sys         64 0x020000 Feb 25 02:44 /dev/vgrecovery/group


Now we can use the vgimport command to import the volume group - I don't have an unused disk on my system so I'm going to temporarily remove the disk in my vg01 volume group and use that as an example. So my starting point now looks like this:


# ll /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Oct 28  2006 /dev/vg00/group


So I'm going to create the group files under /dev as we did previously:


# mkdir /dev/vgrecovery
# mknod /dev/vgrecovery/group c 64 0x010000
# ll /dev/*/group
crw-r-----   1 root       sys         64 0x000000 Oct 28  2006 /dev/vg00/group
crw-r-----   1 root       sys         64 0x010000 Feb 25 02:50 /dev/vgrecovery/group


And now I will import the volume group off the disk I want to put into that new vg - I know this on my system is /dev/dsk/c3t5d0 - on your system it was /dev/dsk/c2t5d0 - I will also activate the volume group and take a backup of it:


# vgimport /dev/vgrecovery /dev/dsk/c3t5d0
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.
# vgchange -a y /dev/vgrecovery
Activated volume group
Volume group "/dev/vgrecovery" has been successfully changed.
# vgcfgbackup /dev/vgrecovery
Volume Group configuration for /dev/vgrecovery has been saved in /etc/lvmconf/vgrecovery.conf


Ok let's take a look at what is on that disk I just put into a new volume group:


# vgdisplay -v /dev/vgrecovery
--- Volume groups ---
VG Name                     /dev/vgrecovery
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      1
Open LV                     1
Max PV                      16
Cur PV                      1
Act PV                      1
Max PE per PV               8683
VGDA                        2
PE Size (Mbytes)            4
Total PE                    8681
Alloc PE                    8681
Free PE                     0
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

   --- Logical volumes ---
   LV Name                     /dev/vgrecovery/lvol1
   LV Status                   available/syncd
   LV Size (Mbytes)            34724
   Current LE                  8681
   Allocated PE                8681
   Used PV                     1

   --- Physical volumes ---
   PV Name                     /dev/dsk/c3t5d0
   PV Status                   available
   Total PE                    8681
   Free PE                     0
   Autoswitch                  On
   Proactive Polling           On


I my case there's just one logical volume (lvol1) - on yours there will be a bunch more as there are a bunch of extra lvols in a root volume group usually. Anyway I can create mount points and look at the contents of my filesystems on that disk:


# mkdir /recovery
# mkdir /recovery/lvol1
# mount /dev/vgrecovery/lvol1 /recovery/lvol1
# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3     307200  162312  144120   53% /
/dev/vg00/lvol1     295024   40880  224640   15% /stand
/dev/vg00/lvol8    1843200 1498672  343376   81% /var
/dev/vg00/lvol7    2306048 1346664  952968   59% /usr
/dev/vg00/lvol4     204800  131136   73664   64% /tmp
/dev/vg00/lvol6    1794048 1740264   53784   97% /opt
/dev/vg00/lvol5      20480    2448   17896   12% /home
                   35557376  347601 33015103    1% /recovery/lvol1
# ls -l /recovery/lvol1
total 561238
drwxr-x---  34 root       sys           1024 Dec  8  2010 depot
-rw-r-----   1 root       sys        287344640 Oct 16  2012 gcc-4.2.3-hppa-11.11.depot
drwxr-xr-x   2 root       root            96 Jun  5  2009 lost+found


As you can see I have now mounted this filesystem and can see the contents. You will have a bunch more lvols that should roughly correspond to the logical volumes listed above (i.e. lvol1 will be /stand etc) - don't try and mount lvol2 as it is usually the swap partition and has no filesystem on it.

Let's see how you get on with that! Good luck!

I am an HPE Employee
Accept or Kudo
Occasional Advisor

Re: Need Help Accessing Hard Drive

You've been absolutely amazing! Thank you so much for your help! I do realize that it is an old version haha. Unfortunately we run a program called UMESS off from it still because one of our clients still uses some older programming methods. I have been dreading the day that one of these machines failed and here we are. I did everything above and I am able to view data on the disk now but it seems that some of the directories were corrupted from before. The files that I was looking for don't seem to be there but I greatly appreciate your help in all of this! 

If you have a moment to answer one more question...... I've got backup tapes but we were having some issues with backups before this all went down as well so I'm not sure if they are also corrupt. Is the process for viewing data on those similar to the process you described above? Do I create a new directory and then mount the device to that?


Re: Need Help Accessing Hard Drive

No you can't mount a tape as a filesystem... How the backups works will depend on how they were taken - do you know how the backup tapes were created? What commands were run to create them or even just what utility?


I am an HPE Employee
Accept or Kudo