how to create a new filesystem in REDHAT Linux

1) First create a partition on the disk by using the “fdisk” command.

fdisk /dev/sda

enter n to create new partition.
enter the size of the partition.
enter “w” to write the partition table and restart the system if required.

2) Format the partition for the filesystem.

/sbin/mkfs -t ext3 /dev/sda11

[root@node3 ~]# /sbin/mkfs -t ext3 /dev/sda11
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
3260416 inodes, 6516365 blocks
325818 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
199 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

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

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

3) Give a label to the partition

[root@node3 ~]# /sbin/e2label /dev/sda11 /oradisk

4) Add an entry in the /etc/fstab to make the filesystem mount on every reboot.

LABEL=/oradisk          /oradisk                ext3    defaults        1 2

5) Mount the new filesystem

[root@node3 ~]# mkdir /oradisk
[root@node3 ~]# chown oracle:oinstall /oradisk

[root@node3 ~]# mount /dev/sda11 /oradisk
[root@node3 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             9.5G  649M  8.4G   8% /
/dev/sda9             2.9G   69M  2.7G   3% /opt
/dev/sda8             4.8G  138M  4.4G   4% /home
/dev/sda7             4.8G  2.7G  1.8G  60% /usr
/dev/sda10            1.9G   36M  1.8G   2% /usr/local
/dev/sda6             4.8G  198M  4.3G   5% /var
/dev/sda3             9.5G  151M  8.9G   2% /tmp
/dev/sda1             2.9G   75M  2.7G   3% /boot
tmpfs                 501M     0  501M   0% /dev/shm
/dev/sda11             25G  173M   24G   1% /oradisk ===> filesystem got mounted

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s