Showing posts with label Boot Process. Show all posts
Showing posts with label Boot Process. Show all posts

Thursday, 24 November 2011

Content of MBR in Linux : How to Read?

- Thanks Deepthi

To see the contents of your MBR, use this command:

# dd if=/dev/hda of=mbr.bin bs=512 count=1
# od -xa mbr.bin
The dd command, which needs to be run from root, reads the first 512 bytes from /dev/hda (the first Integrated Drive Electronics, or IDE drive) and writes them to the mbr.bin file.

The od command prints the binary file in hex and ASCII formats.

Server not booting at EFI shell ?? HP-UX or the EFI's NVRAM image is wrong ?

If the EFI Bootcode points to incorrect block of the disk, so the boot services terminates.
HP-UX or the EFI's NVRAM image is wrong..we need to detect the problem and rectify it.

How to do that:

1. After server restart using EFI enter in "boot option maintenance menu"

2. select "add boot option"

3. select partition written like "IA64 EFI [Acpi(HWP0002,100)/Pci(1|0)/Scsi(Pun0,Lun0)....]

4. "select file or change directory" message will appear now

5. Using narrow keys select directory and enter inside

6. Using the menu try to find the "HPUX.efi" and select that file and hit enter.

7.Now it will ask confirmation to save (Enter yes) : It will save the new option to NVRAM.

8.Then navigate to the starting EFI menu where boot devices are listed and there will be option "HPUX" or similar just hit enter on it.

9.That's the alternative path - adding the boot option of HP-UX again.

Enable /Disable autoboot using "setboot" command :

To make auto boot on:

# setboot -b on

To make autoboot OFF

# setboot -b off

# setboot
Primary bootpath : 0/1/1/0.1.0
HA Alternate bootpath :
Alternate bootpath : 0

Autoboot is ON (enabled) <<<==This means its on # setboot Primary bootpath : 0/1/1/0.1.0 HA Alternate bootpath :
Alternate bootpath : 0

Autoboot is OFF (disabled) <<==Now it is OFF

Patch requires reboot or not ?? How to verify ??

You can verify a patch's reboot requirement with below command:

# swlist -d -l fileset -a is_reboot *.*,c=patch @ /tmp/depot | grep true

Here i consider that /tmp/patch is my depot path.

You want manual reboot after install the patch ? then follow below steps

If a patch requires a reboot AND you do not want the system to reboot automatically
at the end of the swinstall THEN you set autoreboot=false though you must then reboot manually later.

#swinstall -x autoreboot=false -s /tmp/depot

Wednesday, 23 November 2011

Create Startup /shutdown script in HP UX :- How to??

Startup and shut down script has 3 parts

1.Original script in /sbin/init.d

2.Configuratiopn file for the script in /etc/rc.config.d
(configuration variables in /etc/rc.config.d to change the behavior of scripts in
/sbin/init.d.)

3.Symlink file for the scripts under /sbin/rc*.d/


How to enable startup/shutdown scripts

Step1 : First place the script under the directory /sbin/init.d/

Step2 : Then create a sym link to the script file

Start a service : ln -s /sbin/init.d/ur_script /sbin/rc3.d/S900urscript.rc

stop a service : ln -s /sbin/init.d/ur_script /sbin/rc3.d/K900Ur_script.rc

3. Place the configuration file under /etc/rc.config.d with required variables (optional)


For Examble : CRON service

/sbin/init.d/cron --> execution script
/etc/rc.config.d/cron --> configuration file
/sbin/rc2.d/S730cron --> start sequence symbolic link
/sbin/rc1.d/K270cron --> kill sequence symbolic link

Thursday, 17 November 2011

Which disk server got booted ?


To find out the disk from which the server got booted, we need to use below command

#ll  /dev/disk | grep $(echo "bootdev/x"|adb /stand/vmunix /dev/kmem | awk '/0x/ {print substr($1,5)}')

examble :
root:server1# ll /dev/disk | grep $(echo "bootdev/x"|adb /stand/vmunix /dev/kmem | awk '/0x/ {print substr($1,5)}')
brw-r-----   1 bin        sys          1 0x000003 Jul 13  2010 disk3_p2
root:server1#