Linux Hard Drive Formatting Guide - How to Partition and Create Linux File Systems

Page content

Introduction to Linux Formatting

“Formatting” a disk in Windows is technically the combination of two different acts in Linux, formatting a disk and creating a file system. The previous article in this series described how to use cfdisk or fdisk in conjunction with mkfs to perform these tasks. This article provides more information on the formatting process and how to use Linux without formatting a disk at all.

Options for Linux Formatting

Formatting a hard drive with a single partition is very easy in Linux, and taking advantage of Linux’s built-in power and flexibility is just as easy. Simply by changing or adding a few steps, you can format more than one partition or format partitions for other operating systems. You can even format Linux partitions from Windows.

  • Creating Multiple Partitions on a Single Drive: Although the instructions in the previous article created a single partition on a new hard drive, creating multiple partitions is just as easy. When asked how large to make your first partition in cfdisk, type in the size you want to make it, and then pick whether you want this partition to start at the beginning (faster access) or end (slower access) of the disk. You should then have remaining space on the disk with which to create another new partition.

  • Use Non-Linux Formats: If you want Windows to be able to read the partition you are creating, then you will need to create a file system that it understands. In order to do this, you must do two things differently from the instructions in the previous article. In cfdisk, select “0B” for the partition type. Second, instead of using the “mkfs.ext3” command, you will enter “mkdosfs [partition name]”.

  • Format for Linux from Windows: You can also do the opposite of the previous option - create a Linux partition from within Windows - but you will need to install new software first. Symantec’s Partition Magic is able to create a variety of partition types, including Linux, and you can download it here.

Four Ways to Try Linux Without Formatting

Sometimes, formatting a disk or a partition is the last thing you want to do, especially if you simply want to try out a Linux distro without committing to it. In this case you have several options.

  1. Live CD: Most Linux distros are downloadable as an iso file that you can burn directly to a CD or a DVD that you then boot from to try the distro. This popular approach is part of the reason behind Ubuntu’s success.
  2. Unetbootin: If you do not want to burn a new CD every time you try Linux, and Windows is your primary operating system, you can use the handy tool UNetbootin to instruct Windows to boot into Linux from an iso file the next time you restart.
  3. Frugal Install: If you already have a Linux distro installed, you can easily change the menu.lst file, usually found in /boot/grub/, to include the additional option of booting from an iso file that you have downloaded.
  4. Virtual Machine: Finally, if you’ve got the memory, you can simply boot into another operating system without restarting at all, by using virtual machine software like VirtualBox.

For more on the basics of Linux formatting, partitioning and labeling read Creating Partitions with fdisk.

This post is part of the series: Installing and Formatting Hard Drives and Partitions in Linux

Setting up a new hard drive or reformatting an old one might not be as intuitive in Linux as it is in mainstream operating systems, but, once you get the hang of it, you will have superior flexibility and power over your data.

  1. 10 Easy Steps to Install a Second Hard Drive in Linux
  2. When and How to Format and Partition a Hard Drive in Linux