Configure PXE Server to automate Oracle Linux 6 unattended installation via network

I am using http method (My images are hosted on the web server)

I configured my virtual machine as below

Memory 2gb
Processors 1
Hard disk (SCSI) 30gb
Network Adapter Bridged(Automatic) (For Internet access and yum installation)
Network Adapter 2 Custom (VMnet4) ( Having IP 192.168.222.1 netmask 255.255.255.0 only for pxe server)

After installing oracle linux server 6.0 configure ip address for network adapter 2

setup public yum server using my guide as per below link.

http://sunilthetechfreak.com/2012/07/18/how-to-setup-public-yum-for-all-updates-on-oracle-linux-6/

The required packages for PXE Server (xinetd,syslinux,dhcpd,tftp-server,httpd)

# install the packages

yum install -y syslinux xinetd tftp-server dhcp httpd

# Enable tftp server & start tftp service

vi /etc/xinetd.d/tftp
Disable=no (only change this line from the tftp file)

service xinetd restart or /etc/init.d/xinetd restart
chkconfig xinetd on (To auto start the service when the system boot)

# Configure DHCP server & start the dhcp service
vi /etc/dhcp/dhcpd.conf

#Global options (also important for pxe booting)

lease-file-name “/var/lib/dhcpd/dhcpd.leases”;
allow booting;
allow bootp;
authoritative;

#subnet of our local network

subnet 192.168.222.0 netmask 255.255.255.0

{

# Parameters for local subnet
option subnet-mask 255.255.255.0;
option domain-name “localdomain”
option domain-name-servers 192.168.222.1; #(This is optional, but i am pointing it to this same server)
default-lease-time 21600;
max-lease-time 43200;

# Client ip range (the range defined here will be given to the client which request the ip for auto installation)

range dynamic-bootp 192.168.222.20 192.168.222.50;

#very important for pxe booting

filename “pxelinux.0”;
next-server 192.168.222.1; (I am point to this same pxe server)

}

#save & close

service dhcpd restart or /etc/init.d/dhcpd restart
chkconfig dhcpd on

# create required directory to copy oracle linux 6 media

[root@oel6-server1 sunil]# mkdir -p /var/pxe/ol6
[root@oel6-server1 sunil]# mkdir -p /var/lib/tftpboot/ol6

#mount the oracle linux 6 dvd or iso file which ever is available

[root@oel6-server1 sunil]# cd /media
[root@oel6-server1 media]# ls
OL6.0 x86_64 Disc 1 20110203

[root@oel6-server1 media]# cd OL*

# Check the contents to see if it is properly mounted.

[root@oel6-server1 OL6.0 x86_64 Disc 1 20110203]# ls -l
total 706
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 EFI
-rw-r–r–. 1 sunil sunil 7041 Feb 4 2011 EULA
-rw-r–r–. 1 sunil sunil 7041 Feb 4 2011 eula.en_US
-rw-r–r–. 1 sunil sunil 3334 Feb 4 2011 eula.py
-rw-r–r–. 1 sunil sunil 18390 Feb 4 2011 GPL
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 HighAvailability
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 images
drwxr-xr-x. 2 sunil sunil 2048 Feb 4 2011 isolinux
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 LoadBalancer
-rw-r–r–. 1 sunil sunil 98 Feb 4 2011 media.repo
drwxr-xr-x. 2 sunil sunil 614400 Feb 4 2011 Packages
-rw-r–r–. 1 sunil sunil 2613 Feb 4 2011 README-en
-rw-r–r–. 1 sunil sunil 7046 Feb 4 2011 README-en.html
-rw-r–r–. 1 sunil sunil 16807 Feb 4 2011 RELEASE-NOTES-en
-rw-r–r–. 1 sunil sunil 19168 Feb 4 2011 RELEASE-NOTES-en.html
lrwxrwxrwx. 1 sunil sunil 15 Feb 4 2011 repodata -> Server/repodata
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 ResilientStorage
-rw-r–r–. 1 sunil sunil 1011 Feb 4 2011 RPM-GPG-KEY
-rw-r–r–. 1 sunil sunil 1011 Feb 4 2011 RPM-GPG-KEY-oracle
drwxr-xr-x. 3 sunil sunil 2048 Feb 4 2011 ScalableFileSystem
drwxr-xr-x. 4 sunil sunil 2048 Feb 4 2011 Server
-rw-r–r–. 1 sunil sunil 108 Feb 4 2011 supportinfo
-r–r–r–. 1 sunil sunil 5357 Feb 4 2011 TRANS.TBL

# copy all the contents to the /var/pxe/ol6 directory.

[root@oel6-server1 OL6.0 x86_64 Disc 1 20110203]# cp –ivr * /var/pxe/ol6

# now copy the kernel & image file from images folder to tftpboot/ol6 directory

[root@oel6-server1 pxeboot]# pwd
/var/pxe/ol6/images/pxeboot

[root@oel6-server1 pxeboot]# ls -l
total 33044
-rw-r–r–. 1 root root 30039242 Jul 9 21:06 initrd.img
-r–r–r–. 1 root root 441 Jul 9 21:06 TRANS.TBL
-rwxr-xr-x. 1 root root 3791744 Jul 9 21:06 vmlinuz

# copy the vmlinuz and initrd.img files to the tftpboot directory.

[root@oel6-server1 pxeboot]# cp vmlinuz /var/lib/tftpboot/ol6
[root@oel6-server1 pxeboot]# cp initrd.img /var/lib/tftpboot/ol6

[root@oel6-server1 pxeboot]# cd /usr/share/syslinux

# copy the menu file.

[root@oel6-server1 syslinux]# cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot

#create folder

[root@oel6-server1 sunil]# mkdir -p /var/lib/tftpboot/pxelinux.cfg

# create default menu file

[root@oel6-server1 sunil]# vi /var/lib/tftpboot/pxelinux.cfg/default
timeout 100
default menu.c32

menu title =======Network Boot Menu=======
label 1
menu label ^ 1) Oracle Linux 6
kernel ol6/vmlinuz
append initrd=ol6/initrd.img ks=http://192.168.0.70/ks/ks.cfg ksdevice=eth0

# save and close

# now configure the webserver (Apache server to get the installation files)

[root@oel6-server1 sunil]# vi /etc/httpd/conf.d/pxeboot.conf

Alias /ol6 /var/pxe/ol6

Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.222.0/24 192.168.1.0/24

#save & close restart the webserver

service httpd restart or /etc/init.d/httpd restart
chkconfig httpd on

#now create kickstart file as per the required configuration

yum install -y system-config-kickstart

system-config-kickstart # you can configure the system as per your requirement

[root@oel6-server1 sunil]# mkdir /var/www/html/ks

# As i already have anaconda-ks.cfg from my earlier installation i will use the same

[root@oel6-server1 sunil]# cp /root/anaconda-ks.cfg /var/www/html/ks/ks.cfg

# Change the permission as below

chmod 644 /var/www/html/ks/ks.cfg

# check if you are able to browse both the installation media & kickstart file from the webserver

Oracle Linux 6 Http image
http://192.168.222.1/ol6

ks file
http://192.168.222.1/ks/ks.cfg

# Stop the Linux firewall

[root@oel6-server1 sunil]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@oel6-server1 sunil]# chkconfig iptables off

# restart all the service httpd,dhcp, xinetd

#configure a new virtual machine using the same network adapter setting Custom (VMnet4) and test your installation. if you have any queries do write to me so i would be able to help.

Error while starting dhcp Server (dhcpd service) in Oracle Linux 6

can’t open /var/lib/dhcpd/dhcpd.leases

[root@oel6-server1 dhcpd]# service dhcpd restart
Starting dhcpd: [FAILED]

[root@oel6-server1 dhcpd]# tail -20 /var/log/messages
Jul 9 16:50:06 oel6-server1 dhcpd: Configuration file errors encountered — exiting
Jul 9 16:50:06 oel6-server1 dhcpd:
Jul 9 16:50:06 oel6-server1 dhcpd: This version of ISC DHCP is based on the release available
Jul 9 16:50:06 oel6-server1 dhcpd: on ftp.isc.org. Features have been added and other changes
Jul 9 16:50:06 oel6-server1 dhcpd: have been made to the base software release in order to make
Jul 9 16:50:06 oel6-server1 dhcpd: it work better with this distribution.
Jul 9 16:50:06 oel6-server1 dhcpd:
Jul 9 16:50:06 oel6-server1 dhcpd: Please report for this software via the Oracle Bugzilla site:
Jul 9 16:50:06 oel6-server1 dhcpd: http://bugzilla.oracle.com
Jul 9 16:50:06 oel6-server1 dhcpd:
Jul 9 16:50:06 oel6-server1 dhcpd: exiting.
Jul 9 16:50:57 oel6-server1 dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Jul 9 16:50:57 oel6-server1 dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Jul 9 16:50:57 oel6-server1 dhcpd: All rights reserved.
Jul 9 16:50:57 oel6-server1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Jul 9 16:50:57 oel6-server1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Jul 9 16:50:57 oel6-server1 dhcpd: Can’t open lease database /var/lib/dhcpd/dhcp.leases: No such file or directory —

SOLUTION
When I checked the file as below the owner of dhcpd.lease file was dhcpd

[root@oel6-server1 dhcpd]# ls -ltr
total 0
-rw-r–r–. 1 dhcpd dhcpd 0 Dec 20 2012 dhcpd.leases
-rw-r–r–. 1 dhcpd dhcpd 0 Dec 20 2012 dhcpd6.leases

So I changed the permission to root and restarted the service

[root@oel6-server1 dhcpd]# chown root dhcpd.leases
[root@oel6-server1 dhcpd]# ls -ltr
total 0
-rw-r–r–. 1 root dhcpd 0 Dec 20 2012 dhcpd.leases
-rw-r–r–. 1 dhcpd dhcpd 0 Dec 20 2012 dhcpd6.leases
[root@oel6-server1 dhcpd]# service dhcpd restart
Starting dhcpd: [ OK ]

Transaction Check Error while installing DHCP on Oracle Linux 6.0

[root@oel6-server1 /]# yum install -y dhcp
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
No package resolvedep available.
Resolving Dependencies
–> Running transaction check
—> Package dhcp.x86_64 12:4.1.1-34.P1.0.1.el6 will be installed
–> Processing Dependency: dhcp-common = 12:4.1.1-34.P1.0.1.el6 for package: 12:dhcp-4.1.1-34.P1.0.1.el6.x86_64
–> Processing Dependency: portreserve for package: 12:dhcp-4.1.1-34.P1.0.1.el6.x86_64
–> Running transaction check
—> Package dhcp-common.x86_64 12:4.1.1-34.P1.0.1.el6 will be installed
—> Package portreserve.x86_64 0:0.0.4-9.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

Package Arch Version Repository Size

Installing:
dhcp x86_64 12:4.1.1-34.P1.0.1.el6 ol6_latest 815 k
Installing for dependencies:
dhcp-common x86_64 12:4.1.1-34.P1.0.1.el6 ol6_latest 140 k
portreserve x86_64 0.0.4-9.el6 ol6_latest 22 k

Transaction Summary

Install 3 Package(s)

Total size: 978 k
Installed size: 2.1 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test

Transaction Check Error:
file /usr/share/man/man5/dhcp-eval.5.gz from install of dhcp-common-12:4.1.1-34.P1.0.1.el6.x86_64 conflicts with file from package dhclient-12:4.1.1-12.P1.el6.x86_64
file /usr/share/man/man5/dhcp-options.5.gz from install of dhcp-common-12:4.1.1-34.P1.0.1.el6.x86_64 conflicts with file from package dhclient-12:4.1.1-12.P1.el6.x86_64

Solution

[root@oel6-server1 /]# yum update dhclient
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with ULN.
ULN support will be disabled.
Setting up Update Process
Resolving Dependencies
–> Running transaction check
—> Package dhclient.x86_64 12:4.1.1-12.P1.el6 will be updated
—> Package dhclient.x86_64 12:4.1.1-34.P1.0.1.el6 will be an update
–> Processing Dependency: dhcp-common = 12:4.1.1-34.P1.0.1.el6 for package: 12:dhclient-4.1.1-34.P1.0.1.el6.x86_64
–> Running transaction check
—> Package dhcp-common.x86_64 12:4.1.1-34.P1.0.1.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Updating:
dhclient x86_64 12:4.1.1-34.P1.0.1.el6 ol6_latest 316 k
Installing for dependencies:
dhcp-common x86_64 12:4.1.1-34.P1.0.1.el6 ol6_latest 140 k

Transaction Summary
================================================================================================================================
Install 1 Package(s)
Upgrade 1 Package(s)

Total size: 456 k
Total download size: 316 k
Is this ok [y/N]: y
Downloading Packages:
dhclient-4.1.1-34.P1.0.1.el6.x86_64.rpm | 316 kB 00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 12:dhcp-common-4.1.1-34.P1.0.1.el6.x86_64 1/3
Updating : 12:dhclient-4.1.1-34.P1.0.1.el6.x86_64 2/3
Cleanup : 12:dhclient-4.1.1-12.P1.el6.x86_64 3/3
Verifying : 12:dhcp-common-4.1.1-34.P1.0.1.el6.x86_64 1/3
Verifying : 12:dhclient-4.1.1-34.P1.0.1.el6.x86_64 2/3
Verifying : 12:dhclient-4.1.1-12.P1.el6.x86_64 3/3

Dependency Installed:
dhcp-common.x86_64 12:4.1.1-34.P1.0.1.el6

Updated:
dhclient.x86_64 12:4.1.1-34.P1.0.1.el6

Complete!

[root@oel6-server1 /]# yum install -y dhcp
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package dhcp.x86_64 12:4.1.1-34.P1.0.1.el6 will be installed
–> Processing Dependency: portreserve for package: 12:dhcp-4.1.1-34.P1.0.1.el6.x86_64
–> Running transaction check
—> Package portreserve.x86_64 0:0.0.4-9.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Installing:
dhcp x86_64 12:4.1.1-34.P1.0.1.el6 ol6_latest 815 k
Installing for dependencies:
portreserve x86_64 0.0.4-9.el6 ol6_latest 22 k

Transaction Summary
================================================================================================================================
Install 2 Package(s)

Total size: 837 k
Installed size: 1.9 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : portreserve-0.0.4-9.el6.x86_64 1/2
Installing : 12:dhcp-4.1.1-34.P1.0.1.el6.x86_64 2/2
Verifying : portreserve-0.0.4-9.el6.x86_64 1/2
Verifying : 12:dhcp-4.1.1-34.P1.0.1.el6.x86_64 2/2

Installed:
dhcp.x86_64 12:4.1.1-34.P1.0.1.el6

Dependency Installed:
portreserve.x86_64 0:0.0.4-9.el6

Complete!
[root@oel6-server1 /]#

How to add additional hard drive on Linux Guest in Vmware

Use df command to check the disk pace usage information of your file system

[root@db11gr2 oracle]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_db11gr2-lv_root
45038112 28408380 14359880 67% /
tmpfs 4194304 260 4194044 1% /dev/shm
/dev/sda1 495844 48558 421686 11% /boot
shmfs 4194304 260 4194044 1% /dev/shm

To see more information about disk space usage with Mount point use df with -a option as below.

[oracle@db11gr2 u02]$ df -a
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_db11gr2-lv_root
45038112 29302112 13466148 69% /
proc 0 0 0 – /proc
sysfs 0 0 0 – /sys
devpts 0 0 0 – /dev/pts
tmpfs 4194304 420 4193884 1% /dev/shm
/dev/sda1 495844 48558 421686 11% /boot
shmfs 4194304 420 4193884 1% /dev/shm
none 0 0 0 – /proc/sys/fs/binfmt_misc
vmware-vmblock 0 0 0 – /var/run/vmblock-fuse
sunrpc 0 0 0 – /var/lib/nfs/rpc_pipefs

To view all available Partition use the fdisk command with -l option

[root@db11gr2 oracle]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00067cb8

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM

Disk /dev/sdb: 11.8 GB, 11811160064 bytes
255 heads, 63 sectors/track, 1435 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0a0d039e

Device Boot Start End Blocks Id System

Disk /dev/sdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xec4c5b96

Device Boot Start End Blocks Id System
/dev/sdc1 1 2610 20964793+ 83 Linux

Disk /dev/dm-0: 46.9 GB, 46850375680 bytes
255 heads, 63 sectors/track, 5695 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn’t contain a valid partition table

Disk /dev/dm-1: 6308 MB, 6308233216 bytes
255 heads, 63 sectors/track, 766 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn’t contain a valid partition table

I have total 3 Partition, sda, sdb, sdc. Now I am adding one additional SCSI drive on my Linux Guest from Vmware. Right click on the running machine and select settings
from the Hardware tab click on Add and select hard drive from the list and click next then click on Create New Virtual Disk then click on SCSI and click next then specify the Disk capacity here I am gonna put 20GB then click on store

virtual disk as single file then specify virutal hard drive name and click on Finish.

Now since the virtual machine is running you will not be able to see the hard drive which you have added as you can see from the output below it has not yet detected the Virtual hard drive which we added.

[root@db11gr2 oracle]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00067cb8

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM

Disk /dev/sdb: 11.8 GB, 11811160064 bytes
255 heads, 63 sectors/track, 1435 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0a0d039e

Device Boot Start End Blocks Id System

Disk /dev/sdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xec4c5b96

Device Boot Start End Blocks Id System
/dev/sdc1 1 2610 20964793+ 83 Linux

Disk /dev/dm-0: 46.9 GB, 46850375680 bytes
255 heads, 63 sectors/track, 5695 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn’t contain a valid partition table

Disk /dev/dm-1: 6308 MB, 6308233216 bytes
255 heads, 63 sectors/track, 766 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn’t contain a valid partition table

Now to rescan the bus without restarting the machine run the below command

[root@db11gr2 oracle]# echo “- – -” > /sys/class/scsi_host/host2/scan

you can see it has detected a new hard drive as sdd in the last few lines of the output below

[root@db11gr2 oracle]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00067cb8

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM

Disk /dev/sdb: 11.8 GB, 11811160064 bytes
255 heads, 63 sectors/track, 1435 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0a0d039e

Device Boot Start End Blocks Id System

Disk /dev/sdc: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xec4c5b96

Device Boot Start End Blocks Id System
/dev/sdc1 1 2610 20964793+ 83 Linux

Disk /dev/dm-0: 46.9 GB, 46850375680 bytes
255 heads, 63 sectors/track, 5695 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn’t contain a valid partition table

Disk /dev/dm-1: 6308 MB, 6308233216 bytes
255 heads, 63 sectors/track, 766 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn’t contain a valid partition table

Disk /dev/sdd: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdd doesn’t contain a valid partition table

Now lets create a partition using fdisk command

[root@db11gr2 oracle]# fdisk /dev/sdd

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x5f05b351.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to
switch off the mode (command ‘c’) and change display units to
sectors (command ‘u’).

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help):

Command (m for help): p

Disk /dev/sdd: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5f05b351

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 4
First cylinder (1-2610, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): 2610

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now format the Partion as Ext4 File system using mkfs.ext4

[root@db11gr2 oracle]# mkfs.ext4 /dev/sdd4
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Now since the partition is created lets make a directory and mount the disk on it.

[root@db11gr2 oracle]# mkdir /u02
[root@db11gr2 oracle]# mount /dev/sdd4 /u02

As I am using this newly created parition for testing Oracle Database i will change the ownership to user Oracle and group dba
[root@db11gr2 oracle]# chown oracle:dba /u02

Lets check if user Oracle can create files on this.

[root@db11gr2 oracle]# exit
exit
[oracle@db11gr2 ~]$ cd /u02
[oracle@db11gr2 u02]$ touch test
[oracle@db11gr2 u02]$ touch test2

[oracle@db11gr2 u02]$ ls -ltr
total 16
drwx—— 2 root root 16384 Mar 31 16:15 lost+found
-rw-r–r– 1 oracle oinstall 0 Mar 31 16:16 test
-rw-r–r– 1 oracle oinstall 0 Mar 31 16:16 test2

[oracle@db11gr2 u02]$ su
Password:
[root@db11gr2 u02]#

ok finally user oracle can create files on this new mount point.

The partition /dev/sdd4 will not be mounted automaticall to /u02 directory so we have to put an entry to fstab file under etc directory

[root@db11gr2 oracle]# vi /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Mar 5 00:30:49 2011
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_db11gr2-lv_root / ext4 defaults 1 1
UUID=dfcfe7c4-1a4c-4983-a578-b610ffd9150a /boot ext4 defaults 1 2
/dev/mapper/vg_db11gr2-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
shmfs /dev/shm tmpfs size=4g 0 0
/dev/sdd4 /u02 ext4 defaults 1 1 [Add this line so that when the system is started everytime the new partition is mounted to /u02 directory]

How to manually configure IP Address in Red Hat Linux 6

Here I am attaching setup by setup guide to manually configure IP address with screenshot’s and command.

How to manually configure IP Address in Red Hat Linux 6

How to setup local yum repository

Create a directory to mount the .iso file

[root@homelinux sunil]# mkdir /mnt/rhl6

Copy rhel-server-6.1-x86_64-dvd.iso to the /tmp directory

Mount the linux .iso to rhl6 directory

[root@homelinux sunil]# mount -o loop /tmp/rhel-server-6.1-x86_64-dvd.iso /mnt/rhl6

Create a repository configuration file

[root@homelinux sunil]# vi /etc/yum.repos.d/local.repo

Add the following entry
[local repository]
name=RHEL6
Baseurl=file:///mnt/rhl6
enabled=1

Save & close the file

list the packages using yum list and yum install packagename to install the package.

How to setup Public-yum for all updates on Oracle Linux 6

After Installing Oracle Linux from ISO or DVD media
Login as root
Download the yum repo file from http://public-yum.oracle.com
# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo

Once the public repo file is downloaded

Update the repository using below command
# yum repolist

To list package
# yum list packagename

To install package
# yum install packagename

How to install Tigervnc Server on Oracle Linux 6

Assuming you have already some up local or public repository
[root@db11gr2 tmp]# yum install tigervnc-server*
After the installation is complete
Edit tigervnc configuration file
[root@db11gr2 tmp]# vi /etc/sysconfig/vncservers
Uncomment all the line
And add the below line
VNCSERVERS=”3:oracle” [means vncsession for user oracle on display 3, using port 5903]
VNCSERVERARGS[3]=”-geometry 1280×1024″

Login with oracle user to set vnc password
[root@db11gr2 tmp]# su –oracle
[root@db11gr2 tmp]# vncpasswd
Password:
Verify:
[root@db11gr2 tmp]#
[root@db11gr2 tmp]# exit

Enable VNC Server service for autostart and start the service

[root@db11gr2 tmp]# chkconfig vncserver on

[root@db11gr2 tmp]# service vncserver start

Connect using Tigervnc

How to install Firefox 13 on Linux

Change the directory to /tmp
[root@db11gr2 /]# cd /tmp
[root@db11gr2 tmp]#

Download the software using wget command

32bit version
[root@db11gr2 tmp]#wget ‘http://ftp.jaist.ac.jp/pub/mozilla.org/firefox/releases/13.0/linux-i686/en-US/firefox-13.0.tar.bz2’
OR
64bit version
[root@db11gr2 tmp]#wget ‘http://ftp.jaist.ac.jp/pub/mozilla.org/firefox/releases/13.0/linux-x86_64/en-US/firefox-13.0.tar.bz2’

Extract the contents of the downloaded tar ball file to the /opt directory where the Programs are installed.
[root@db11gr2 tmp]# tar –jxvf firefox-13.0.tar.bz2 –C /opt

Once the software extraction is complete, you can open firefox using the below command

[root@db11gr2 tmp]# /opt/firefox/firefox
Or
Create shortcut on the desktop
Right click on the desktop click on Create Launcher
In the name box type Firefox
Under command box type /opt/firefox/firefox
Now u can launch the firefox program from the desktop.

How to Install LibreOffice 3.5.2 on Oracle Linux 6

Download LibO_3.5.2_Linux_x86-64_install-rpm_en-US.tar.gz

From http://www.libreoffice.org/download/

Use the tar command to extract the files

tar –zxvf  LibO_3.5.2_Linux_x86-64_install-rpm_en-US.tar.gz

After extracting navigate using below command

cd  LibO_3.5.2rc2_Linux_x86-64_install-rpm_en-US

cd RPMS

Install all .rpm files

rpm –ivh *.rpm

All binaries are located at /opt/libreoffice3.5/program directory. To start LibreOffice, enter:

To start LibreOffice Writer, enter:

Cd /opt/libreoffice3.5/program

./swriter

Alternatively, you can type the following and pick program as you like:

./soffice

If you need executable icons for your program group

Navigate to folder

LibO_3.5.2rc2_Linux_x86-64_install-rpm_en-US/RPMS/desktop-integration

And run

rpm -ivh libreoffice3.5-freedesktop-menus-3.5-202.noarch.rpm