1. DISK PARTITION AND MANAGEMENT COMMANDS
(1) gdisk :
Interactive GUID Partition table (GPT) manipulator. GPT fdisk is a text-made menu-driven
program for creation and manipulation of partition tables.
It will automatically convert an old style Master Boot Record (MBR) partition table (or)
BSD disklabel stored without an MBR carrier partition to the newer Globally Unique Identifier
(GUID) Partition Table (GPT) format (or) will load a GUID partition table.
(2) cfdisk :
Dispaly (or) Manipulate a disk partition table. Cfdisk is a curses-based program for
partitioning any block device. The default device is /dev/sda.
Cfdisk is a user-friendly interface. The version 2.25 cfdisk supports MBR(DOS),GPT,SUN
and SGI disk lables, but no longer provides any functionality for CHS (Cylinder-Head-Sector)
addressing.
The version 2.25 cfdisk also does not provide a ‘Print’ command any more.
(3) cgdisk :
Cgdisk is a curses-based GUID Partititon Table (GPT) manipulator. GPT fdisk is a text-
mode family of programs for creation and manipulation of partition tables.
The cgdisk member of this family employs a curses-based user interface for interaction
using a text-mode menuing system.
(4) sfdisk :
Sfdisk - display or manipulate a disk partition table. sfdisk is a script-oriented tool for
partitioning any block device.
The version 2.26 sfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer
provides any functionality for CHS (Cylinder-Head-Sector) addressing.
(5) sgdisk :
Sgdisk - Command-line GUID partition table (GPT) manipulator for Linux and Unix. GPT
fdisk is a text-mode menu-driven package for creation and manipulation of partition tables. It
consists of two programs: the text-mode interactive gdisk and the command-line sgdisk.
Either program will automatically convert an old-style Master Boot Record (MBR)
partition table or BSD disklabel stored without an MBR carrier partition to the newer Globally
Unique Identifier (GUID) Partition Table (GPT) format, or will load a GUID partition table.
(6) GNU parted :
A Partition Manipulation program. Parted is a program to manipulate disk partitions. It
supports multiple partition table formats, including MS-DOS and GPT.
(7) Fixparts :
MBR Partition table repair utility. Fixparts is a text-mode menu-driven program for
repairing certain types of problems with Master Boot Record (MBR) partition tables.
(8) fdisk :
Manipulate disk partition table. Fdisk is a dialog-driven program for creation and
manipulation of partition tables. It understands GPT,MBR,SUN,SGI and BSD partition tables.
2. (9) partx :
Tell the kernel about the presence and numbering of on-disk partitions. Partx is not an fdisk
program – adding and removing partitions does not change the disk, it just tells the kernel about the
presence and numbering of on-disk partitions.
(10) addpart :
Addpart is a Linux kernel about the existence of the specified partition. The command is a
simple wrapper around the “add partition” ioctl.
This command doesn’t manipulate partitions on a block device.
(11) delpart :
Delpart asks the Linux kernel to forget about the specified partition (a number) on the
specified device. The command is a simple wrapper arround the “del partition” ioctl.
This command doesn’t manipulate partitions on a block device.
(12) partprobe :
Partprobe is a program that in forms the operating system kernel of partitions on a block
device.
(13) fs :
Filesystem’s – Linux filesystem types : ext, ext2, ext3, ext4, hpfs, iso 9660, JFS, minix,
msdos, ncpfs nfs, ntfs, proc, Reiserfs, smb, sysv, umsdos, vfat, xfs, xiafs.
(14) fsck :
fsck is used to check and optionally repair one (or) more Linux filesystems. The exit code
returned by fsck is the sum of the following conditions :
0 - No errors.
1 - Filesystem errors corrected.
2 - System will be rebooted.
4 - Filesystem errors left uncorrected.
8 - Operational error.
16 - Usage (or) Synatx error.
32 - Checking cancelled by user request.
128 - Shared-library error.
(15) mkdos fs (or) mkfs.fat :
Create an MS-DOS file system under linux on a device (usually a disk partition). If omitted,
mkfs.fat automatically determines the file system size.
(16) mke2fs :
mke2fs is used to create an ext2, ext3, ext4 file syatem, usually in a disk partition named by
device.
(17) badblocks :
badblocks is used to search for badblocks on a device (usually a disk partition). If the output
of badblocks to be fed to the e2fsck (or) mke2fs programs, it is important that the block size is
properly specified, since the block numbers which are generated are very dependent on the block
size in use by the file system.
(1) The default block size is 1024.
(2) -c is the no.of blocks which are tested at a time. The default is 64.
3. (18) mkfs.bfs :
mkfs.bfs creates an sco bfs file system on a block device (usually a disk partition (or) a file
accessed via the loop device).
The block – count parameter is the desired size of the file system, in blocks. If nothing is
specified, the entire partition will be used.
(19) mkfs.ext :
ext is an eloborate extension of the minix file system. It has been completely suppressed by
the second version of the extended file system (ext2) and has been removed from the kernel.
(20) mkfs.ext2 :
ext2 is the high performance disk file system used by Linux for fixed disks as well as
removable media.
The second extended file system was designed as an extension of the extended file system.
(21) mkfs.ext3 :
ext3 is a journaling version of the ext2 file system. It is easy to switch back and forth
between ext2 and ext3.
(22) mkfs.ext4 :
ext4 is a set of upgrades to ext3 including substational performance and reliability
enhancements, plus large increases in volume, file, and directory size limits.
(23) mkfs.minix :
mkfs.minix creates a Linux minix file system on a device (usually a disk partition). The
device is usually of the following form :
/dev/hda [1-8] (IDE disk 1)
/dev/hdb [1-8] (IDE disk 2)
/dev/sda [1-8] (SCSI disk 1)
/dev/sdb [1-8] (SCSI disk 2)
Exit codes :
The exit code returned by mkfs.minix is one of the following :
0 - No errors.
8 - Operational error.
16 - Usage of syntax error.
(24) GPT :
GPT stands for “GUID Partition Table”. GPT is modern standard for the layout of the
partition table. GPT uses 64-bit logical block addresses, checksums, UUIDs and names for
partitions and an unlimited number of partitions (although the number of partitions is usually
restricted to 128 in many partitioning tools).
(25) MBR :
A DOS-type partition table can describe an unlimited number of partitions. In sector 0 there
is room for the description of 4 partitions (called ‘primary’).
One of these may be an extended partition this is a box holding logical partitions, with
descriptors found in a linked list of sectors, each preceding the corresponding logical partitions.
The four primary partitions, present or not, get numbers 1-4. Logical partitions are
numbered starting from 5.