Showing posts with label boot. Show all posts
Showing posts with label boot. Show all posts

31 July 2010

How to skip a service while starting in HP-UX

During the HP-UX OS booting,if you want the service/daemon need to be skipped  press crtl + backslash.

Most of us tried pressing ctrl + c, that wont work during the booting

22 December 2009

HP-UX Boot process


HP-UX OS Boot Process - PA-RISC Machines

16 November 2007

How to view the initial RAMDISK file in Redhat linux - PART 2

ls output of the RAMDISK directory

$
ls -l


total 68
drwx------ 2 root root 4096 Nov 16 16:03 bin
drwx------ 3 root root 4096 Nov 16 16:03 dev
drwx------ 2 root root 4096 Nov 16 16:03 etc
-rwx------ 1 root root 1979 Nov 16 16:03 init
drwx------ 3 root root 4096 Nov 16 16:03 lib
drwx------ 2 root root 4096 Nov 16 16:03 proc
lrwxrwxrwx 1 root root 3 Nov 16 16:03 sbin -> bin
drwx------ 2 root root 4096 Nov 16 16:03 sys
drwx------ 2 root root 4096 Nov 16 16:03 sysroot

Tree command output

$tree
.
|-- bin
| |-- dmraid
| |-- insmod
| |-- kpartx
| |-- modprobe -> /sbin/nash
| `-- nash
|-- dev
| |-- console
| |-- mapper
| |-- null
| |-- ptmx
| |-- ram -> ram1
| |-- ram0
| |-- ram1
| |-- rtc
| |-- systty
| |-- tty
| |-- tty0
| |-- tty1
| |-- tty10
| |-- tty11
| |-- tty12
| |-- tty2
| |-- tty3
| |-- tty4
| |-- tty5
| |-- tty6
| |-- tty7
| |-- tty8
| |-- tty9
| |-- ttyS0
| |-- ttyS1
| |-- ttyS2
| |-- ttyS3
| `-- zero
|-- etc
|-- init
|-- lib
| |-- cciss.ko
| |-- ehci-hcd.ko
| |-- ext3.ko
| |-- firmware
| |-- jbd.ko
| |-- ohci-hcd.ko
| |-- scsi_mod.ko
| |-- sd_mod.ko
| |-- uhci-hcd.ko
| `-- usb-storage.ko
|-- proc
|-- sbin -> bin
|-- sys
`-- sysroot

10 directories, 42 files

NASH Script Contents

$
cat init

#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
...
...
...
...
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo "Loading uhci-hcd.ko module"
insmod /lib/uhci-hcd.ko
echo "Loading ohci-hcd.ko module"
insmod /lib/ohci-hcd.ko
echo "Loading ehci-hcd.ko module"
insmod /lib/ehci-hcd.ko
mount -t usbfs /proc/bus/usb /proc/bus/usb
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading cciss.ko module"
insmod /lib/cciss.ko
echo "Loading usb-storage.ko module"
insmod /lib/usb-storage.ko
echo Waiting for driver initialization.
stabilized /proc/bus/usb/devices
echo Waiting for driver initialization.
stabilized --hash --interval 250 /proc/scsi/scsi
mkblkdevs
echo Scanning and configuring dmraid supported devices
resume LABEL=SW-cciss/c0d0p2
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro cciss!c0d0p1
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot

How to view the initial RAMDISK file in Redhat linux - PART 1

1.Copy the initial ramdisk to some other location as gz file

$cp /boot/initrd-2.6.18-37.el5xen.img /tmp/test/initrd-2.6.18-37.el5xen.gz

2.Decompress the file as

$
gunzip /tmp/test/initrd-2.6.18-37.el5xen.gz
$cd /tmp/test
$ls
$initrd-2.6.18-37.el5xen

3.Create a directory and use cpio command as

$ mkdir /tmp/test/initrd
$
cd /tmp/test/initrd
$
cpio -cidv -I ../initrd-2.6.18-37.el5xen

* i: Restore archive / extract
* d: Create leading directories where needed
* v: Verbose i.e. display progress
* c: Identical to "-H newc" i.e., -H FORMAT(Use archive format)., newc is a new (SVR4) portable format,which supports file
systems having more than 65536 i-nodes
* I: Archive filename to use instead of standard input

$ ls
$
bin dev etc init lib proc sbin sys sysroot

Then use the tree command to view the contents.
initrd file has a nash script that is used to load kernel modules.View the script with the command cat init to see what modules are loaded.