How to remove UEK (unbreakable enterprise kernel)

Check all the kernel’s installed

Check current kernel in use.

remove uek kernel using yum command

now my kernel is downgraded to 2.6.18-398.el5.

please feel free to write me at sunil@sunilthetechfreak.com

How to extend root partition on linux using lvm

Here my partition is on lvm (Logical volume manager)

Check physical volume

Check Volume group

here you can see i have only one disk sda

Now i will add new disk to my virtual machine
right click on the virtual machine and select settings
then click on add select hard disk from the above list
click on next
select scsi and click next
create new disk and click next
specify disk capacity in my case i am adding 15g and click on split virtual disk into multiple files and click next
provide the diskname.vmdk and specify the location where it should be saved and click on finish
click on ok to exit the virtual machine settings

no need to restart the running virtual machine just type the below command so that system scans the new disk

new disk is added /dev/sde

now follow the step to extend the root partition

create physical volume & check /dev/sde1 has 19.99G free space.

we have only one volume group VolGroup00 so we will extend our volume group first

you can see Free PE is 639 / 19.97GB available

we have to extend our root partition which is  /dev/VolGroup00/LogVol00

if you have any doubts or need help please feel free to email me at sunil@sunilthetechfreak.com

 

 

How to move VMware Workstation 11 virtual machine to ESXI 6.0 Server

Step by Step guide download document here

ORA-28000 account locked error while creating database using dbca on Grid Infrastructure with ASM on Standalone Server

My environment details
OS : OEL 6.5 64bit
Database version : 11.2.0.4
grid infrastructure with asm on Standalone Server

I had two issues while creating database using dbca

1) I was not able to see the diskgroup at step 6 after selecting Automatic storage management, i selected use oracle-managed files
and at database area after clicking the browse button no diskgroup was shown in that area it was blank

Cause of problem :
oracle user was not part of asmdba group

Solution :
I added oracle user to asmdba group as i missed to add oracle user to asmdba group

usermod -G asmdba oracle

after that i could see the diskgroup after selecting browse button

2) ORA-28000 account locked error after it completes 43% while creating database

Cause of problem :
oracle user was not part of dba group

as you can see from the output

[oracle@oralab1 cfgtoollogs]$ id oracle

uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54324(asmdba)

[oracle@oralab1 cfgtoollogs]$ id grid

uid=54322(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(asmadmin),54324(asmdba),54325(asmoper)

Solution :
usermod -a -G dba oracle

after adding oracle user to dba group database creation was successful

How to fix shared folder issue in vmware workstation 10 for Oracle Linux 6.5 guest

[root@asm1 bin]# yum -y install kernel-uek.x86_64
[root@asm1 bin]# yum -y install gcc
[root@asm1 bin]# yum -y install kernel-uek-devel.x86_64

[root@asm1 bin]# ln -s /usr/src/kernels/3.8.13-16.2.1.el6uek.x86_64/include/generated/uapi/linux/version.h /usr/src/kernels/3.8.13-16.2.1.el6uek.x86_64/include/linux/version.h

uninstall vmware-tools

[root@asm1 bin]# cd /tmp/vmware-tools-distrib/bin
[root@asm1 bin]# ./vmware-uninstall-tools.pl

reinstall vmware-tools
[root@asm1 bin]# cd /tmp/vmware-tools-distrib
[root@asm1 bin]# ./vmware-install.pl -default

now you can change your directory to /mnt/hgfs and check your shared folder
[root@asm1 /]# cd /mnt/hgfs/

 

Upgrade oracle database 10.2.0.4 to 11.2.0.1

Download document

Cold cloning oracle database on the same server

Cold cloning oracle database on the same server

Source database SID : ora10gdb01
Clone database SID  : clone1

First connect to the database which you are planning to clone

[oracle@db10g ~]$ . oraenv
ORACLE_SID = [ora10gdb01] ? ora10gdb01

[oracle@db10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Fri Jun 20 21:25:06 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SYS@ora10gdb01>startup
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
Database mounted.
Database opened.
SYS@ora10gdb01>

SYS@ora10gdb01>select name from v$datafile;

NAME
——————————————————————————–
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/system01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/undotbs01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/sysaux01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/users01.dbf
/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/users02.dbf

SYS@ora10gdb01>create pfile=’$ORACLE_HOME/dbs/initclone1.ora’ from spfile;

File created.

SYS@ora10gdb01>alter database backup controlfile to trace as ‘/tmp/control_script.sql’;

Database altered.

edit pfile for clone1 database

[oracle@db10g ~]$ vi $ORACLE_HOME/dbs/initclone1.ora

contents before change
ora10gdb01.__db_cache_size=872415232
ora10gdb01.__java_pool_size=16777216
ora10gdb01.__large_pool_size=16777216
ora10gdb01.__shared_pool_size=285212672
ora10gdb01.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/adump’
*.background_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/control01.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/control02.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/cdump’
*.db_block_size=8192
*.db_create_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01′
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’ora10gdb’
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=’/u03/ora10gdb01/flash_recovery_area’
*.db_unique_name=’ora10gdb01′
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora10gdb01XDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1207959552
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/ora10gdb01/udump’

contents after change
clone1.__db_cache_size=872415232
clone1.__java_pool_size=16777216
clone1.__large_pool_size=16777216
clone1.__shared_pool_size=285212672
clone1.__streams_pool_size=0
*.audit_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/adump’
*.background_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/control01.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/control02.ctl’,’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/control03.ctl’
*.core_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/cdump’
*.db_block_size=8192
*.db_create_file_dest=’/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1′
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’ora10gdb’
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=’/u03/clone1/flash_recovery_area’
*.db_unique_name=’clone1′
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clone1XDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_target=1207959552
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’/u01/app/oracle/product/10.2.0.1/db01/admin/clone1/udump’

make changes to the controlfile the contents should be

vi /tmp/control_script.sql
CREATE CONTROLFILE SET  DATABASE  “clone1” RESETLOGS  ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/redo01.log’  SIZE 50M,
GROUP 2 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/redo02.log’  SIZE 50M,
GROUP 3 ‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/redo03.log’  SIZE 50M
DATAFILE
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/system01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/undotbs01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/sysaux01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/users01.dbf’,
‘/u01/app/oracle/product/10.2.0.1/db01/oradata/clone1/users02.dbf’
CHARACTER SET WE8ISO8859P1
;

create directories as referred in pfile
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/adump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/bdump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/cdump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/admin/clone1/udump
[oracle@db10g ~]$ mkdir -p /u01/app/oracle/product/10.2.0.1/db01/oradata/clone1
[oracle@db10g ~]$ mkdir -p /u03/clone1/flash_recovery_area

copy all datafile to clone directory
[oracle@db10g ~]$ cd /u01/app/oracle/product/10.2.0.1/db01/oradata/ora10gdb01
[oracle@db10g ora10gdb01]$ ll
total 1373152
-rw-r—–  1 oracle oinstall   7061504 Jun 20 21:30 control01.ctl
-rw-r—–  1 oracle oinstall   7061504 Jun 20 21:30 control02.ctl
-rw-r—–  1 oracle oinstall   7061504 Jun 20 21:30 control03.ctl
drwxr-x—  3 oracle oinstall      4096 Jun  4 20:16 ORA10GDB01
-rw-r—–  1 oracle oinstall  52429312 Jun 20 21:30 redo01.log
-rw-r—–  1 oracle oinstall  52429312 Jun 20 21:25 redo02.log
-rw-r—–  1 oracle oinstall  52429312 Jun 20 21:25 redo03.log
-rw-r—–  1 oracle oinstall 272637952 Jun 20 21:30 sysaux01.dbf
-rw-r—–  1 oracle oinstall 503324672 Jun 20 21:30 system01.dbf
-rw-r—–  1 oracle oinstall  27271168 Jun 14 06:00 temp01.dbf
-rw-r—–  1 oracle oinstall 429924352 Jun 20 21:30 undotbs01.dbf
-rw-r—–  1 oracle oinstall   6561792 Jun 20 21:30 users01.dbf
-rw-r—–  1 oracle oinstall  10493952 Jun 20 21:30 users02.dbf

[oracle@db10g ora10gdb01]$ cp -v *.dbf $ORACLE_HOME/oradata/clone1

[oracle@db10g ora10gdb01]$ export ORACLE_SID=clone1
[oracle@db10g ora10gdb01]$ export ORACLE_HOME=/u01/app/oracle/product/10.2.0.1/db01

[oracle@db10g ora10gdb01]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Fri Jun 20 21:47:18 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SYS@clone1>startup nomount
ORACLE instance started.

Total System Global Area 1207959552 bytes
Fixed Size                  2020352 bytes
Variable Size             318770176 bytes
Database Buffers          872415232 bytes
Redo Buffers               14753792 bytes
SYS@clone1>

SYS@clone1>@/tmp/control_script.sql

Control file created.

SYS@clone1>alter database open resetlogs;

Database altered.

SYS@clone1>select name from v$database;

NAME
———
CLONE1

Edit the oratab file for clone database

[oracle@db10g dbs]$ vi /etc/oratab

[oracle@db10g dbs]$ cat /etc/oratab
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ‘:’, is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, ‘#’, are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , “Y”, or should not,
# “N”, be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
ora10gdb01:/u01/app/oracle/product/10.2.0.1/db01:N
10gdb02:/u01/app/oracle/product/10.2.0.1/db01:N
clone1:/u01/app/oracle/product/10.2.0.1/db01:N

for any queries write to me at sunil@sunilthetechfreak.com

Error in invoking target client_sharelib of makefile

while installing oracle 10g 10.2.0.1 on Oracle enterprise Linux 4.5. I encountered the error

“Error in invoking target client_sharelib of make file.
/u01/app/oracle/product/10.2.0.1/db01/network/lib/ins_net_client.mk

Cause of the problem : My Linux platform was Oracle enterprise linux 4.5 64bit and Oracle
software used for installation was Oracle 10g (10.2.0.1) 32bit

Solution
Installed correct oracle 10g 64bit software for 64bit Linux system.

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.

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]