Chapter 3
Chapter 3
These tools allow you to create, manage, and organize disk partitions.
Here’s how you can use them:
1. parted Command:
2
Page
o Purpose: parted is a versatile utility for manipulating disk partitions.
It enables tasks such as creating space for new operating systems,
reorganizing disk usage, and copying data to new hard disks.
o Functionality:
o Steps:
1. List Partitions: Before creating a partition, list available storage devices and partitions
using:
2. sudo parted -l
8. print
3
512MiB:
10. mkpart primary fat32 0% 512MiB
o Example:
2. fdisk Command:
Page
o Purpose: fdisk is another disk partitioning tool, but it has
fewer features compared to parted.
o Functionality:
Basic Partitioning: fdisk allows creating, deleting, and modifying partitions.
MBR Support: It works with MBR (Master Boot Record) partition tables.
o Steps:
2. sudo fdisk -l
o Example:
3.1.3 Swap
Linux Swap is a crucial component in the world of Linux operating systems. Let
me explain it in a bit more detail.
For 2GB to 4GB of RAM, allocate a swap partition half the size of RAM.
If you have more than 4GB of RAM, a 2GB swap partition is sufficient.
You can check your swap type and size using the command: swap on.
Example: My system has a 2GB swap partition1.
o Creating Swap File:
Alternatively, you can create a swap file after installation. The modern
Linux Kernel allows swapping to a file instead of a partition.
8
Page
o sudo reboot
Remember that disabling swap can impact system stability if
your RAM usage exceeds its capacity. Only proceed if you
understand the implications and have sufficient physical
Determining Disk usage with df and du
3.1.4 Configure Disk quotes
Certainly! Let’s delve into disk usage and explore how the df command helps us monitor it in
Linux.
1. Understanding df Command:
physical disks into logical volumes. Here are the key concepts:
Page
1. Physical Volumes (PVs):
LV Path: /dev/LVMvgTEST/lv_linear
Manipulating LVs
To display LV information:
o This window allows you to manage logical volumes within X windows or graphically.
Page
o It displays both the logical view (individual logical volumes) and
the physical view (volume groups and physical volumes).
4. Renaming Logical Volumes:
o Suppose you want to rename a logical volume (LV). For example, let’s
rename LogVol03 to Swap.
o Follow these steps:
Select the respective logical volume from the list (not the
image) in the left-side column.
Click on the Edit Properties button.
In the Edit Logical Volume window, modify the LV name,
size (in extents, gigabytes, megabytes, or kilobytes), and use
any remaining space available in the logical volume group.
5. Example Configuration:
o During installation, you might encounter a volume group with logical
volumes like:
/boot (Ext3) file system
LogVol00 (LVM) containing the root (/) directory
LogVol02 (LVM) containing the home (/home) directory
LogVol03 (LVM) for swap
o These logical volumes exist on the same physical volume
(e.g., /dev/hda2).
RAID combines multiple physical disks into a single logical unit to enhance
performance, redundancy, or both.
1. Data Redundancy:
o Note that RAID is not a substitute for backups; separate backups are always
recommended.
2. Performance Enhancement:
RAID-5 Array:
o Specify the disks involved (at least three) and their order.
o Example command:
Expanding:
Resizing Filesystem:
Remember that RAID-5 provides both redundancy and performance benefits. Explore further
Page