{"id":441,"date":"2026-07-28T04:00:54","date_gmt":"2026-07-28T04:00:54","guid":{"rendered":"https:\/\/networkyy.com\/linux-disk-management-partitioning-guide\/"},"modified":"2026-08-23T16:12:34","modified_gmt":"2026-08-23T16:12:34","slug":"linux-disk-management-partitioning-guide","status":"publish","type":"post","link":"https:\/\/networkyy.com\/fr\/linux-disk-management-partitioning-guide\/","title":{"rendered":"Linux Disk Management and Partitioning Guide"},"content":{"rendered":"<figure><img decoding=\"async\" src=\"https:\/\/images.pexels.com\/photos\/7370679\/pexels-photo-7370679.jpeg?auto=compress&#038;cs=tinysrgb&#038;dpr=2&#038;h=650&#038;w=940\" alt=\"Linux Disk Management and Partitioning Guide\" style=\"width:100%;height:auto;border-radius:8px;margin-bottom:24px;\" \/><figcaption>Photo by Antonio Moreno Nadal on Pexels<\/figcaption><\/figure>\n<h1>Linux Disk Management and Partitioning Guide<\/h1>\n<p>Understanding disk management and partitioning is a fundamental skill for Linux system administrators and users. Whether you&#8217;re setting up a new server, expanding storage capacity, or optimizing your system&#8217;s performance, knowing how to properly manage disks is essential. This comprehensive guide will walk you through the essential tools, commands, and best practices for Linux disk management.<\/p>\n<nav>\n<h2>Table of Contents<\/h2>\n<ul>\n<li><a href=\"#understanding-disk-structure\">Understanding Linux Disk Structure<\/a><\/li>\n<li><a href=\"#viewing-disk-information\">Viewing Disk Information<\/a><\/li>\n<li><a href=\"#partition-tables\">Partition Tables: MBR vs GPT<\/a><\/li>\n<li><a href=\"#partitioning-tools\">Essential Partitioning Tools<\/a><\/li>\n<li><a href=\"#creating-partitions\">Creating and Managing Partitions<\/a><\/li>\n<li><a href=\"#file-systems\">File Systems and Formatting<\/a><\/li>\n<li><a href=\"#mounting-unmounting\">Mounting and Unmounting Drives<\/a><\/li>\n<li><a href=\"#lvm-basics\">Logical Volume Management (LVM)<\/a><\/li>\n<li><a href=\"#best-practices\">Best Practices and Tips<\/a><\/li>\n<\/ul>\n<\/nav>\n<h2 id=\"understanding-disk-structure\">Understanding Linux Disk Structure<\/h2>\n<p>In Linux, storage devices are represented as special files in the <code>\/dev<\/code> directory. Hard drives typically appear as <code>\/dev\/sda<\/code>, <code>\/dev\/sdb<\/code>, and so on, while NVMe drives use the naming convention <code>\/dev\/nvme0n1<\/code>, <code>\/dev\/nvme0n2<\/code>, etc. Partitions on these drives are numbered sequentially, such as <code>\/dev\/sda1<\/code>, <code>\/dev\/sda2<\/code>, or <code>\/dev\/nvme0n1p1<\/code>.<\/p>\n<p>Understanding this naming convention is crucial for effective disk management, especially when working with multiple storage devices or when deploying infrastructure on cloud platforms like <a href=\"https:\/\/kamatera.sjv.io\/engON1\" target=\"_blank\" rel=\"nofollow sponsored noopener\">Kamatera<\/a>, where you might need to configure additional storage volumes for your Linux servers.<\/p>\n<h2 id=\"viewing-disk-information\">Viewing Disk Information<\/h2>\n<p>Before making any changes to your disks, you need to gather information about your current storage configuration. Several commands provide this information:<\/p>\n<h3>Using lsblk<\/h3>\n<p>The <code>lsblk<\/code> command displays a tree view of all block devices:<\/p>\n<pre><code>lsblk<\/code><\/pre>\n<p>This shows device names, sizes, types, and mount points in an easy-to-read format.<\/p>\n<h3>Using fdisk -l<\/h3>\n<p>For more detailed information, use:<\/p>\n<pre><code>sudo fdisk -l<\/code><\/pre>\n<p>This displays partition tables, sizes, and partition types for all attached storage devices.<\/p>\n<h3>Using df and du<\/h3>\n<p>To check disk space usage, use <code>df -h<\/code> for filesystem usage and <code>du -sh<\/code> for directory sizes.<\/p>\n<h2 id=\"partition-tables\">Partition Tables: MBR vs GPT<\/h2>\n<p>Two main partition table formats exist: Master Boot Record (MBR) and GUID Partition Table (GPT).<\/p>\n<h3>MBR (Master Boot Record)<\/h3>\n<p>MBR is the older standard with these limitations:<\/p>\n<ul>\n<li>Maximum disk size of 2TB<\/li>\n<li>Maximum of four primary partitions<\/li>\n<li>Extended partitions required for more than four partitions<\/li>\n<\/ul>\n<h3>GPT (GUID Partition Table)<\/h3>\n<p>GPT is the modern standard offering:<\/p>\n<ul>\n<li>Support for disks larger than 2TB<\/li>\n<li>Up to 128 partitions by default<\/li>\n<li>Better data integrity with redundant partition tables<\/li>\n<li>Required for UEFI systems<\/li>\n<\/ul>\n<p>For new installations, GPT is recommended unless you have specific compatibility requirements.<\/p>\n<h2 id=\"partitioning-tools\">Essential Partitioning Tools<\/h2>\n<h3>fdisk<\/h3>\n<p>The traditional partition editor, best for MBR partition tables but also supports GPT:<\/p>\n<pre><code>sudo fdisk \/dev\/sda<\/code><\/pre>\n<p>Interactive commands include <code>n<\/code> for new partition, <code>d<\/code> for delete, <code>w<\/code> for write changes, and <code>q<\/code> to quit.<\/p>\n<h3>parted<\/h3>\n<p>A more advanced tool supporting both MBR and GPT with better scripting capabilities:<\/p>\n<pre><code>sudo parted \/dev\/sda<\/code><\/pre>\n<p>Parted can resize partitions and perform operations in a single command, making it ideal for automation.<\/p>\n<h3>gdisk<\/h3>\n<p>Specialized for GPT partition tables, offering similar interface to fdisk:<\/p>\n<pre><code>sudo gdisk \/dev\/sda<\/code><\/pre>\n<h2 id=\"creating-partitions\">Creating and Managing Partitions<\/h2>\n<p>Here&#8217;s a practical example of creating a new partition using fdisk:<\/p>\n<pre><code>sudo fdisk \/dev\/sdb\nn (create new partition)\np (primary partition)\n1 (partition number)\n[Enter] (default first sector)\n+10G (size of 10GB)\nw (write changes)<\/code><\/pre>\n<p>After creating a partition, inform the kernel of the changes:<\/p>\n<pre><code>sudo partprobe \/dev\/sdb<\/code><\/pre>\n<h3>Deleting Partitions<\/h3>\n<p>To delete a partition, use fdisk&#8217;s delete command:<\/p>\n<pre><code>sudo fdisk \/dev\/sdb\nd (delete partition)\n1 (partition number to delete)\nw (write changes)<\/code><\/pre>\n<p><strong>Warning:<\/strong> Deleting a partition destroys all data on it. Always backup important data first.<\/p>\n<h2 id=\"file-systems\">File Systems and Formatting<\/h2>\n<p>After creating a partition, you need to format it with a filesystem. Common Linux filesystems include:<\/p>\n<h3>ext4<\/h3>\n<p>The most common Linux filesystem, offering excellent performance and reliability:<\/p>\n<pre><code>sudo mkfs.ext4 \/dev\/sdb1<\/code><\/pre>\n<h3>XFS<\/h3>\n<p>Excellent for large files and high-performance scenarios:<\/p>\n<pre><code>sudo mkfs.xfs \/dev\/sdb1<\/code><\/pre>\n<h3>Btrfs<\/h3>\n<p>Modern filesystem with advanced features like snapshots and compression:<\/p>\n<pre><code>sudo mkfs.btrfs \/dev\/sdb1<\/code><\/pre>\n<p>For those looking to deepen their Linux system administration skills, platforms like <a href=\"https:\/\/datacamp.pxf.io\/YR9dQK\" target=\"_blank\" rel=\"nofollow sponsored noopener\">DataCamp<\/a> offer excellent courses that cover filesystem management and other essential Linux concepts.<\/p>\n<h2 id=\"mounting-unmounting\">Mounting and Unmounting Drives<\/h2>\n<p>To access a partition, you must mount it to a directory:<\/p>\n<pre><code>sudo mkdir \/mnt\/mydata\nsudo mount \/dev\/sdb1 \/mnt\/mydata<\/code><\/pre>\n<h3>Permanent Mounts with fstab<\/h3>\n<p>To automatically mount a partition at boot, edit <code>\/etc\/fstab<\/code>:<\/p>\n<pre><code>sudo nano \/etc\/fstab<\/code><\/pre>\n<p>Add an entry like:<\/p>\n<pre><code>\/dev\/sdb1  \/mnt\/mydata  ext4  defaults  0  2<\/code><\/pre>\n<p>Or use UUID for better reliability:<\/p>\n<pre><code>UUID=xxxx-xxxx  \/mnt\/mydata  ext4  defaults  0  2<\/code><\/pre>\n<p>Find the UUID with:<\/p>\n<pre><code>sudo blkid \/dev\/sdb1<\/code><\/pre>\n<h2 id=\"lvm-basics\">Logical Volume Management (LVM)<\/h2>\n<p>LVM provides flexible disk management by abstracting physical storage into logical volumes. This allows easy resizing and management.<\/p>\n<h3>LVM Components<\/h3>\n<ul>\n<li><strong>Physical Volumes (PV):<\/strong> Physical disks or partitions<\/li>\n<li><strong>Volume Groups (VG):<\/strong> Pools of physical volumes<\/li>\n<li><strong>Logical Volumes (LV):<\/strong> Virtual partitions created from volume groups<\/li>\n<\/ul>\n<h3>Creating an LVM Setup<\/h3>\n<pre><code>sudo pvcreate \/dev\/sdb1\nsudo vgcreate myvg \/dev\/sdb1\nsudo lvcreate -L 20G -n mylv myvg\nsudo mkfs.ext4 \/dev\/myvg\/mylv\nsudo mount \/dev\/myvg\/mylv \/mnt\/mydata<\/code><\/pre>\n<h3>Extending Logical Volumes<\/h3>\n<p>One of LVM&#8217;s major advantages is easy volume expansion:<\/p>\n<pre><code>sudo lvextend -L +10G \/dev\/myvg\/mylv\nsudo resize2fs \/dev\/myvg\/mylv<\/code><\/pre>\n<h2 id=\"best-practices\">Best Practices and Tips<\/h2>\n<h3>Always Backup Data<\/h3>\n<p>Before performing any disk operations, especially partitioning or formatting, always backup critical data. Mistakes can lead to permanent data loss.<\/p>\n<h3>Use Descriptive Labels<\/h3>\n<p>Label your filesystems for easier identification:<\/p>\n<pre><code>sudo e2label \/dev\/sdb1 \"MyDataDrive\"<\/code><\/pre>\n<h3>Monitor Disk Health<\/h3>\n<p>Regularly check disk health using SMART tools:<\/p>\n<pre><code>sudo smartctl -a \/dev\/sda<\/code><\/pre>\n<h3>Plan Your Partition Scheme<\/h3>\n<p>Consider separating <code>\/home<\/code>, <code>\/var<\/code>, and <code>\/tmp<\/code> into separate partitions for better security and easier maintenance.<\/p>\n<h3>Document Your Configuration<\/h3>\n<p>Keep notes about your partition layout, especially in production environments. This helps during troubleshooting and disaster recovery.<\/p>\n<h3>Test Before Production<\/h3>\n<p>Practice disk management operations in a test environment before implementing them on production systems.<\/p>\n<h3>Use GPT for New Systems<\/h3>\n<p>Unless you have specific legacy requirements, always use GPT partition tables for new installations.<\/p>\n<h3>Consider LVM from the Start<\/h3>\n<p>Implementing LVM during initial system setup provides maximum flexibility for future storage needs without requiring system downtime.<\/p>\n<p>Mastering Linux disk management takes practice and patience. Start with non-critical systems, experiment with different tools, and gradually build your confidence. With these skills, you&#8217;ll be well-equipped to handle any storage challenge your Linux systems present.<\/p>\n<div style=\"background:#1a1a2e;color:#fff;padding:24px;border-radius:10px;margin-top:32px;border-left:4px solid #00ff88;\">\n<h3 style=\"color:#00ff88;margin-top:0;\">Follow Networkyy<\/h3>\n<p>Join 125,000+ IT professionals:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.instagram.com\/networkyy\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Instagram @networkyy<\/a><\/li>\n<li><a href=\"https:\/\/www.facebook.com\/ITnetworkyy\/\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Facebook Networkyy<\/a><\/li>\n<li><a href=\"https:\/\/www.threads.com\/@networkyy\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Threads @networkyy<\/a><\/li>\n<li><a href=\"https:\/\/medium.com\/@mattouchi6\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Medium<\/a><\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Master Linux disk management with this comprehensive guide covering fdisk, parted, LVM, and file systems. Learn partitioning best practices.<\/p>","protected":false},"author":2,"featured_media":440,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":"","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_focuskw":"","rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":""},"categories":[9],"tags":[],"class_list":["post-441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-sysadmin"],"contentshake_article_id":"","brizy_media":[],"_links":{"self":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts\/441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/comments?post=441"}],"version-history":[{"count":1,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts\/441\/revisions"}],"predecessor-version":[{"id":596,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts\/441\/revisions\/596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/media\/440"}],"wp:attachment":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/media?parent=441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/categories?post=441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/tags?post=441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}