Here i create new partition on 4 setps:
Step #1 For create new partition used fdisk command;
Following command will list all detected hard disks:
root@manish.bhandari#] fdisk -l | grep '^Disk'
Output:
Disk /dev/sda: 251.0 GB, 251000193024 bytes Disk /dev/sdb: 251.0 GB, 251000193024 bytes
To partition the disk - /dev/sdb, enter:
root@manish.bhandari#] fdisk /dev/sdb
The basic fdisk commands you need are:
- m - print help
- p - print the partition table
- n - create a new partition
- d - delete a partition
- q - quit without saving changes
- w - write the new partition table and exit
root@manish.bhandari#] partprobe
Step #2 Format the new disk partition using mkfs.ext3 or mkfs.ext4 command;
root@manish.bhandari#] mkfs.ext4 /dev/sdb1
Step #3 Mount the new partition using command but first you create mount point /manish and mount command to mount /dev/sdb1;
root@manish.bhandari#] mkdir /manish
root@manish.bhandari#] mount /dev/sdb1 /manish
root@manish.bhandari#] df -h
Step #4 Update /etc/fstab file for parment mount;
root@manish.bhandari#] vim /etc/fstab
/dev/sdb1 /manish ext4 defaults 1 2
Thanks & Regards
Manish Bhandari