Posts Tagged ‘fdisk’

By using GParted (GNOME Partition Editor)
It’s actually the easiest way to partition a disk.

You can access it on a live cd by clicking Systems > Administrator > GParted before the installation process. Or download, install, then run it after installation.

By fdisk command
Type fdisk command in the command line.
syntax: fdisk [device]
e.g. : fdisk /dev/sda

The basic commands needed are:
p – print the new partition table
n – create a new partition
d – delete a partition
q – quit without saving changes
w – write the new partition and exit
It is important to enter the w command for changes to take effect.

By using cfdisk
Type cfdisk command in the command line.
syntax: cfdisk [device]
e.g. : cfdisk /dev/sda

The difference of cfdisk from fdisk is it has a user interface. The partition table is listed and command buttons are located on the bottom of the screen. Use the arrow keys to change between partitions and commands.

fdisk and cfdisk commands are root user commands. But it is recommended to execute this commands from a non-root user. The root user can access important files on your system and it is important to secure those files. It is actually a bad idea to log-in as a root user. To execute a root user command from another user, use the sudo command. The sudo allows temporary access to run commands that would not normally be executed due to file permission restrictions. As an example, type sudo fdisk /dev/sda or sudo cfdisk /dev/sda. More of sudo in the upcoming article. 🙂