Hello Guys In this tutorial we are going to learn how to create partition in Redhat linux Server. we can use partition create commands on all type of Linux operating system. in this tutorial i have Rhel5 Linux based operating system.
So let we start just click right and open terminal as a root. if you have ubuntu based linux system just need to login root user.
below command are show Heard disk status on your linux operating system.
[root@localhost Desktop]# fdisk -l
Disk /dev/sda: 21.6 GB, 21613379584 bytes
255 heads, 63 sectors/track, 2627 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 382 3068383+ 83 Linux
/dev/sda2 383 764 3068415 fd Linux raid autodetect
/dev/sda3 765 1083 2562367+ 82 Linux swap / Solaris
now we will select our heard disk which one we need to create partition. here my heard disk name is /dev/sda if you have number of heard disk you will see de/sdb ,/dev/sdc ,/dev/sdd. After put fdisk with our heard disk name disk partition editor will be open then we can look all kind of help when we put m and press enter
[root@localhost Desktop]# fdisk /dev/sda
The number of cylinders for this disk is set to 2627.
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): 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): n
Command action
e extended
p primary partition (1-4)
e
Selected partition 4
First cylinder (1084-2627, default 1084):
Using default value 1084
Last cylinder or +size or +sizeM or +sizeK (1084-2627, default 2627): (we press enter becouse extended partation requaird all space we create new partation in extend partation)
Using default value 2627
Command (m for help): n
First cylinder (1084-2627, default 1084):
Using default value 1084
Last cylinder or +size or +sizeM or +sizeK (1084-2627, default 2627): +500M
Command (m for help): n
First cylinder (1146-2627, default 1146):
Using default value 1146
Last cylinder or +size or +sizeM or +sizeK (1146-2627, default 2627): +400M
Command (m for help): n
First cylinder (1196-2627, default 1196):
Using default value 1196
Last cylinder or +size or +sizeM or +sizeK (1196-2627, default 2627): +500M
Command (m for help): p
Disk /dev/sda: 21.6 GB, 21613379584 bytes
255 heads, 63 sectors/track, 2627 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 382 3068383+ 83 Linux
/dev/sda2 383 764 3068415 fd Linux raid autodetect
/dev/sda3 765 1083 2562367+ 82 Linux swap / Solaris
/dev/sda4 1084 2627 12402180 5 Extended
/dev/sda5 1084 1145 497983+ 83 Linux
/dev/sda6 1146 1195 401593+ 83 Linux
/dev/sda7 1196 1257 497983+ 83 Linux
Command (m for help): w (save for partition
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.
Here we need to reboot our system. but Here we suppose we are work on real server then we can’t reboot server for this Service. because Many people are connected to server. so Linuc in we have Commands. we can reboot only Heard Disk partition table. Commands is Partprobe and heard disk name which one we was create partition .
[root@localhost Desktop]# partprobe /dev/sda
Then we Formate our partition and mount in any folder which have required .
[root@localhost Desktop]# mkdir data
[root@localhost Desktop]# mkfs.ext3 /dev/sda5
[root@localhost Desktop]# mkfs.ext3 /dev/sda6
[root@localhost Desktop]# mount /dev/sda7 data
Then we will go to fstab file. this file in have all mounted device information we are also write New partition description
[root@localhost Desktop]# vim /etc/fstab
if you have any problem in this method please comment here i will solve your problem
Thank you
Vishnu Sharma
Like this:
Like Loading...