Satyaveer Arya |
01-03-2012 11:14 PM |
Ok then, do as follows:
Suppose you have /dev/sda disk
First start fdisk from the shell prompt:
When you print the (empty) partition table, you just get configuration information.
Quote:
Command (m for help): p
Disk /dev/sda: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
|
Now create partition using by pressing n and then selecting the primary or logical partition:
Quote:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-621, default 1):<RETURN>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-621, default 621): +100M
|
Then press w for writing changes:
Quote:
Command (m for help): w
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.
[root@testmachine ~]#
|
Then type partprobe, this command informs OS or kernel that new partition has been created.
Quote:
[root@testmachine ~]# partprobe
[root@testmachine ~]#
|
Remember, if you do not give the type of partion then by default linux takes as Linux partition i.e., type 83
After that format the partition:
Quote:
[root@testmachine ~]# mkfs.ext3 /dev/sda6
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
26104 inodes, 104388 blocks
5219 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@testmachine ~]#
|
then create a directory and mount that partition on that directory:
Quote:
[root@testmachine ~]# mkdir /data
[root@testmachine ~]# mount /dev/sda6 /data
[root@testmachine ~]#
|
Then make the entry in /etc/fstab in the end to mount it permanently:
Quote:
[root@testmachine ~]# vi /etc/fstab
|
/dev/sda /data ext3 defaults 0 0
now save the file and quit.
And you have done with your creating a new partition.
:)
|