The fdisk command is a text-based utility for viewing and managing hard disk partitions on Linux. It’s one of the most powerful tools you can use to manage partitions, but it’s confusing to new users. Using fdisk you can create a new partition, delete an existing partition, or change existing partition.
Using fidsk you are allowed to create a maximum of four primary partition, and any number of logical partitions, based on the size of the disk.
This video tutorial will go through the basics of using fdisk to manage a partition table. After using fdisk, we will have see how to use a mkfs command to format new partitions with a file system.
1. Identify current storage configuration
2. Provision 1 or more usable partitions
parted – manipulates partition table of disk
mklabel msdos – if it is entirely new disk
mkpart primary 1 10GB – it creates 10GB primary partition
3. Format the partition
4. Create folder
5. Mount partition
mount /dev/sdb1 /disk1
6. Show UUID pf storage device and reference in /etc/fstab
7. modify /etc/fstab
Add (Recommended way)
UUID=”6008e642-7d2d-4d0a-ac69-3b156aedf9cf” /Disk2 ext4 defaults 1 2
/dev/sdb1 /disk1 ext4 defaults 1 2
8. List mounted partitions
9. Unmount /disk1 partition
10. List mounted partitions again
11. Mount all in fstab
12. List mounted partitions