{"id":2212,"date":"2025-05-03T12:13:13","date_gmt":"2025-05-03T12:13:13","guid":{"rendered":"https:\/\/havari.me\/?p=2212"},"modified":"2025-05-05T07:25:20","modified_gmt":"2025-05-05T07:25:20","slug":"%d9%85%d9%81%d9%87%d9%88%d9%85-%d8%a7%d9%84%d9%80-mounting-%d9%81%d9%8a-linux","status":"publish","type":"post","link":"https:\/\/havari.me\/en\/linux\/%d9%85%d9%81%d9%87%d9%88%d9%85-%d8%a7%d9%84%d9%80-mounting-%d9%81%d9%8a-linux\/","title":{"rendered":"The concept of Mounting in Linux"},"content":{"rendered":"<p>A detailed explanation of <strong>Partitioning disks<\/strong> and<strong>Mounting process<\/strong> in Linux systems, with a simple comparison to Windows. I'll give you an organized summary of the most important points:<\/p>\n<hr \/>\n<h3><strong>1. What is Partition?<\/strong><\/h3>\n<ul>\n<li><strong>Partition<\/strong> A reserved portion of a hard disk (Disk) that has a defined beginning and end (using sextants).<\/li>\n<li>It is created <strong>Partition Table<\/strong> to record the start and end information for each partition.<\/li>\n<li>Without the parity table, the system wouldn't know how to access the data even if it's already on disk.<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>2. Partition Formatting<\/strong><\/h3>\n<ul>\n<li>After creating the parade, you must <strong>Initialize it with a File System<\/strong> like <code>ext4<\/code> or <code>xfs<\/code> or <code>ntfs<\/code> to be ready to store data.<\/li>\n<li><strong>Example:<\/strong>\n<pre><code class=\"language-bash\">mkfs.xfs \/dev\/nvme0n1p1 # Initialize the Partition with the XFS file system<\/code><\/pre>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>3. Mounting<\/strong><\/h3>\n<ul>\n<li><strong>Almont<\/strong> This is the process of linking a partition to a directory in the Linux file system structure to make it usable.<\/li>\n<li><strong>Types of mont:<\/strong>\n<ul>\n<li><strong>Temporary Mount:<\/strong> It disappears after a reboot.\n<pre><code class=\"language-bash\">mount \/dev\/nvme0n1p1 \/mnt<\/code><\/pre>\n<\/li>\n<li><strong>Permanent Mount:<\/strong> Recorded in a file <code>\/etc\/fstab<\/code> to remain after a reboot.\n<pre><code class=\"language-bash\">\/dev\/nvme0n1p1 \/mnt xfs defaults 0 0 0<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>4. File<\/strong> <code>\/etc\/fstab<\/code><\/h3>\n<ul>\n<li>is the file responsible for <strong>Permanent mont<\/strong>. It has 6 columns:\n<ol>\n<li><strong>Device:<\/strong> Can be used:\n<ul>\n<li>Device name (e.g. <code>\/dev\/nvme0n1p1<\/code>).<\/li>\n<li>The <strong>UUID<\/strong> (better because it doesn't change).<\/li>\n<li>The <strong>Label<\/strong> (a user-defined name).<\/li>\n<\/ul>\n<\/li>\n<li><strong>Mount Point:<\/strong> like <code>\/mnt<\/code> or <code>\/media<\/code>.<\/li>\n<li><strong>File System:<\/strong> like <code>xfs<\/code> or <code>ext4<\/code>.<\/li>\n<li><strong>Options:<\/strong> like <code>defaults<\/code>and, uh. <code>ro<\/code> (read-only). <code>noexec<\/code> (prevents execution).<\/li>\n<li><strong>Backup (Dump):<\/strong> <code>0<\/code> Means no backup.<\/li>\n<li><strong>Fsck Order:<\/strong> <code>0<\/code> means no examination. <code>1<\/code> of high importance (e.g. <code>\/<\/code>). <code>2<\/code> For other partitions.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>5. Useful commands<\/strong><\/h3>\n<ul>\n<li><strong>Display of partitions:<\/strong>\n<pre><code class=\"language-bash\">lsblk<\/code><\/pre>\n<\/li>\n<li><strong>Display the current mont:<\/strong>\n<pre><code class=\"language-bash\">mount<\/code><\/pre>\n<\/li>\n<li><strong>Cancel the mont:<\/strong>\n<pre><code class=\"language-bash\">umount \/mnt<\/code><\/pre>\n<\/li>\n<li><strong>Bring back Mount Partition with new options:<\/strong>\n<pre><code class=\"language-bash\">mount -o remount,ro \/dev\/nvme0n1p1\/mnt<\/code><\/pre>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>6. Difference between temporary and permanent mont<\/strong><\/h3>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Temporary mont<\/th>\n<th>Permanent mont<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Survival after reboot<\/td>\n<td>\u274c No<\/td>\n<td>\u2714\ufe0f Yes<\/td>\n<\/tr>\n<tr>\n<td>Method of execution<\/td>\n<td>By order <code>mount<\/code> Live<\/td>\n<td>Add to <code>\/etc\/fstab<\/code><\/td>\n<\/tr>\n<tr>\n<td>Administrator<\/td>\n<td>User (manual)<\/td>\n<td>System <code>systemd<\/code> (automatically)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3><strong>7. Important tips<\/strong><\/h3>\n<ul>\n<li>Use <strong>UUID<\/strong> instead of the device name in <code>\/etc\/fstab<\/code> to avoid issues if the device name changes.<\/li>\n<li><strong>Example of getting a UUID:<\/strong>\n<pre><code class=\"language-bash\">blkid \/dev\/nvme0n1p1<\/code><\/pre>\n<\/li>\n<li><strong>Avoid writing<\/strong> <code>\/etc\/fstab<\/code> <strong>manually if you are unsure:<\/strong><br \/>\nYou can copy the line from <code>\/etc\/mtab<\/code> (which records the current mont) and paste it into <code>\/etc\/fstab<\/code>.<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>8. Common mistakes<\/strong><\/h3>\n<ul>\n<li>If a message appears <strong>\"read-only file system\"<\/strong>It may be a pending read-only protection (ROP).<br \/>\n<strong>Solution:<\/strong> Return the mont with write permissions:<\/p>\n<pre><code class=\"language-bash\">mount -o remount,rw \/dev\/nvme0n1p1 \/mnt<\/code><\/pre>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>Conclusion<\/strong><\/h3>\n<ul>\n<li><strong>Partition<\/strong> is a disk partition, and<strong>Almont<\/strong> is to connect it to the system.<\/li>\n<li>Permanent monetization is done via <code>\/etc\/fstab<\/code>and the timer by order of <code>mount<\/code>.<\/li>\n<li>Use <strong>UUID<\/strong> or <strong>Label<\/strong> More secure than device names.<\/li>\n<\/ul>\n<p>If you have any specific questions, ask and I'll answer in more detail!<\/p>","protected":false},"excerpt":{"rendered":"<p>\u0634\u0631\u062d \u0645\u0641\u0635\u0644 \u0639\u0646 \u062a\u0642\u0633\u064a\u0645 \u0627\u0644\u0623\u0642\u0631\u0627\u0635 (Partitioning) \u0648\u0639\u0645\u0644\u064a\u0629 \u0627\u0644\u0645\u0648\u0646\u062a (Mounting) \u0641\u064a \u0623\u0646\u0638\u0645\u0629 \u0644\u064a\u0646\u0643\u0633\u060c \u0645\u0639 \u0645\u0642\u0627\u0631\u0646\u0629 \u0628\u0633\u064a\u0637\u0629 \u0645\u0639 \u0648\u064a\u0646\u062f\u0648\u0632. \u0633\u0623\u0642\u062f\u0645 \u0644\u0643 \u0645\u0644\u062e\u0635\u064b\u0627 \u0645\u0646\u0638\u0645\u064b\u0627 \u0644\u0623\u0647\u0645 \u0627\u0644\u0646\u0642\u0627\u0637: 1. \u0645\u0627 \u0647\u0648 \u0627\u0644\u0628\u0627\u0631\u062a\u064a\u0634\u0646 (Partition)\u061f \u0627\u0644\u0628\u0627\u0631\u062a\u064a\u0634\u0646 \u0647\u0648 \u062c\u0632\u0621 \u0645\u062d\u062c\u0648\u0632 \u0645\u0646 \u0627\u0644\u0642\u0631\u0635 \u0627\u0644\u0635\u0644\u0628 (Disk) \u0644\u0647 \u0628\u062f\u0627\u064a\u0629 \u0648\u0646\u0647\u0627\u064a\u0629 \u0645\u062d\u062f\u062f\u0629 (\u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644\u0633\u064a\u0643\u062a\u0648\u0631\u0627\u062a). \u064a\u062a\u0645 \u0625\u0646\u0634\u0627\u0621 \u062c\u062f\u0648\u0644 \u0628\u0627\u0631\u062a\u064a\u0634\u0646 (Partition Table) \u0644\u062a\u0633\u062c\u064a\u0644 \u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u0628\u062f\u0627\u064a\u0629 \u0648\u0627\u0644\u0646\u0647\u0627\u064a\u0629 \u0644\u0643\u0644 \u0628\u0627\u0631\u062a\u064a\u0634\u0646. \u0628\u062f\u0648\u0646 [&hellip;]<\/p>","protected":false},"author":1,"featured_media":2224,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[35],"tags":[],"class_list":["post-2212","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-linux","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/havari.me\/wp-content\/uploads\/2025\/05\/mounting-linux-1.png?fit=1024%2C512&ssl=1","_links":{"self":[{"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/posts\/2212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/comments?post=2212"}],"version-history":[{"count":5,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/posts\/2212\/revisions"}],"predecessor-version":[{"id":2227,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/posts\/2212\/revisions\/2227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/media\/2224"}],"wp:attachment":[{"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/media?parent=2212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/categories?post=2212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/havari.me\/en\/wp-json\/wp\/v2\/tags?post=2212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}