LVM and VxVM

How to mount a root file system for repair

 
Bob Viveney_1
Occasional Advisor

How to mount a root file system for repair

Hi
I have a disk with hp-ux 11.31 on it that will not boot and I'd like to boot from another disk and repair it. (I just need to move /tmp/vmunix back to /stand I believe to fix the problem - it was moved out in preparation for a kernel build that did not occur.)

How do I mount the file systems from the disk I need to repair so that I can fix them while booted from another disk?
Thanks
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: How to mount a root file system for repair

Shalom,

You get hpux 11.31 pre-release?

Boot off the Core OS CD. Then use fsck on the root fs.

You may need to mount /usr on the system to find fsck

/usr/sbin/fsck

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
Bob Viveney_1
Occasional Advisor

Re: How to mount a root file system for repair

Maybe I haven't stated the problem clearly.
The disk already is partitioned and installed with hp-ux. But /stand/vmunix can not be found. I need to mount the logical volumes for /tmp and /stand on that disk to fix it.

So /dev/vg00 is active and the disk I want
to fix also has an OS on and is configured the same way. So how do I mount the lvols from disk c7t8d0 so that I can manipulate the data there while booted from disk c2t6d0?

Am I stating the problem clearly? I'd like to mount the 2nd disk under /tmp/ so that I can 'mv /tmp/tmp/vmunix /tmp/stand/'.

Thanks
TwoProc
Honored Contributor

Re: How to mount a root file system for repair

If you can get the pvdisplay extents EXACTLY as they are on the disk - you can just do a lvcreate for each lvol on the disk - but you must do them in order, and for the exact number of extents (and extent size) that you had before. Then you can just mount the lvol that is associated with the /tmp and /stand and fix away.

Normally, before doing this one would have gotten a vgexport and just do a vgimport on the disk. Or, you could run vgscan to get that volume group (of presumably one disk) back - but I don't think you can get back a vg00 when you already are running on vg00 (it would probably not run, or mess up your OS partition).

So, I think you're stuck with trying to match new lvols with the old one (by correct number and placement of exact extents), and then mounting the lvols from there.

We are the people our parents warned us about --Jimmy Buffett
OldSchool
Honored Contributor

Re: How to mount a root file system for repair

if you reboot system and go into single user mode, can you then:

vgchange -a vg00
cd /tmp
mkdir tmp stand
mount /dev/vg00/lvol6 /tmp/tmp
mount /dev/vg00/lvol1 /tmp/stand

Or did I misunderstand something?
Bob Viveney_1
Occasional Advisor

Re: How to mount a root file system for repair

Problem solved. I was able to boot from /stand/current/vmunix.
Thanks
Steven E. Protter
Exalted Contributor

Re: How to mount a root file system for repair

Hi Bob,

If /stand filesystem and its logical volume are gone, I assumed the system is unbootable.

Therefore I recommended that in order to do what you wish, you needed a means of booting the system. Hence the Core OS CD/DVD.

If the system is in fact still running, the mount command may fail due to the current state of the /stand filesystem.

If the system is not running:
Boot at the console
intervene at the 10 second prompt.

sea

bo P2 # if in fact P2 is the DVD drive. Commonly that is P0 on modern systems.

The procedure is slightly different for an Itanium system, but you don't state the hardware model so how am I to know?

After booting, you can try to mount the logical volume that was /stand and copy in the vmunix file.

Hopefully this is enough detail to proceed.

Once the system is runing:

mount lvolpath /filesystem_mount_point

The lvol path should still be there.

also: the Core OS cd/dvd has recovery mode which can recover the system by merely copying in the corect files such as vmunix. It doesn't require detailed technical skills to recover the system under these circumstances, but it depends on how /stand was hammered in the first place.

You still may need to follow my original recommandation which involves fsck. You should try fsck prior to trying to mount /stand

Given the still incomplete nature of this thread, this is the best I can do. Hardware model and processor type would be helpful.

Also, since 11.31 is not release software what I'm saying is based on a decade of experience with OTHER HP-UX releases. Your milage may vary.

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
Bob Viveney_1
Occasional Advisor

Re: How to mount a root file system for repair

Booted from /stand/current/vmunix