fdisk stands (for “fixed disk or format disk“) is an most commonly used command-line based disk manipulation utility for a Linux/Unix systems. With the help of fdisk command you can view, create, resize, delete, change, copy and move partitions on a hard drive using its own user friendly text based menu driven interface.
This tool is very useful in terms of creating space for new partitions, organising space for new drives, re-organising an old drives and copying or moving data to new disks. It allows you to create a maximum of four new primary partition and number of logical (extended) partitions, based on size of the hard disk you have in your system.
This article explains 10 basic fdisk commands to manage a partition table in Linux based systems. You must be root user to run fdisk command, otherwise you will get a “command not found” error.
Caution – Don’t Create, Delete or Modify Partitions. Unless you know what you are doing!
1. View all Disk Partitions in Linux
The following basic command list all existing disk partition on your system. The ‘-l‘ argument stand for (listing all partitions) is used with fdisk command to view all available partitions on Linux. The partitions are displayed by their device’s names. For example: /dev/sda, /dev/sdb or /dev/sdc.
2. View Specific Disk Partition in Linux
To view all partitions of specific hard disk use the option ‘-l‘ with device name. For example, the following command will display all disk partitions of device /dev/sda. If you’ve different device names, simple write device name as /dev/sdb or /dev/sdc.
3. Check all Available fdisk Commands
If you would like to view all commands which are available for fdisk. Simply use the following command by mentioning the hard disk name such as /dev/sda as shown below. The following command will give you output similar to below.
No comments:
Post a Comment