Managing disks and partitions with the Linux Shell

Ask a question

Here are the key controls for managing disks & partitions on Linux
  • mount: Displays the list of mounted filesystems
  • mount device dir: Mounts a file system (from a peripheral device) on a directory
  • mount-t msdos device dir: Mount a DOS partition
    • df: Displays the space used/free on the mounted file systems.
    • -h stand for sizes in KB
    • -h (Linux & BSD) stand for the most significant sizes of the unit
  • fdisk device: Changing the partition (MBR)
  • pdisk device: Changing the partitioning (Apple Partition Map -> Mac OS X & BSD)
  • disklabel device: Changing the partitioning (for BSD disklabel)
  • newfs device: Formatting a partition
  • mkfs device: Formatting a partition
    • /etc/fstab: Correspondence between devices and mount points and the mounting options,

Note that: /etc/fstab is also used to auto mount partition at startup.

Related FAQ:

Compression and decompression with the Linux Shell
Shell - Test a numeric variable