Thursday, October 15, 2009

Format / Create partition on CentOS (LINUX perhaps)

Today i manage to remove and create the partition on CentOS 5.2 (i386).
BTW this server contain VMFS patition inside the server, so i need to remove this partition first.

as root, i run fdisk -l and you will get

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 25 101984 83 Linux
/dev/cciss/c0d0p2 26 1279 5116320 8e Linux LVM
/dev/cciss/c0d0p3 1280 35132 138120240 fb VMFS

So I decide to remove the partition first and i will use this partition as a ext3 partition. You can delete this VMFS partition by run

fdisk /dev/cciss/c0d0 or fdisk /dev/cciss/c0d0p3
then type p


the partition containing the VMFS is the one with type FB

to delete the partition type d
you will be asked for the number
enter it and the partition is gone
then type w to write out the partition table to the disk, then type q to exit

than reboot

the VMFS will be deleted after the reboot finish. Now let start to install / create a new partition using fdisk
as root run

fdisk /dev/cciss/c0d0
help
choose n
you will be ask some question to answer to suit your needs
after finish
w

reboot

after finish rebooting now we can start to create a new partition.
using

parted /dev/cciss/c0d0
p
mkfs 3
Yes
partition number (depend on your partition to create) : 3
wait for a sec

or you can use this to create a partition

Create the partition using parted or fdisk.

Format the partition with the ext3 file system using mkfs.

Label the partition using e2label.

Create the mount point.

Add the partition to the /etc/fstab file.


after finish please reboot your machine

Now you can use your new partition.
Thanks all.








No comments:

Post a Comment