Chapter 5: formatting and Creating File Systems

Formatting and Creating File Systems

Overview of Formatting

  • Formatting is the process that prepares a storage area on disk for use.

  • It creates the root directory structure and installs the necessary file system.

  • Storage Area Creation: Must create a storage area before installing a file system.

Windows 10 File System Creation

  • Disk Management Console: Used to create storage areas in Windows 10.

  • Unallocated Area: This is a space on the disk that does not belong to any primary or extended partition.

Steps to Create a Storage Area in Windows 10
  • Initiate Creation: Right-click on the unallocated area and select "New Simple Volume."

  • Volume Size: Indicate the amount of storage for the simple volume (default size if using the entire disk).

  • Wizards for Configuration: Use wizards to navigate through options with buttons such as "Next", "Back", and "Finish".

Assigning Drive Letters
  • Upon creation, assign a drive letter to the new partition:

    • Options:

      • Assign a Drive Letter: Choose from a list of available letters.

      • Mount in NTFS Folder: Reference the drive from a folder in another partition.

      • Delay Assignment: Optional if you want to change an existing drive letter before assigning.

Formatting the Partition
  • Options in Format Partition Dialog:

    • File System: Choose between FAT, FAT32, or NTFS.

    • Allocation Unit Size: Typically left to Windows to decide.

    • Volume Label: Name for the partition.

    • Quick Format: Speeds up process, best for known good partitions.

    • File and Folder Compression: Available only for NTFS.

  • Finalize by clicking "Next" and then "Finish".

File System Creation in CentOS 7

  • Initial Requirement: Define the slash directory and swap file during installation.

  • Swap File: Used for memory management; holds data that doesn't fit in memory.

Using Disks Utility in GNOME
  • Select the Drive: Identifies connected drives to format.

  • Formatting Steps:

    • Click gears under Volumes to display options.

    • Select "Format" and name the drive (default settings recommended).

    • Administrative password required for formatting.

  • Mounting Volumes:

    • Automatically mounts by default or can be configured using advanced options.

Using Command Line Utilities for Formatting (Linux)

  • Parted Utility: For partitioning and formatting via command line.

    • Command to start: sudo parted (Run as super user).

    • Labeling a Partition: mglabel m s das if prompted to overwrite, enter 'y'.

    • Create partition: n g part primary one 250.

Alternative: Disk Command
  • Disk Command Syntax: disk l d s [partition_device] [vl].

  • Must run sudo to avoid permission issues.

  • Command options help display partition details.

Creating a File System with MKFS
  • Use m k f s command to enable file system storage on a partition:

    • Example: m k f s -t ext4 /dev/sdc1

    • Caution: -c option checks for bad blocks.

Mounting the Volume

  • Mount Command: Used to attach a file system to a partition.

    • Syntax: mount -t type /dev/sdb /home/user1/tmp

    • Create directory if needed with mkdir command.

  • Once mounted, the partition is ready for use and files can be stored.