Linux - Disk Management
Linux - Disk Management
Disk management
Disk management in Linux is the process of organizing and managing storage devices, like hard drives, USB
drives, and solid-state drives. It also involves managing file systems.
Disk Management is an important functionality provided by the Operating System which can be used to
create, delete, format disk partitions, and much more. It enables users to manage and view the different disks
and functions like viewing, creating, deleting, and shrinking the partitions associated with the disk drives
5. Mount it:
1. Install mdadm:
4. Create a filesystem:
5. Mount it:
$cat /proc/mdstat
LVM Components
Component Description
Physical Volume (PV) Actual disk or partition.
Volume Group (VG) Combines multiple PVs.
Logical Volume (LV) Created from a VG, can be resized easily.
1. Extend LV:
2. Resize filesystem:
Fdisk
Parted
Syntax:
Command Description
m Show help menu
p Print current partition table
n Create a new partition
d Delete an existing partition
t Change partition type
w Write changes and exit
q Quit without saving
#lsblk
Step 2: Open a Disk for Partitioning means choose device name which you want to partition. (You can see
all the disk and their partitions using above lsblk command)
#fdisk /dev/sdb
Step 5: Format the partition: After creating the partition, format it with a filesystem (e.g. ext4):
#mkfs.ext4 /dev/sdb1
Replace /dev/sdb with the newly created partition.
#mkdir /mnt/mydisk
#mount /dev/sdX1 /mnt/mydisk
Syntax:
#parted /dev/sdb
#parted –l
#parted /dev/sdb
Step 3: Check the Partition Table Type. Inside parted, check the partition table type:
#mklabel gpt
For MBR:
#mklabel msdos
⚠ Warning: This erases all partitions on the disk!
#mkfs.ext4 /dev/sdb1
#mkdir /mnt/mydisk
#mount /dev/sdb1 /mnt/mydisk
LILO is a Linux boot loader found in Linux-based devices that have been one of the most widely used and
oldest boot loaders. The development of LILO went via many stages. The LILO was updated or changed by
three developers. Werner Almesberger worked on LILO from 1992 to 1995, John Coffman worked
from 1997 to 2007, and Joachim Wiedorn has been with the project since 2000. LILO has been simplified
and made easier to use due to these three developers.
It only supports a single OS, which is Linux OS. It has been the default boot loader of Linux OS based devices
for several years after gaining popularity from loading. Compared to GRUB, it's an outdated boot loader and
lacks a graphical user interface menu option.
GRand Unified Bootloader (GRUB) is a boot loader created by the GNU project. GRUB allows the user to
choose from a list of operating systems to load, allowing numerous operating systems to run on the same
machine. GRUB is the default boot loader in most modern Linux distributions. GRUB may be customized
dynamically since it permits changes to the configuration during boot. Users are given a simple command line
interface through which they can dynamically input new boot configurations. GRUB provides several user-
friendly characteristics, such as high portability, independence from geometry translation, support for many
executable formats, and support for many file systems, including most UNIX systems, NTFS,
VFAT, and LBA (Logical Block Address) mode. Most Linux distributions that use GRUB give a customized
boot menu by leveraging its support for numerous GUIs (Graphical User Interfaces). GRUB2 is currently
replacing GRUB, and GRUB has been renamed GRUB Legacy.
3] Custom Loaders:
A "custom loader" in Linux refers to a specially designed program that takes the place of the
standard operating system loader, allowing for customized loading of executables or libraries, often with
additional features or functionalities not present in the default loader, potentially including modifications to
memory allocation, relocation, or execution behavior depending on specific needs; essentially, it's a custom-
written code that can load and run programs in a way tailored to a particular application or environment,
rather than relying on the standard Linux loading mechanism.