Forgot your password?    
+ Reply to Thread
Results 1 to 2 of 2

Thread: Adding a new partition in RHEL5

  1. #1

    Adding a new partition in RHEL5

    Check the file system space:

    [root@localhost ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda3 23G 5.3G 16G 25% /
    /dev/sda1 99M 11M 83M 12% /boot
    tmpfs 506M 0 506M 0% /dev/shm
    .host:/ 61G 61G 636M 99% /mnt/hgfs

    [root@localhost ~]#
    [root@localhost ~]#

    See the partition that u have:

    [root@localhost ~]# fdisk -l

    Disk /dev/sda: 26.8 GB, 26843545600 bytes
    255 heads, 63 sectors/track, 3263 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 104391 83 Linux
    /dev/sda2 14 274 2096482+ 82 Linux swap / Solaris
    /dev/sda3 275 3263 24009142+ 83 Linux

    Disk /dev/sdb: 322.1 GB, 322122547200 bytes <-------this is the new hardisk.
    255 heads, 63 sectors/track, 39162 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/sdb doesn't contain a valid partition table
    [root@localhost ~]#

    Now making the partitions:


    [root@localhost ~]# fdisk /dev/sdb
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel. Changes will remain in memory only,
    until you decide to write them. After that, of course, the previous
    content won't be recoverable.

    The number of cylinders for this disk is set to 39162.
    There is nothing wrong with that, but this is larger than 1024,
    and could in certain setups cause problems with:
    1) software that runs at boot time (e.g., old versions of LILO)
    2) booting and partitioning software from other OSs
    (e.g., DOS FDISK, OS/2 FDISK)
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    Command (m for help): n
    Command action
    e extended
    p primary partition (1-4)
    e <-------------------------------give "e" as input
    Partition number (1-4): 1
    First cylinder (1-39162, default 1):
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-39162, default 39162):
    Using default value 39162

    Command (m for help): n <-----------type n here
    Command action
    l logical (5 or over)
    p primary partition (1-4)
    l <----------------------------give "l" as input here
    First cylinder (1-39162, default 1):
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-39162, default 39162):
    Using default value 39162

    Command (m for help): w <---- press w to save the partition
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@localhost ~]# partprobe

    Now changing the format of the newly created partition:

    [root@localhost ~]# mkfs.ext3 /dev/sdb5

    mke2fs 1.39 (29-May-2006)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    39321600 inodes, 78642175 blocks
    3932108 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=0
    2400 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616

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

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

    [root@localhost ~]#
    [root@localhost ~]#

    make a new directory
    :
    [root@localhost ~]# mkdir /u04

    [root@localhost ~]#

    mount the newly created partition on the u04 mount point:

    [root@localhost ~]# mount /dev/sdb5 /u04

    [root@localhost ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda3 23G 5.3G 16G 25% /
    /dev/sda1 99M 11M 83M 12% /boot
    tmpfs 506M 0 506M 0% /dev/shm
    .host:/ 61G 61G 636M 99% /mnt/hgfs
    /dev/sdb5 296G 191M 281G 1% /u04 <-----this is the new mount point

    Make the following entry in the fstab file:

    [root@localhost ~]# vi /etc/fstab

    /dev/sdb5 /u04 ext3 defaults 1 2


    hope this will help u

  2. #2
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    Thanks Shoaib. Very helpful.

    [root@localhost ~]# df -h

    Filesystem Size Used Avail Use% Mounted on
    /dev/sda3 23G 7.3G 14G 35% /
    /dev/sda1 99M 11M 83M 12% /boot
    tmpfs 506M 0 506M 0% /dev/shm


    [root@localhost ~]# fdisk /dev/sda

    The number of cylinders for this disk is set to 19581.
    There is nothing wrong with that, but this is larger than 1024,
    and could in certain setups cause problems with:
    1) software that runs at boot time (e.g., old versions of LILO)
    2) booting and partitioning software from other OSs
    (e.g., DOS FDISK, OS/2 FDISK)

    Command (m for help): p

    Disk /dev/sda: 161.0 GB, 161061273600 bytes
    255 heads, 63 sectors/track, 19581 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 104391 83 Linux
    /dev/sda2 14 274 2096482+ 82 Linux swap / Solaris
    /dev/sda3 275 3263 24009142+ 83 Linux

    Command (m for help): n
    Command action
    e extended
    p primary partition (1-4)
    p
    Selected partition 4
    First cylinder (3264-19581, default 3264):
    Using default value 3264
    Last cylinder or +size or +sizeM or +sizeK (3264-19581, default 19581):
    Using default value 19581

    Command (m for help): p

    Disk /dev/sda: 161.0 GB, 161061273600 bytes
    255 heads, 63 sectors/track, 19581 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 104391 83 Linux
    /dev/sda2 14 274 2096482+ 82 Linux swap / Solaris
    /dev/sda3 275 3263 24009142+ 83 Linux
    /dev/sda4 3264 19581 131074335 83 Linux


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

    Calling ioctl() to re-read partition table.

    WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
    The kernel still uses the old table.
    The new table will be used at the next reboot.
    Syncing disks.
    [root@localhost ~]# partprobe

    [root@localhost ~]# mkdir /u02

    [root@localhost ~]# mkfs.ext3 -j /dev/sda4

    mke2fs 1.39 (29-May-2006)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    16400384 inodes, 32768583 blocks
    1638429 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=0
    1001 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872

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

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

    [root@localhost ~]# mount -t ext3 /dev/sda4 /u02


    [root@localhost ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda3 23G 7.3G 14G 35% /
    /dev/sda1 99M 11M 83M 12% /boot
    tmpfs 506M 0 506M 0% /dev/shm
    /dev/sda4 124G 188M 117G 1% /u02


    [root@localhost ~]# cat /etc/fstab

    LABEL=/ / ext3 defaults 1 1
    LABEL=/boot /boot ext3 defaults 1 2
    /dev/sda4 /u02 ext3 defaults 0 2
    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
    LABEL=SWAP-sda2 swap swap defaults 0 0
    [root@localhost ~]#

+ Reply to Thread

Similar Threads

  1. FRM-92050 Forms Error In RHEL5
    By aryan in forum Concepts,Service Management,Apache,OC4J,OPMN,JServ,Forms, Issues,Troubleshooting,
    Replies: 0
    Last Post: 03-29-2012, 05:39 PM
  2. Configuring yum in RHEL5.
    By ajaychandi in forum OS for Oracle Administration
    Replies: 0
    Last Post: 01-31-2012, 08:57 PM
  3. Adding up more swap space
    By shoaibansari in forum OS for Oracle Administration
    Replies: 0
    Last Post: 01-09-2012, 05:15 PM
  4. 11.5.10 installation fixes on OEL5 or RHEL5
    By Hemant in forum Oracle Apps Patching and Cloning, Installation , Migration,Upgrades
    Replies: 6
    Last Post: 12-24-2011, 11:59 AM
  5. Mount ocfs Error while adding Node to RAC cliuster
    By Hemant in forum RAC Performance,LoadBalancing,TAF,FAN,Troubleshooting
    Replies: 0
    Last Post: 12-18-2011, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics