Saturday, August 29, 2009

How to create Partitioning in Linux

How to create partition in Linux 1. [root@bg-qaevt-03 ~]# fdisk -l [used for List the partition]

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 8 64228+ de Dell Utility
/dev/sda2 * 9 270 2104515 b W95 FAT32
/dev/sda3 271 30393 241962997+ f W95 Ext'd (LBA)
/dev/sda5 271 3864 28868773+ 7 HPFS/NTFS
/dev/sda6 3865 7689 30720000 7 HPFS/NTFS
/dev/sda7 7690 10238 20474811 83 Linux
/dev/sda8 10239 12788 20482843+ 83 Linux
/dev/sda9 12789 13298 4096543+ 82 Linux swap / Solaris
/dev/sda10 13299 15848 20482843+ 83 Linux
/dev/sda11 15849 16358 4096543+ 82 Linux swap / Solaris
Disk /dev/sdc: 36.7 GB, 36703934464 bytes
64 heads, 32 sectors/track, 35003 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
2. root@bg-qaevt-03 ~]# fdisk /dev/sdc

The number of cylinders for this disk is set to 35003.
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):
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)
p
Partition number (1-4): 1
First cylinder (1-35003, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-35003, default 35003):
Using default value 35003
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Fdisk -l
Disk /dev/sdc: 36.7 GB, 36703934464 bytes
64 heads, 32 sectors/track, 35003 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 35003 35843056 83 Linux
Make Linux Ext3 filesystem

mkfs.ext3 /dev/sdc1

Reboot the system

Mount Partition

Manual mount
mount /dev/sdc1 /disk1
Automatic mount
vi /etc/fstab
/dev/sdc1 /disk1 ext3 defaults 0 0

No comments:

Post a Comment