Operating System - HP-UX
1832594 Members
2927 Online
110043 Solutions
New Discussion

Re: Need Help Accessing Hard Drive

 
SOLVED
Go to solution
incaltech
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?

19 REPLIES 19

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
incaltech
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
incaltech
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
incaltech
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

Solution

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
/dev/vgrecovery/lvol1
                   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
incaltech
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
incaltech
Occasional Advisor

Re: Need Help Accessing Hard Drive

I'm unsure about what command was used to create the tape. I know that the machine is setup to take backups automatically every monday, wednesday and friday. I started doing some searching myself and found three different way mentioned online (dd, tar and cpio). I also did some digging into past manuals that I had on hand from the gentleman before me and he had a page marked for backup tapes using the cpio command.

I tried cpio and got a message that said "End of Volume" and then wanted me to feed it another directory as if it expected a continuation of data from somewhere else. With tar I got "Tape Read Error" and with the dd command I got "Read Error: I/O Error".  I'm not sure if this confirms my suspicions of corruption on the tapes as well?

Re: Need Help Accessing Hard Drive

Depends very much on the commands you are using and the tape device you are using. What tape device are you using? (show the output if "ioscan -funC tape") WHat exact cpio/dd/tar commands did you try?


I am an HPE Employee
Accept or Kudo
incaltech
Occasional Advisor

Re: Need Help Accessing Hard Drive

When I entered the ioscan command, it came back blank with each tape that I put in. The tape drive shows up in SAM so I'm not sure if its just not recognizing these tapes? The tapes physically show that they are DDS-2 4mm Data Cartridges 120m 4GB native/8GB compressed (Mixed brands between HP, Maxwell and Fujifilm). 

The exact commands that I tried were:
tar -tvf /dev/rmt/0m
dd if=/dev/rmt/0m of=/home/recovery
tcio -i /dev/rmt/0m | cpio -ictv
cpio -ictv < /dev/rmt/0m

Also, I'm not sure if this helps any but I went into "Application Manager>System Admin>SAM>Backup and Recovery>Automated Backups" within the OS GUI and found that this is what has been creating these backup tapes. 

Re: Need Help Accessing Hard Drive

If the ioscan isn't reporting anything at all, that suggests there's a problem accessing the tape drive - even without a tape in the drive you should get something back on the ioscan. Can you post the full output of:

ioscan -fn

 


I am an HPE Employee
Accept or Kudo
incaltech
Occasional Advisor

Re: Need Help Accessing Hard Drive

I ended up typing this all in to the textbox so I didn't include any of the file paths except for the ones that were associated with the tape drive to save time. If you need any of that information as well then I'll get it to you though!

>ioscan -fn
Class             I        Driver     S/W State     H/W Type               Description
======================================================================
bc                 0       root         Claimed        Bus_Nexus
bc                 1        ccio2       Claimed        Bus_Nexus             I/O Adapter
ba                0       lba           Claimed        Bus_Nexus             PCI Bus Bridge - lba
audio           0       audio       Claimed        Interface                Built-in Audio
ext_bus       0        side         Claimed        Interface                IDE
target         0        tgt           Claimed         Device              
disk             0        sdisk        Claimed        Device                   Mitsumi CD-Rom FX4830T!B
target          1        tgt            Claimed        Device                     
ctl                0       sctl           Claimed        Device                    Initiator
ba                1        superio    Claimed        Bus_Nexus             PCI Core I/O Adapter
tty               0        asio0      Claimed         Interface                Built-in RS-232C
ext_bus       1         scentif    Claimed         Interface                 Built-in Parallel Interface
siopc           0        siofdc      Claimed        Interface                Built-in Floppy Drive
floppy         0        sioflop      Claimed       Device                    HP_PC_FDC_FLOPPY
usb              0        hcd          Claimed       Device                    Built-in usb interface
usb hub      0         hub         Claimed       Device                    usb root hub
usb hid        2         hid          Claimed       Device                    usb hid kbd(0)
usb hid        1          hid          Claimed       Device                    usb hid mouse(1)
ext_bus        2         c720        Claimed      Interface                 Ultra2 Wide LVD SCSI
target           2         tgt           Claimed       Device                   
disk              1          sdisk       Claimed        Device                   Compaq BD018635cc
target           3         tgt           Claimed        Device       
ctl                 1          sctl          Claimed       Device                    Initiator
ba                 2         lba           Claimed        Bus_Nexus             PCI BUS Bridge - lba
graphics       0        graph3     Claimed        Interface               PCI (103c108b) -- Built-in #5
graphics       1         graph3     Claimed        Interface               PCI (103c1008) -- 1
ext_bus        3         c720         Claimed       Interface                Ultra Wide SCSI
target           5         tgt             Claimed      Device
tape              0        stape        Claimed       Device                    HP C1533A
                                /dev/dat                        /dev/rmt/0mn         /dev/rmt/c3t3d0Bestb           
                                /dev/rmt/0m                 /dev/rmt/0mnb      /dev/rmt/c3t3d0Bestn
                                /dev/rmt/0mb               /dev/rmt/c3t3d0Best /dev/rmt/c3t3d0Bestnb        
target           4         tgt            Claimed      Device                    
ctl                 2          sctl          Claimed       Device                    Initiator       
lan                1           btlan5      Claimed      Interface                PCI (10110019) -- 4
processor     0          processor                   processor               processor
memory        0         memore                       memory                 memory

incaltech
Occasional Advisor

Re: Need Help Accessing Hard Drive

^The tape drive showed up in this last command. I went back and used the '"ioscan -funC tape" command you had asked for earlier and now that is also showing what it's supposed to as well. I'm unsure if I was typing in something wrong before or if my machine was just being difficult.

Re: Need Help Accessing Hard Drive

If the backups were created from within SAM then they will be in fbackup/frecover format, so tar/cpio/dd would probably not help.

frecover should default to using /dev/rmt/0m which I think is your tape drive, so with the tape in try the following commands:

frecover -I /tmp/index
frecover -V /tmp/volheader

if the tape is in that format then that should recover a volume header (which will tell you a bit about when the backup was done) and an index (which will tell you the files that were backed up) . 

Post the output of those commadns here (don't post the /tmp/index file if it is created - it will probably be too big, but if it works you should be able to determine if the data you want is on the tape)


I am an HPE Employee
Accept or Kudo
incaltech
Occasional Advisor

Re: Need Help Accessing Hard Drive

Unfortunately there was still no luck on this one. I tried a few of my tapes. One of the older ones I had on hand sounded like it was doing something in the tape drive for a few moments and then didn't output anything but rather just went back to the command prompt.  A couple of attempts resulted in the following string of messages:

>frecover -I /tmp/index
frecover(2105): Did not find the expected file marker
frecover(5409): Unable to read a volume header
frecover(5418): Not an fbackup volume; unable to read volume header
frecover(5412):  Do you wish to try and salvage this volume? [yes   no]

And another tape gave this output....

>frecover -I /tmp/index
frecover(5403): Unable to open or identify device at /dev/rmt/0m
frecover(5432): Media rewind failed
frecover(5402): Failed close on device /dev/rmt/0m
frecover(5404): Press return when the next volume is ready on /dev/rmt/0m:

Re: Need Help Accessing Hard Drive

hmmm - I think your tape drive may also be goosed :o(

Any indication of recent chnages to the system log file that might give us a clue if that's the case?

 /var/adm/syslog/syslog.log


I am an HPE Employee
Accept or Kudo

Re: Need Help Accessing Hard Drive

incidentally if this command that you tried:

dd if=/dev/rmt/0m of=/home/recovery

was resulting in absolutely nothing being written into the file /home/recovery (it would need to not exist and not be a directory before you tried it) then either the tape drive is bust, or there is nothing on that tape, as the dd command literaly just reads a raw stream of data off the tape until it encounters an end-of-file marker.


I am an HPE Employee
Accept or Kudo