You are here

Fix a boot disk with a corrupt lable while the mirror is split

we have split the mirror in vg00, we have patched succesfully.

We have the patched disk /dev/dsk/c2t1d0s2 with the normal lvols, And the backup disk /dev/dsk/c2t0d0s2 with the lvolb's:

root@rx4640:/HP> pvdisplay -v /dev/dsk/c2t1d0s2 | grep lvol1 | head -1
/dev/vg00/lvol1 19 19
root@rx4640:/HP> pvdisplay -v /dev/dsk/c2t0d0s2 | grep lvol1 | head -1
/dev/vg00/lvol1b 19 19

Once we reboot the server we can't start from our patched/primary disk:/dev/dsk/c2t1d0s2 , we can't access the /stand partition on the disk, to load the vmunix kernel:

HPUX> boot vmunix
Could not open file vmunix to check for a directory
Could not open vmunix

loading failed

HPUX>

HPUX> ls
no such file or directory

HPUX>

So we boot from our secondary disk:

HPUX> boot vmunix
> System Memory = 4067 MB
loading section 0
.......................................................... (complete)
loading section 1
.............. (complete)
loading symbol table
loading System Directory (boot.sys) to MFS
....
loading MFSFILES directory (bootfs) to MFS
..............
Launching /stand/vmunix
SIZE: Text:29364K + Data:7030K + BSS:5151K = Total:41546K

But the problem we have now is that the vmunix kernel we booted from is different from the new patched vmunix kernel we have in lvol1.

#dmesg

Aug 20 17:35
Magic number wrong (namelist mismatch?)

root@rx4640:/> lvlnboot -v vg00
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c2t1d0s2 (0/1/1/0.1.0) -- Boot Disk
/dev/dsk/c2t0d0s2 (0/1/1/0.0.0) -- Boot Disk
Boot: lvol1b on: /dev/dsk/c2t1d0s2
Root: lvol3 on: /dev/dsk/c2t1d0s2
Swap: lvol2 on: /dev/dsk/c2t1d0s2
Dump: lvol2 on: /dev/dsk/c2t1d0s2, 0

So we check both our lvol1 partitions and pass a fsck all is ok:

t@rx4640:/> fsck -y /dev/vg00/lvol1
file system is clean - log replay is not required
root@rx4640:/> fsck -y /dev/vg00/lvol1b
fsck: /etc/default/fs is used for determining the file system type
file system is clean - log replay is not required
root@rx4640:/>

So if /stand partition is ok, we need to check serveral things on the disk that doesn't boot, lvol1 is on the first pes on the disk, efi and LABLE file config:

lvol1 is on the first PE's of the disk:

root@rx4640:/> pvdisplay -v /dev/dsk/c2t1d0s2 |grep -E 'curren.*0000 $'
00000 current /dev/vg00/lvol1 00000
00019 current /dev/vg00/lvol2 00000
00275 current /dev/vg00/lvol3 00000
00310 current /dev/vg00/lvol4 00000
00323 current /dev/vg00/lvol5 00000
00325 current /dev/vg00/lvol6 00000
00698 current /dev/vg00/lvol7 00000
01086 current /dev/vg00/lvol8 00000

EFi is ok:

root@rx4640:/> efi_ls -d /dev/dsk/c2t1d0s1 EFI/HPUX
FileName Last Modified Size
. 12/31/1997 0
.. 12/31/1997 0
HPUX.EFI 8/22/2013 644703
NBP.EFI 8/22/2013 24576
AUTO 8/22/2013 12

total space 523251712 bytes, free space 508829696 bytes

We now compair the label between the disk that doesn't boot:

root@rx4640:/> lifls -l /dev/dsk/c2t1d0s2
volume ISL10 data size 7984 directory size 8 06/04/19 14:02:34
filename type start size implement created
===============================================================
ISL -12800 584 242 0 06/04/19 14:02:34
AUTO -12289 832 1 0 06/04/19 14:02:34
HPUX -12928 840 1024 0 06/04/19 14:02:34
PAD -12290 1864 1468 0 06/04/19 14:02:34
LABEL BIN 3336 8 0 12/08/22 22:05:04

and the one that does:

root@rx4640:/> lifls -l /dev/dsk/c2t0d0s2

volume ISL10 data size 7984 directory size 8 06/04/19 14:02:34
filename type start size implement created
===============================================================
ISL -12800 584 242 0 06/04/19 14:02:34
AUTO -12289 832 1 0 06/04/19 14:02:34
HPUX -12928 840 1024 0 06/04/19 14:02:34
PAD -12290 1864 1468 0 06/04/19 14:02:34
LABEL BIN 3336 8 0 08/06/15 17:09:50

As you can see the label created times don't match, so we can bet that the label on disk /dev/dsk/c2t1d0s2 is bad, so the this is how can we recreate the label, now that we have split the disks, and we can't do a lvlnboot -vR /dev/vg00, there is and easy way copy the LABEL file from the good disk to the patched bad disk:
root@rx4640:/> mkboot -el /dev/dsk/c2t1d0
root@rx4640:/> mkboot -a "boot vmunix -lq" /dev/dsk/c2t1d0
root@rx4640:/> lifrm /dev/dsk/c2t1d0s2:LABEL
root@rx4640:/> lifcp -b /dev/dsk/c2t0d0s2:LABEL /dev/dsk/c2t1d0s2:LABEL
root@rx4640:/> lifls -l /dev/dsk/c2t1d0s2
volume ISL10 data size 7984 directory size 8 06/04/19 14:02:34
filename type start size implement created
===============================================================
ISL -12800 584 242 0 06/04/19 14:02:34
AUTO -12289 832 1 0 06/04/19 14:02:34
HPUX -12928 840 1024 0 06/04/19 14:02:34
PAD -12290 1864 1468 0 06/04/19 14:02:34
LABEL BIN 3332 8 0 13/08/22 22:26:42

we can now reboot our server, and boot from the primary disk:

HP-UX Boot Loader for IPF -- Revision 2.028

Press Any Key to interrupt Autoboot
\EFI\HPUX\AUTO ==> boot vmunix -lq
Seconds left till autoboot - 9
Type 'help' for help

HPUX> ls
AUTO actual_kernel backup boot.sys bootconf
bootfs crashconfig current ioconfig kernrel
krs last_install lost+found nextboot rootconf
system system.import system.prev vmunix

HPUX> boot vmunix -lq
> System Memory = 4067 MB
loading section 0
.......................................................... (complete)

We can check we have booted from our patched disk and that all is ok, dmesg working again:

root@rx4640:/> ll /dev/dsk | grep $(echo "bootdev/x"|adb /stand/vmunix /dev/kmem | awk '/0x/ {print substr($1,5)}')
brw-r----- 1 bin sys 31 0x020002 Apr 20 2007 c2t1d0s2
root@rx4640:/> lvlnboot -v vg00
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c2t1d0s2 (0/1/1/0.1.0) -- Boot Disk
/dev/dsk/c2t0d0s2 (0/1/1/0.0.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c2t1d0s2
Root: lvol3 on: /dev/dsk/c2t1d0s2
Swap: lvol2 on: /dev/dsk/c2t1d0s2
Dump: lvol2 on: /dev/dsk/c2t1d0s2, 0

root@rx4640:/> dmesg | tail -1
SCSI: Ultra160 Controller at 0/1/1/1: Warning: Data transfer rate stepped down for target 14. Now operating at 40 MB/s (Ultra2 Narrow). Possible causes are improper termination, improper cabling, or malfunctioning hardware.

Now we can merge our lvolb, when we check the patches are working ok.

Unix Systems: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.
Error | HP-UX Tips & Tricks Site

Error

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /homepages/37/d228974590/htdocs/includes/common.inc:2567) in drupal_send_headers() (line 1207 of /homepages/37/d228974590/htdocs/includes/bootstrap.inc).
  • PDOException: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user 'dbo229817041'@'217.160.155.192' for table 'watchdog': INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => cron [:db_insert_placeholder_2] => Attempting to re-run cron while it is already running. [:db_insert_placeholder_3] => a:0:{} [:db_insert_placeholder_4] => 4 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://hpuxtips.es/?q=content/fix-boot-disk-corrupt-lable-while-mirror-split [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 54.162.3.15 [:db_insert_placeholder_9] => 1503350543 ) in dblog_watchdog() (line 157 of /homepages/37/d228974590/htdocs/modules/dblog/dblog.module).
The website encountered an unexpected error. Please try again later.