how to create a new partition in linux

how to create swap partition

Creating and deleting new partitions in linux a very normal practice. In this post we will be going through simple steps to create a new partition in linux, format it and mount it at your required mount point.

This article will also take you through the steps to delete your required partition, view your hard drive geometry,display existing partition table,display the UUID of a partition and many more about partition creation ,view,help, partitioning command line help and troubleshooting.

Using Fdisk command one can identify his device that whether it is your internal Hard disk or external hard disk.

/dev/sd(a,b,c)----------->SCSI

/dev/hd(a,b,c)----------->IDE

#fdisk -l

we have seen that already partition up to /dev/sda5 has been created.

So now we have to create a new partion that will start from /dev/sda6

Before Partition we need to know about our hard disk in use. We use here some commands to know the detail information of hard disk we are using and we are going to partitioning.

[root@satish

]# lspci|grep -i ide

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)

00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)

]# cat /proc/scsi/scsi

Attached devices:

Host: scsi0 Channel: 00 Id: 00 Lun: 00

Vendor: ATA Model: ST3160215AS Rev:

4.AA ------>> My hard Disk

Type: Direct-Access ANSI SCSI revision: 05

Host: scsi4 Channel: 00 Id: 00 Lun: 00

Vendor: Kingston Model: DataTraveler G2 Rev: 1.00 ---->> My usb Device

Type: Direct-Access ANSI SCSI revision: 02

Host: scsi8 Channel: 00 Id: 00 Lun: 00

Vendor: HUAWEI Model: Mass Storage Rev: 2.31 ---->> My HUWAEI USb Modem

Type: CD-ROM ANSI SCSI revision: 02

Host: scsi9 Channel: 00 Id: 00 Lun: 00

Vendor: HUAWEI Model: MMC Storage Rev: 2.31

Type: Direct-Access ANSI SCSI revision: 02

Step2: See how to create a new Partiton using fdisk tool.(Partitioning Device)

We do partition or you can say disks are partitioned to make a separate File System according our need.

note: here we have taken sda because fdisk -l show us our hard disk is sda type not hda or hdb.

:n this will create a new partition

:l this will create a logical partition

just press enter to take default

cylinder value.

+2000M this mean we want to create a partion of size 2gb approx ie 2000Mb.

:w write the changes and save it and exit

If You don't want to reboot your linux system for making update for the changes you have made in the partition table above just use partprobe command.

Source: www.slashroot.in

Category: Forex

Similar articles: