{"id":1828,"date":"2026-11-22T06:02:42","date_gmt":"2026-11-22T14:02:42","guid":{"rendered":"https:\/\/nanzhou.cc\/?p=1828"},"modified":"2026-11-22T06:02:42","modified_gmt":"2026-11-22T14:02:42","slug":"linux-nvme-gpt-filesystems-mount-uefi-boot","status":"publish","type":"post","link":"https:\/\/nanzhou.cc\/index.php\/2026\/11\/22\/linux-nvme-gpt-filesystems-mount-uefi-boot\/","title":{"rendered":"From Bare NVMe to Login Prompt: Partitions, Filesystems, Mounts &#038; UEFI Boot"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When writing user-space application code, we take directories like <code>\/etc<\/code>, <code>\/var\/log<\/code>, and <code>\/home<\/code> for granted. Rarely do we pause to ask which physical chip stores those bytes, how a partition gets grafted onto the directory tree, or how power-on firmware locates the Linux kernel in the first place. Yet the moment you work on automated OS provisioning (<code>netboot<\/code> installation), server\/embedded board bring-up, or a machine that refuses to boot after a reboot, a flood of low-level terms hits all at once: <code>\/dev\/nvme0<\/code> vs. <code>\/dev\/nvme0n1p1<\/code>, <code>GPT<\/code>, <code>ext4<\/code> vs. <code>vfat<\/code>, <code>mount<\/code>, <code>ESP<\/code> (<code>\/boot\/efi<\/code>), <code>BOOTAA64.EFI<\/code>, <code>systemd-boot<\/code> vs. <code>UKI<\/code>, <code>initramfs<\/code>, and <code>\/etc\/fstab<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e73\u65f6\u5728\u7528\u6237\u6001\u5199\u4e1a\u52a1\u4ee3\u7801\u65f6\uff0c\u6211\u4eec\u9762\u5bf9\u7684\u662f\u73b0\u6210\u7684 <code>\/etc<\/code>\u3001<code>\/var\/log<\/code>\u3001<code>\/home<\/code> \u76ee\u5f55\uff0c\u5f88\u5c11\u9700\u8981\u5173\u5fc3\u5e95\u4e0b\u5230\u5e95\u662f\u54ea\u5757\u7269\u7406\u76d8\u3001\u600e\u4e48\u6302\u4e0a\u53bb\u7684\u3001\u673a\u5668\u4e0a\u7535\u540e\u53c8\u662f\u600e\u4e48\u4e00\u6b65\u6b65\u627e\u5230\u5185\u6838\u7684\u3002\u4f46\u53ea\u8981\u4e00\u78b0\u5230\u81ea\u52a8\u5316\u88c5\u673a\uff08<code>netboot<\/code> OS provisioning\uff09\u3001\u670d\u52a1\u5668\u4e0e\u5d4c\u5165\u5f0f\u677f\u5361 bring-up\uff0c\u6216\u8005\u6392\u67e5\u91cd\u542f\u540e\u8fdb\u4e0d\u53bb\u7cfb\u7edf\u7684\u95ee\u9898\uff0c\u4e00\u957f\u4e32\u5e95\u5c42\u672f\u8bed\u5c31\u4f1a\u540c\u65f6\u8e66\u51fa\u6765\uff1a<code>\/dev\/nvme0<\/code> vs <code>\/dev\/nvme0n1p1<\/code>\u3001<code>GPT<\/code>\u3001<code>ext4<\/code> vs <code>vfat<\/code>\u3001<code>mount<\/code>\u3001<code>ESP<\/code> (<code>\/boot\/efi<\/code>)\u3001<code>BOOTAA64.EFI<\/code>\u3001<code>systemd-boot<\/code> vs <code>UKI<\/code>\u3001<code>initramfs<\/code>\u3001<code>\/etc\/fstab<\/code>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead of memorizing isolated textbook definitions, let&#8217;s trace one continuous physical journey\u2014with interactive diagrams below: <strong>how a factory-blank NVMe SSD is partitioned, formatted, mounted, and booted all the way to a running <code>systemd<\/code> login prompt.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0e\u5176\u5b64\u7acb\u5730\u80cc\u6982\u5ff5\u5b9a\u4e49\uff0c\u4e0d\u5982\u7ed3\u5408\u4e0b\u9762\u7684\u4ea4\u4e92\u5f0f\u56fe\u89e3\uff0c\u987a\u7740\u4e00\u6761\u5b8c\u6574\u7684\u7269\u7406\u94fe\u8def\u8d70\u4e00\u904d\uff1a<strong>\u4e00\u5757\u521a\u51fa\u5382\u7684\u7a7a\u767d NVMe SSD\uff0c\u662f\u600e\u4e48\u4e00\u6b65\u6b65\u5b8c\u6210\u5207 <code>partition<\/code>\u3001<code>format<\/code>\u3001<code>mount<\/code>\uff0c\u5e76\u6700\u7ec8\u72ec\u7acb\u5f00\u673a\u8dd1\u8d77 <code>systemd<\/code> \u7684\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1. Decoding Device Names: \/dev\/nvme0 vs. \/dev\/nvme0n1 vs. \/dev\/nvme0n1p1 (\u8bbe\u5907\u547d\u540d\u62c6\u89e3)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Plug an NVMe SSD into a Linux machine and several look-alike entries appear under <code>\/dev\/<\/code>. Reading <strong><code>\/dev\/nvme0n1p1<\/code><\/strong> as three distinct segments makes the naming scheme completely predictable\u2014click any segment or partition block in the interactive explorer below to inspect each layer:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Linux \u673a\u5668\u4e0a\u63d2\u4e00\u5757 NVMe SSD\uff0c<code>\/dev\/<\/code> \u76ee\u5f55\u4e0b\u4f1a\u51fa\u73b0\u597d\u51e0\u4e2a\u957f\u5f97\u5f88\u50cf\u7684\u8bbe\u5907\u8282\u70b9\u3002\u628a <strong><code>\/dev\/nvme0n1p1<\/code><\/strong> \u62c6\u6210\u4e09\u6bb5\u6765\u8bfb\uff0c\u547d\u540d\u89c4\u5f8b\u5c31\u4e00\u76ee\u4e86\u7136\u4e86\u2014\u2014\u53ef\u4ee5\u76f4\u63a5\u70b9\u51fb\u4e0b\u65b9\u4ea4\u4e92\u7ec4\u4ef6\u91cc\u7684\u540d\u5b57\u6216\u78c1\u76d8\u5206\u533a\u5757\u67e5\u770b\u6bcf\u4e00\u5c42\u7684\u4f5c\u7528\uff1a<\/p>\n\n\n\n<div class=\"nz-storage-widget\" id=\"nz-storage-widget\">\n<style>\n#nz-storage-widget { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; padding: 16px; margin: 22px 0; color: #0f172a; box-sizing: border-box; }\n#nz-storage-widget * { box-sizing: border-box; }\n#nz-storage-widget .nz-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; font-size: 13px; }\n#nz-storage-widget .nz-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }\n#nz-storage-widget .nz-pill { cursor: pointer; border: 1px solid #cbd5e1; background: #ffffff; color: #0f172a; border-radius: 6px; padding: 3px 8px; font-size: 13px; font-family: inherit; transition: all 0.15s ease; }\n#nz-storage-widget .nz-pill:hover { border-color: #2563eb; }\n#nz-storage-widget .nz-pill.active { background: #2563eb; color: #ffffff; border-color: #2563eb; font-weight: 600; }\n#nz-storage-widget .nz-muted { color: #64748b; font-size: 12px; }\n#nz-storage-widget .nz-stack { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-bottom: 12px; }\n#nz-storage-widget .nz-hw-row { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }\n#nz-storage-widget .nz-box { cursor: pointer; border: 1px solid #cbd5e1; background: #ffffff; border-radius: 7px; padding: 8px 10px; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; transition: all 0.15s ease; color: #0f172a; }\n#nz-storage-widget .nz-box:hover { border-color: #2563eb; opacity: 1 !important; }\n#nz-storage-widget .nz-box.active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.22); background: #eff6ff; opacity: 1 !important; }\n#nz-storage-widget .nz-box.dim { opacity: 0.68; }\n#nz-storage-widget .nz-arrow { display: flex; align-items: center; color: #64748b; font-weight: bold; }\n#nz-storage-widget .nz-ns-box { flex: 1; min-width: 200px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }\n#nz-storage-widget .nz-parts-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }\n@media (max-width: 680px) { #nz-storage-widget .nz-parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n#nz-storage-widget .nz-b-title { font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n#nz-storage-widget .nz-b-fs { color: #2563eb; font-weight: 600; margin-top: 2px; }\n#nz-storage-widget .nz-b-sub { color: #64748b; font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n#nz-storage-widget .nz-detail { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; font-size: 13.5px; line-height: 1.65; }\n#nz-storage-widget .nz-d-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }\n#nz-storage-widget .nz-d-title { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #0f172a; font-size: 14px; }\n#nz-storage-widget .nz-d-badge { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }\n#nz-storage-widget .nz-d-en { color: #1e293b; margin: 0 0 8px 0; }\n#nz-storage-widget .nz-d-zh { color: #475569; margin: 0; padding-top: 8px; border-top: 1px dashed #e2e8f0; }\n<\/style>\n<div class=\"nz-top\">\n  <div class=\"nz-pills\">\n    <span class=\"nz-muted\">\/dev\/<\/span>\n    <button type=\"button\" class=\"nz-pill\" id=\"nzs-pill-ctrl\" onclick=\"window.nzSelectStorage('ctrl')\">nvme0<\/button>\n    <button type=\"button\" class=\"nz-pill\" id=\"nzs-pill-ns\" onclick=\"window.nzSelectStorage('ns')\">n1<\/button>\n    <button type=\"button\" class=\"nz-pill\" id=\"nzs-pill-part\" onclick=\"window.nzSelectStorage('p2')\">p2<\/button>\n    <span class=\"nz-muted\" style=\"margin-left:6px;\">\u2190 Click any segment or disk block \/ \u70b9\u51fb\u62c6\u89e3<\/span>\n  <\/div>\n  <span class=\"nz-muted\" style=\"font-family:ui-monospace,monospace;\">No nvme0n0 or nvme0p0 (1-indexed)<\/span>\n<\/div>\n<div class=\"nz-stack\">\n  <div class=\"nz-hw-row\">\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-ctrl\" onclick=\"window.nzSelectStorage('ctrl')\">\n      <div class=\"nz-b-title\">\/dev\/nvme0<\/div>\n      <div class=\"nz-b-sub\">Controller (char dev)<\/div>\n    <\/button>\n    <div class=\"nz-arrow\">\u2192<\/div>\n    <button type=\"button\" class=\"nz-box nz-ns-box\" id=\"nzs-box-ns\" onclick=\"window.nzSelectStorage('ns')\">\n      <div><span class=\"nz-b-title\">\/dev\/nvme0n1<\/span> <span class=\"nz-muted\">(Namespace 1 \u00b7 Whole Raw Block Device \/ \u6574\u5757\u88f8\u76d8)<\/span><\/div>\n      <span class=\"nz-muted\">PCIe NVMe SSD<\/span>\n    <\/button>\n  <\/div>\n  <div class=\"nz-parts-grid\">\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-gpt1\" onclick=\"window.nzSelectStorage('gpt')\">\n      <div class=\"nz-b-title\">Primary GPT<\/div>\n      <div class=\"nz-b-fs\">LBA 0..33<\/div>\n      <div class=\"nz-b-sub\">Floor plan \/ \u6237\u578b\u56fe<\/div>\n    <\/button>\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-p1\" onclick=\"window.nzSelectStorage('p1')\">\n      <div class=\"nz-b-title\">nvme0n1p1<\/div>\n      <div class=\"nz-b-fs\">fs: vfat<\/div>\n      <div class=\"nz-b-sub\">512M \u00b7 \/boot\/efi<\/div>\n    <\/button>\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-p2\" onclick=\"window.nzSelectStorage('p2')\">\n      <div class=\"nz-b-title\">nvme0n1p2<\/div>\n      <div class=\"nz-b-fs\">fs: ext4<\/div>\n      <div class=\"nz-b-sub\">32G \u00b7 \/ (Root)<\/div>\n    <\/button>\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-p3\" onclick=\"window.nzSelectStorage('p3')\">\n      <div class=\"nz-b-title\">nvme0n1p3<\/div>\n      <div class=\"nz-b-fs\">fs: ext4<\/div>\n      <div class=\"nz-b-sub\">200G \u00b7 \/data<\/div>\n    <\/button>\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-p4\" onclick=\"window.nzSelectStorage('p4')\">\n      <div class=\"nz-b-title\">nvme0n1p4<\/div>\n      <div class=\"nz-b-fs\">fs: raw<\/div>\n      <div class=\"nz-b-sub\">8M \u00b7 unmounted<\/div>\n    <\/button>\n    <button type=\"button\" class=\"nz-box\" id=\"nzs-box-gpt2\" onclick=\"window.nzSelectStorage('gpt')\">\n      <div class=\"nz-b-title\">Backup GPT<\/div>\n      <div class=\"nz-b-fs\">Disk Tail<\/div>\n      <div class=\"nz-b-sub\">Self-heal copy<\/div>\n    <\/button>\n  <\/div>\n<\/div>\n<div class=\"nz-detail\" id=\"nzs-detail\"><\/div>\n<script>\n(function(){\n  var data = {\n    ctrl: {\n      title: \"\/dev\/nvme0 \u2014 NVMe Controller\",\n      badge: \"Character Device \u00b7 0-indexed\",\n      en: \"Represents the physical NVMe controller chip itself\u2014not storage space. Linux uses \/dev\/nvme0 to send admin commands (SMART health checks, firmware updates, creating namespaces). You cannot partition or format \/dev\/nvme0 directly.\",\n      zh: \"\u4ee3\u8868\u710a\u5728\u677f\u5b50\u4e0a\u7684\u7b2c 0 \u9897 NVMe \u4e3b\u63a7\u82af\u7247\u672c\u8eab\uff08\u4e0d\u662f\u5b58\u50a8\u7a7a\u95f4\uff01\uff09\u3002Linux \u901a\u8fc7\u5b83\u53d1\u9001\u5e95\u5c42\u7ba1\u7406\u6307\u4ee4\uff08\u67e5 SMART \u5065\u5eb7\u5ea6\u3001\u5347\u7ea7\u56fa\u4ef6\u3001\u7ba1\u7406 namespace\uff09\uff0c\u4e0d\u80fd\u76f4\u63a5\u5bf9 \/dev\/nvme0 \u5207 partition \u6216\u505a format\u3002\",\n      boxes: [\"nzs-box-ctrl\"], pill: \"nzs-pill-ctrl\"\n    },\n    ns: {\n      title: \"\/dev\/nvme0n1 \u2014 Namespace 1 (Whole Raw Disk)\",\n      badge: \"Block Device \u00b7 Starts at n1\",\n      en: \"An NVMe controller can split storage into multiple logical namespaces, numbered starting at n1 (never nvme0n0). Most systems create a single namespace, so \/dev\/nvme0n1 is the entire raw disk. Because 'nvme0n1' ends in a digit, Linux inserts 'p' before partition numbers (nvme0n1p1) to avoid ambiguity with nvme0n11.\",\n      zh: \"\u4f01\u4e1a\u7ea7 NVMe \u652f\u6301\u628a\u4e00\u5757\u76d8\u5212\u6210\u591a\u4e2a\u72ec\u7acb namespace\uff08\u4ece n1 \u8d77\u7b97\uff0c\u4e0d\u5b58\u5728 nvme0n0\uff09\u3002\u7edd\u5927\u591a\u6570\u673a\u5668\u53ea\u5efa 1 \u4e2a\uff0c\u6240\u4ee5 \/dev\/nvme0n1 \u5c31\u662f\u6574\u5757\u88f8\u76d8\u3002\u56e0\u4e3a\u540d\u5b57\u672b\u5c3e\u5df2\u7ecf\u662f\u6570\u5b57 1\uff0c\u5207 partition \u65f6\u4e2d\u95f4\u5fc5\u987b\u52a0\u5b57\u6bcd p\uff08\u5982 nvme0n1p1\uff09\uff0c\u5426\u5219\u8ddf\u7b2c 11 \u53f7 namespace \u649e\u540d\u3002\",\n      boxes: [\"nzs-box-ns\"], pill: \"nzs-pill-ns\"\n    },\n    gpt: {\n      title: \"GPT (GUID Partition Table) \u2014 Primary & Backup\",\n      badge: \"Partition Table Metadata\",\n      en: \"Written into the first 34 sectors of nvme0n1 (with a backup copy at the end of the disk). GPT defines up to 128 partition slots: start\/end LBA boundaries, Partition Type GUIDs (e.g., EF00 for ESP), and unique PARTUUIDs. Carving GPT partitions only builds walls between empty rooms\u2014each partition still needs formatting (mkfs) before storing files.\",\n      zh: \"\u5199\u5728\u76d8\u5934\u524d 34 \u4e2a\u6247\u533a\u7684\u5168\u5c40\u201c\u6237\u578b\u56fe\u201d\uff08\u76d8\u5c3e\u81ea\u52a8\u5b58\u4e00\u4efd Backup GPT \u9632\u635f\u574f\uff09\u3002\u8bb0\u5f55\u6bcf\u4e2a partition \u7684\u8d77\u6b62\u6247\u533a\u3001\u69fd\u4f4d\u53f7\u3001\u7528\u9014 GUID\uff08\u4f8b\u5982 EF00 \u4ee3\u8868 ESP \u542f\u52a8\u533a\uff09\u548c\u552f\u4e00 PARTUUID\u3002\u6ce8\u610f\u5199\u5b8c GPT \u53ea\u662f\u780c\u597d\u4e86\u6bdb\u576f\u623f\u9694\u65ad\u5899\uff0c\u8fd8\u5fc5\u987b\u505a format (mkfs) \u88c5\u4e0a filesystem \u624d\u80fd\u5b58\u6587\u4ef6\u3002\",\n      boxes: [\"nzs-box-gpt1\", \"nzs-box-gpt2\"], pill: null\n    },\n    p1: {\n      title: \"\/dev\/nvme0n1p1 \u2014 Partition 1 \u00b7 filesystem: vfat (FAT32)\",\n      badge: \"512 MiB \u00b7 Mounted at \/boot\/efi (ESP)\",\n      en: \"Tagged with the UEFI System Partition (ESP) GUID and formatted as vfat (FAT32). FAT32 lacks Unix permissions and symlinks, so it is never used for \/, but its dead-simple layout allows motherboard firmware (U-Boot \/ EDK2 UEFI) to read \/EFI\/BOOT\/BOOTAA64.EFI or BOOTX64.EFI directly at power-on.\",\n      zh: \"\u6253\u4e0a ESP \u6807\u7b7e\u5e76 format \u6210\u6781\u7b80\u7684 vfat (FAT32)\u3002\u5b83\u4e0d\u652f\u6301 Linux \u6743\u9650\u548c\u8f6f\u94fe\u63a5\uff0c\u7edd\u4e0d\u80fd\u7528\u6765\u88c5\u6839\u76ee\u5f55 \/\uff0c\u4f46\u4e3b\u677f\u56fa\u4ef6\uff08U-Boot \/ UEFI BIOS\uff09\u53ea\u9700\u51e0\u767e\u884c\u4ee3\u7801\u5c31\u80fd\u76f4\u63a5\u8bfb\u51fa\u91cc\u9762\u7684\u542f\u52a8\u7a0b\u5e8f\uff1b\u8fdb\u5165 Linux \u540e\u901a\u5e38 mount \u5728 \/boot\/efi\u3002\",\n      boxes: [\"nzs-box-p1\"], pill: \"nzs-pill-part\"\n    },\n    p2: {\n      title: \"\/dev\/nvme0n1p2 \u2014 Partition 2 \u00b7 filesystem: ext4\",\n      badge: \"32 GiB \u00b7 Mounted at \/ (Root)\",\n      en: \"Formatted as ext4, Linux's primary read-write filesystem supporting POSIX permissions, symlinks, xattrs, and crash-safe journaling. During a RAM-based netboot install, an installer mounts this partition at \/mnt\/newroot to unpack the OS; on disk reboot, initramfs mounts this exact same partition as \/.\",\n      zh: \"format \u6210 Linux \u4e3b\u529b\u8bfb\u5199\u683c\u5f0f ext4\uff08\u652f\u6301\u6743\u9650\u3001\u8f6f\u94fe\u63a5\u4e0e\u9632\u65ad\u7535\u635f\u574f\u7684 Journaling \u65e5\u5fd7\uff09\u3002\u5728 netboot \u5185\u5b58\u88c5\u673a\u65f6\uff0c\u5b89\u88c5\u5668\u5148\u628a\u5b83\u4e34\u65f6 mount \u5230 \/mnt\/newroot \u5199\u5165\u7cfb\u7edf\uff1b\u91cd\u542f\u4ece\u786c\u76d8\u542f\u52a8\u65f6\uff0cinitramfs \u518d\u628a\u540c\u4e00\u4e2a partition \u6b63\u5f0f mount \u6210\u6839\u76ee\u5f55 \/\u3002\",\n      boxes: [\"nzs-box-p2\"], pill: \"nzs-pill-part\"\n    },\n    p3: {\n      title: \"\/dev\/nvme0n1p3 \u2014 Partition 3 \u00b7 filesystem: ext4\",\n      badge: \"200 GiB \u00b7 Mounted at \/data (noexec)\",\n      en: \"Dedicated ext4 data\/log partition mounted at \/data via \/etc\/fstab (often with 'noexec,nosuid,nodev' for security). If you forget to mount nvme0n1p3, writes to \/data silently land inside the 32 GiB root partition (p2) instead!\",\n      zh: \"\u72ec\u7acb\u7684 ext4 \u6570\u636e\u4e0e\u65e5\u5fd7\u5206\u533a\uff0c\u5f00\u673a\u65f6\u7531 systemd \u8bfb\u53d6 \/etc\/fstab \u81ea\u52a8 mount \u5230 \/data\uff08\u5e38\u52a0 noexec \u9632\u6b62\u6267\u884c\u6076\u610f\u4e8c\u8fdb\u5236\uff09\u3002\u5982\u679c\u5fd8\u4e86 mount \u5c31\u5f80 \/data \u5199\u65e5\u5fd7\uff0c\u6570\u636e\u5176\u5b9e\u5168\u585e\u8fdb\u4e86 32G \u6839\u5206\u533a p2 \u91cc\uff01\",\n      boxes: [\"nzs-box-p3\"], pill: \"nzs-pill-part\"\n    },\n    p4: {\n      title: \"\/dev\/nvme0n1p4 \u2014 Partition 4 \u00b7 filesystem: raw (None)\",\n      badge: \"8 MiB \u00b7 Unmounted Raw Crash Log\",\n      en: \"Left completely unformatted (raw) and omitted from \/etc\/fstab. When a fatal Kernel Panic strikes, complex filesystems like ext4 cannot be safely written, so kernel pstore\/kdump writes crash logs straight into raw sectors for recovery on the next boot.\",\n      zh: \"\u4e0d\u88c5\u4efb\u4f55 filesystem\uff08\u4e0d\u505a mkfs\uff09\uff0c\u4e5f\u4e0d\u5199\u8fdb \/etc\/fstab \u53bb mount\u3002\u5f53 Linux \u5185\u6838\u53d1\u751f\u81f4\u547d Kernel Panic \u77ac\u95f4\uff0cext4 \u5df2\u7ecf\u4e0d\u53ef\u4fe1\uff0c\u5185\u6838\u76f4\u63a5\u5f80\u8fd9\u7247\u88f8\u6247\u533a\u786c\u5199\u5d29\u6e83\u73b0\u573a\uff0c\u4f9b\u4e0b\u6b21\u5f00\u673a\u635e\u53d6\u6392\u67e5\u3002\",\n      boxes: [\"nzs-box-p4\"], pill: \"nzs-pill-part\"\n    }\n  };\n  var allBoxes = [\"nzs-box-ctrl\",\"nzs-box-ns\",\"nzs-box-gpt1\",\"nzs-box-gpt2\",\"nzs-box-p1\",\"nzs-box-p2\",\"nzs-box-p3\",\"nzs-box-p4\"];\n  var allPills = [\"nzs-pill-ctrl\",\"nzs-pill-ns\",\"nzs-pill-part\"];\n  window.nzSelectStorage = function(key) {\n    var item = data[key];\n    if (!item) return;\n    for (var i = 0; i < allBoxes.length; i++) {\n      var el = document.getElementById(allBoxes[i]);\n      if (!el) continue;\n      var active = item.boxes.indexOf(allBoxes[i]) !== -1;\n      el.className = el.className.replace(\/\b(active|dim)\b\/g, \"\").trim() + (active ? \" active\" : \" dim\");\n    }\n    for (var j = 0; j < allPills.length; j++) {\n      var pel = document.getElementById(allPills[j]);\n      if (!pel) continue;\n      pel.className = \"nz-pill\" + (item.pill === allPills[j] ? \" active\" : \"\");\n    }\n    var det = document.getElementById(\"nzs-detail\");\n    if (det) {\n      det.innerHTML = '<div class=\"nz-d-head\"><span class=\"nz-d-title\">' + item.title + '<\/span><span class=\"nz-d-badge\">' + item.badge + '<\/span><\/div><p class=\"nz-d-en\">' + item.en + '<\/p><p class=\"nz-d-zh\">' + item.zh + '<\/p>';\n    }\n  };\n  window.nzSelectStorage(\"ns\");\n})();\n<\/script>\n<\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Device Path<\/th><th>Segment Meaning<\/th><th>Index Rule<\/th><th>Stores Files?<\/th><\/tr><\/thead><tbody><tr><td><code>\/dev\/nvme0<\/code><\/td><td><strong>NVMe Controller<\/strong> (physical controller chip \/ \u4e3b\u63a7\u82af\u7247\u672c\u8eab)<\/td><td>0-indexed (<code>nvme0<\/code>, <code>nvme1<\/code>&#8230;)<\/td><td><strong>No.<\/strong> Character device for admin commands (SMART, firmware, namespaces).<\/td><\/tr><tr><td><code>\/dev\/nvme0n1<\/code><\/td><td><strong>Namespace 1<\/strong> (whole raw <code>block device<\/code> \/ \u6574\u5757\u88f8\u76d8)<\/td><td>1-indexed (<strong>no <code>nvme0n0<\/code>!<\/strong>)<\/td><td>Whole unpartitioned disk; enterprise NVMe supports multiple namespaces, most use one (<code>n1<\/code>).<\/td><\/tr><tr><td><code>\/dev\/nvme0n1p1<\/code><\/td><td><strong>Partition 1<\/strong> (first slice of <code>nvme0n1<\/code> \/ \u7b2c 1 \u4e2a\u5206\u533a)<\/td><td>1-indexed (<strong>no <code>nvme0p0<\/code>!<\/strong>)<\/td><td><strong>Yes<\/strong>, once formatted with a <code>filesystem<\/code> and <code>mount<\/code>ed.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Why does SATA use <code>sda1<\/code>, while NVMe inserts a <code>p<\/code> (<code>nvme0n1p1<\/code>)?<\/strong> Linux applies a simple disambiguation rule: when a disk name ends in a <em>letter<\/em> (like <code>sda<\/code>), appending a digit (<code>sda1<\/code>) is unambiguous. When a disk name already ends in a <em>digit<\/em> (like <code>nvme0n1<\/code> or eMMC&#8217;s <code>mmcblk0<\/code>), appending <code>1<\/code> directly would yield <code>nvme0n11<\/code>\u2014impossible to tell namespace 11 apart from namespace 1, partition 1. Thus Linux always inserts <strong><code>p<\/code><\/strong> before the partition number whenever the base block device ends in a digit.<\/p><p><strong>\u4e3a\u4ec0\u4e48\u8001\u5f0f SATA \u76d8\u53eb <code>sda1<\/code>\uff0c\u800c NVMe \u4e2d\u95f4\u8981\u591a\u52a0\u4e00\u4e2a\u5b57\u6bcd <code>p<\/code> \u53eb <code>nvme0n1p1<\/code>\uff1f<\/strong> \u8fd9\u662f Linux \u5185\u6838\u7684\u6d88\u6b67\u89c4\u5219\uff1a\u4ee5\u5b57\u6bcd\u7ed3\u5c3e\u7684\u76d8\u540d\uff08<code>sda<\/code>\uff09\u76f4\u63a5\u62fc\u6570\u5b57 <code>sda1<\/code> \u4e0d\u4f1a\u6b67\u4e49\uff1b\u4f46 <code>nvme0n1<\/code>\uff08\u4ee5\u53ca eMMC \u95ea\u5b58 <code>mmcblk0<\/code>\uff09\u672c\u8eab\u4ee5\u6570\u5b57\u7ed3\u5c3e\uff0c\u5982\u679c\u4e0d\u52a0\u5206\u9694\u7b26\u5199\u6210 <code>nvme0n11<\/code>\uff0c\u5c31\u5206\u4e0d\u6e05\u662f\u7b2c 11 \u53f7 <code>namespace<\/code> \u8fd8\u662f <code>n1<\/code> \u7684\u7b2c 1 \u4e2a <code>partition<\/code>\u3002\u56e0\u6b64\u6570\u5b57\u7ed3\u5c3e\u7684 <code>block device<\/code> \u540e\u9762\u8ddf <code>partition<\/code> \u53f7\u65f6\u4e00\u5f8b\u52a0 <strong><code>p<\/code><\/strong>\u3002<\/p><\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. Three Steps to Usable Storage: GPT (Partition) \u2192 Filesystem (Format) \u2192 Mount<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Turning a factory-blank <code>\/dev\/nvme0n1<\/code> into usable directories takes three strictly ordered steps\u2014much like <strong>turning an empty concrete warehouse into an open retail store<\/strong>: (1) write a <code>GPT<\/code> floor plan to divide empty rooms (<code>partition<\/code>s), (2) <code>format<\/code> each room to install shelving and catalog indexes (<code>filesystem<\/code>), and (3) <code>mount<\/code> each room onto a directory path so applications can walk in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u628a\u4e00\u5757\u521a\u51fa\u5382\u7684 <code>\/dev\/nvme0n1<\/code> \u53d8\u6210\u80fd\u8bfb\u5199\u7684\u76ee\u5f55\uff0c\u5fc5\u987b\u8d70\u5b8c\u4e25\u683c\u9012\u8fdb\u7684\u4e09\u6b65\u2014\u2014\u5c31\u50cf<strong>\u628a\u7a7a\u65f7\u7684\u6bdb\u576f\u5927\u4ed3\u5e93\u6539\u9020\u6210\u6b63\u5f0f\u8425\u4e1a\u7684\u5546\u573a<\/strong>\uff1a\uff081\uff09\u5199 <code>GPT<\/code> \u6237\u578b\u56fe\u780c\u51fa\u9694\u65ad\u623f\u95f4\uff08<code>partition<\/code>\uff09\uff1b\uff082\uff09\u5bf9\u6bcf\u4e2a\u623f\u95f4\u505a <code>format<\/code> \u88c5\u4e0a\u8d27\u67b6\u548c\u76ee\u5f55\u7d22\u5f15\u672c\uff08<code>filesystem<\/code>\uff09\uff1b\uff083\uff09\u901a\u8fc7 <code>mount<\/code> \u628a\u623f\u95f4\u6302\u4e0a\u95e8\u724c\u53f7\u63a5\u5165\u76ee\u5f55\u6811\u6b63\u5f0f\u8425\u4e1a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.1 GPT (GUID Partition Table): Drawing the Floor Plan<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A brand-new <code>nvme0n1<\/code> is billions of flat, unorganized logical blocks (<code>LBA 0, 1, 2...<\/code>). <strong><code>GPT<\/code><\/strong> writes a compact partition table into the first 34 sectors (~17 KiB) at the head of the disk and automatically mirrors a <strong>Backup <code>GPT<\/code><\/strong> at the very tail of the disk for crash recovery. Each entry records the slot number (<code>1..128<\/code>, which does not even have to match physical sector order!), <code>Start\/End LBA<\/code> boundaries, a standardized <code>Partition Type GUID<\/code> (such as <code>EF00<\/code> to mark an <code>EFI System Partition<\/code>), and a globally unique <code>PARTUUID<\/code>. Carving <code>GPT<\/code> <code>partition<\/code>s only builds walls\u2014inside each room is still raw unformatted bytes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u521a\u51fa\u5382\u7684 <code>nvme0n1<\/code> \u53ea\u662f\u4e00\u5927\u7247\u8fde\u7eed\u65e0\u5e8f\u7684\u6247\u533a\uff08<code>LBA 0, 1, 2...<\/code>\uff09\u3002<strong><code>GPT<\/code><\/strong> \u5728\u76d8\u5934\u524d 34 \u4e2a\u6247\u533a\u5199\u5165\u5168\u5c40\u6237\u578b\u56fe\uff0c\u540c\u65f6\u5728\u76d8\u5c3e\u81ea\u52a8\u5b58\u4e00\u4efd <strong>Backup <code>GPT<\/code><\/strong> \u9632\u635f\u574f\u81ea\u6108\u3002\u6bcf\u4e00\u9879\u8bb0\u5f55\u69fd\u4f4d\u53f7\uff08<code>1..128<\/code>\uff0c\u4e0d\u5fc5\u4e0e\u7269\u7406\u5148\u540e\u987a\u5e8f\u4e00\u81f4\uff09\u3001\u8d77\u6b62\u6247\u533a <code>Start\/End LBA<\/code>\u3001\u7528\u9014\u6807\u7b7e <code>Partition Type GUID<\/code>\uff08\u5982 <code>EF00<\/code> \u4ee3\u8868 <code>ESP<\/code> \u542f\u52a8\u533a\uff09\u4ee5\u53ca\u552f\u4e00\u8eab\u4efd\u8bc1 <code>PARTUUID<\/code>\u3002\u6ce8\u610f\u5207\u5b8c <code>GPT<\/code> <code>partition<\/code> \u53ea\u662f\u780c\u597d\u4e86\u6bdb\u576f\u5899\uff0c\u91cc\u9762\u8fd8\u4e0d\u80fd\u5b58\u4efb\u4f55\u6587\u4ef6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.2 Format &#038; Filesystem Types: Installing Shelves for Each Room<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Running a <strong><code>format<\/code><\/strong> utility (<code>mkfs.ext4<\/code>, <code>mkfs.vfat<\/code>) writes inodes, directory trees, and allocation tables inside a <code>partition<\/code>. A single Linux disk deliberately mixes multiple <strong><code>filesystem types<\/code><\/strong> because firmware, user-space services, and crash handlers have completely different requirements:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c <strong><code>format<\/code>\uff08\u5982 <code>mkfs.ext4<\/code>\u3001<code>mkfs.vfat<\/code>\uff09<\/strong>\uff0c\u5c31\u662f\u5728 <code>partition<\/code> \u5185\u90e8\u5efa\u7acb\u7ba1\u7406\u6587\u4ef6\u540d\u3001\u6743\u9650\u548c\u6570\u636e\u5757\u7684\u7d22\u5f15\u7ed3\u6784\uff08\u5373 <strong><code>filesystem<\/code><\/strong>\uff09\u3002\u540c\u4e00\u5757\u786c\u76d8\u5f80\u5f80\u6df7\u7528\u591a\u79cd <strong><code>filesystem types<\/code><\/strong>\uff0c\u56e0\u4e3a\u4e0d\u540c\u5206\u533a\u7684\u8bfb\u53d6\u65b9\u548c\u7ea6\u675f\u622a\u7136\u4e0d\u540c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Filesystem Type<\/th><th>Typical Use<\/th><th>Why Choose It? \/ \u6838\u5fc3\u539f\u56e0<\/th><\/tr><\/thead><tbody><tr><td><code>ext4<\/code><\/td><td><code>\/<\/code> (Root), <code>\/data<\/code><\/td><td>Workhorse Linux read-write <code>filesystem<\/code>: POSIX permissions, symlinks, <code>chattr +i<\/code>, and power-loss <strong>journaling<\/strong>.<br>Linux \u4e3b\u529b\u8bfb\u5199\u683c\u5f0f\uff0c\u652f\u6301\u5b8c\u6574\u6743\u9650\u3001\u8f6f\u94fe\u63a5\u4e0e\u9632\u65ad\u7535\u635f\u574f\u7684\u65e5\u5fd7\u673a\u5236\u3002<\/td><\/tr><tr><td><code>vfat<\/code> (<code>FAT32<\/code>)<\/td><td><code>\/boot\/efi<\/code> (<code>ESP<\/code>)<\/td><td>Mandated by UEFI spec. No Unix permissions (never use for <code>\/<\/code>), but simple enough for motherboard firmware (<code>U-Boot<\/code> \/ UEFI) to read directly.<br>UEFI \u6807\u51c6\u94a6\u5b9a\u683c\u5f0f\uff0c\u7ed3\u6784\u6781\u7b80\uff0c\u4e3b\u677f\u56fa\u4ef6\u65e0\u9700\u8dd1 Linux \u5c31\u80fd\u76f4\u63a5\u8bfb\u53d6\u542f\u52a8\u6587\u4ef6\u3002<\/td><\/tr><tr><td><code>raw<\/code> (none)<\/td><td>Crash log (<code>pstore<\/code>)<\/td><td>No <code>mkfs<\/code> and never <code>mount<\/code>ed. During a <code>Kernel Panic<\/code>, the kernel writes raw crash bytes directly to sectors.<br>\u4e0d\u505a\u683c\u5f0f\u5316\u4e5f\u4e0d\u6302\u8f7d\uff0c\u4f9b\u5185\u6838\u5d29\u6e83\u77ac\u95f4\u76f4\u63a5\u88f8\u5199\u73b0\u573a\u65e5\u5fd7\u3002<\/td><\/tr><tr><td><code>tmpfs<\/code> \/ <code>ramfs<\/code><\/td><td><code>netboot<\/code> root, <code>\/run<\/code><\/td><td>Pure <strong><code>memory<\/code>-backed<\/strong> <code>filesystem types<\/code>; fast and wiped on reboot\u2014ideal for network installers partitioning local disks.<br>\u7eaf\u9a7b\u7559\u5728 <code>memory<\/code> \u4e2d\u7684\u4e34\u65f6\u6587\u4ef6\u7cfb\u7edf\uff0c\u65ad\u7535\u5373\u5931\uff0c\u5e38\u7528\u4e8e <code>netboot<\/code> \u5185\u5b58\u88c5\u673a\u73af\u5883\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2.3 How Mount and Partition Relate (Mount \u4e0e Partition \u7684\u5173\u7cfb)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Why can&#8217;t you read or write <code>\/dev\/nvme0n1p3\/app.log<\/code> right after formatting <code>nvme0n1p3<\/code> as <code>ext4<\/code>? Unlike Windows\u2014which assigns a separate tree root (<code>C:\\<\/code>, <code>D:\\<\/code>) to every formatted <code>partition<\/code>\u2014Linux maintains a <strong>single global directory tree (<code>Virtual File System<\/code>, <code>VFS<\/code>)<\/strong> rooted at <strong><code>\/<\/code><\/strong>. The file <code>\/dev\/nvme0n1p3<\/code> is just the raw block device handle; until attached, a formatted <code>partition<\/code> is an isolated island disconnected from <code>\/<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4ec0\u4e48\u628a <code>nvme0n1p3<\/code> \u683c\u6210 <code>ext4<\/code> \u540e\uff0c\u8fd8\u662f\u4e0d\u80fd\u76f4\u63a5\u5199 <code>\/dev\/nvme0n1p3\/app.log<\/code>\uff1f\u56e0\u4e3a Windows \u7ed9\u6bcf\u4e2a <code>partition<\/code> \u53d1\u4e00\u68f5\u72ec\u7acb\u76d8\u7b26\u6811\uff08<code>C:\\<\/code>\u3001<code>D:\\<\/code>\uff09\uff0c\u800c Linux \u5168\u5c40\u53ea\u6709<strong>\u552f\u4e00\u4e00\u68f5\u4ece <code>\/<\/code> \u957f\u51fa\u6765\u7684\u5355\u68f5\u76ee\u5f55\u6811\uff08<code>VFS<\/code>\uff09<\/strong>\u3002<code>\/dev\/nvme0n1p3<\/code> \u4ee3\u8868\u7684\u53ea\u662f\u88f8\u786c\u4ef6\u5757\u672c\u8eab\uff1b\u5728\u6302\u8f7d\u4e4b\u524d\uff0c\u8fd9\u4e2a\u683c\u5f0f\u5316\u597d\u7684 <code>partition<\/code> \u53ea\u662f\u4e00\u5ea7\u8ddf <code>\/<\/code> \u6ca1\u6709\u4efb\u4f55\u8def\u5f84\u76f8\u8fde\u7684\u201c\u5b64\u5c9b\u4ed3\u5e93\u201d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>mount<\/code> is the graft operation<\/strong> that binds the <code>filesystem<\/code> inside a <code>partition<\/code> onto an empty directory (the <strong><code>mount point<\/code><\/strong>, e.g., <code>\/data<\/code>). Decoupling physical <code>partition<\/code>s from directory paths is exactly what makes OS installation possible: during a <code>netboot<\/code> install (where <code>\/<\/code> is a <code>memory<\/code> <code>tmpfs<\/code>), the installer temporarily <strong><code>mount<\/code>s <code>nvme0n1p2<\/code> at <code>\/mnt\/newroot<\/code><\/strong> to populate <code>\/mnt\/newroot\/etc<\/code> and <code>\/mnt\/newroot\/usr<\/code>; after rebooting from disk, that exact same <code>nvme0n1p2<\/code> is <strong><code>mount<\/code>ed as <code>\/<\/code><\/strong>, so <code>\/mnt\/newroot\/etc<\/code> seamlessly becomes <code>\/etc<\/code>! Conversely, if you forget to <code>mount<\/code> your 200 GB <code>nvme0n1p3<\/code> onto <code>\/data<\/code>, writes to <code>\/data<\/code> will quietly fill up your small root <code>partition<\/code> instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>mount<\/code> \u5c31\u662f\u201c\u5ac1\u63a5\u201d\u6865\u6881<\/strong>\uff1a\u628a\u67d0\u4e2a <code>partition<\/code> \u91cc\u7684 <code>filesystem<\/code> \u7ed1\u5b9a\u5230\u5355\u68f5\u76ee\u5f55\u6811\u7684\u67d0\u4e2a\u7a7a\u76ee\u5f55\uff08<code>mount point<\/code>\uff0c\u5982 <code>\/data<\/code>\uff09\u4e0a\u3002\u628a\u7269\u7406 <code>partition<\/code> \u548c\u76ee\u5f55\u8def\u5f84\u89e3\u8026\uff0c\u6b63\u662f\u91cd\u88c5\u7cfb\u7edf\u7684\u6838\u5fc3\u539f\u7406\uff1a\u5728 <code>netboot<\/code> \u88c5\u673a\u9636\u6bb5\uff08\u6b64\u65f6 <code>\/<\/code> \u5728 <code>memory<\/code> \u7684 <code>tmpfs<\/code> \u91cc\uff09\uff0c\u5b89\u88c5\u5668\u5148\u628a\u786c\u76d8\u6839\u5206\u533a <code>nvme0n1p2<\/code> \u4e34\u65f6 <strong><code>mount<\/code> \u5230 <code>\/mnt\/newroot<\/code><\/strong> \u5f80\u91cc\u62f7\u7cfb\u7edf\u6587\u4ef6\uff1b\u7b49\u91cd\u542f\u4ece\u786c\u76d8\u5f15\u5bfc\u65f6\uff0c\u540c\u4e00\u4e2a <code>nvme0n1p2<\/code> \u518d\u88ab <strong><code>mount<\/code> \u6210\u771f\u6b63\u7684 <code>\/<\/code><\/strong>\uff0c\u521a\u624d\u62f7\u8fdb\u53bb\u7684 <code>\/mnt\/newroot\/etc<\/code> \u81ea\u7136\u5c31\u53d8\u6210\u4e86\u5f00\u673a\u540e\u7684 <code>\/etc<\/code>\uff01\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u5fd8\u4e86 <code>mount<\/code> \u6570\u636e\u76d8\u5c31\u5f80 <code>\/data<\/code> \u5199\u65e5\u5fd7\uff0c\u6570\u636e\u5176\u5b9e\u5168\u585e\u8fdb\u4e86\u6839\u5206\u533a\u5e95\u4e0b\u7684\u666e\u901a\u6587\u4ef6\u5939\u91cc\uff0c\u6781\u6613\u628a\u6839\u5206\u533a\u6491\u7206\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. The UEFI Boot Sequence: ESP, BOOTAA64.EFI, UKI, and \/etc\/fstab (\u5f00\u673a\u63a5\u529b\u8d5b)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why does booting pass through so many handoffs instead of jumping straight into <code>\/sbin\/init<\/code>? Because power-on to user-space crosses <strong>separate execution worlds that share no runtime <code>memory<\/code><\/strong>. Step through both tabs of the interactive UEFI Boot Explorer below to see each relay stage and compare <code>systemd-boot<\/code> against a single-file <code>UKI<\/code>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4ec0\u4e48\u5f00\u673a\u4e0d\u80fd\u4e00\u6b65\u8df3\u8fdb <code>\/sbin\/init<\/code>\uff0c\u975e\u8981\u7ecf\u8fc7 <code>ESP<\/code>\u3001<code>BOOTAA64.EFI<\/code>\u3001<code>initramfs<\/code> \u548c <code>\/etc\/fstab<\/code>\uff1f\u56e0\u4e3a\u5f00\u673a\u6a2a\u8de8\u4e86<strong>\u51e0\u4e2a\u4e92\u4e0d\u5171\u4eab\u8fd0\u884c\u6001 <code>memory<\/code> \u7684\u72ec\u7acb\u9636\u6bb5<\/strong>\uff0c\u53ea\u80fd\u9760\u78c1\u76d8\u4e0a\u56fa\u5b9a\u4f4d\u7f6e\u7684\u7ea6\u5b9a\u4e00\u68d2\u68d2\u4ea4\u63a5\u3002\u4f60\u53ef\u4ee5\u70b9\u51fb\u4e0b\u65b9\u4ea4\u4e92\u5f0f\u5bfc\u89c8\u5207\u6362\u67e5\u770b\u4e94\u6b65\u63a5\u529b\u7ec6\u8282\uff0c\u4ee5\u53ca <code>systemd-boot<\/code> \u4e0e <code>UKI<\/code> \u7684\u7ed3\u6784\u5dee\u5f02\uff1a<\/p>\n\n\n\n<div class=\"nz-boot-widget\" id=\"nz-boot-widget\">\n<style>\n#nz-boot-widget { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; padding: 16px; margin: 22px 0; color: #0f172a; box-sizing: border-box; }\n#nz-boot-widget * { box-sizing: border-box; }\n#nz-boot-widget .nzb-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; }\n#nz-boot-widget .nzb-tab-btn { cursor: pointer; border: 1px solid #cbd5e1; background: #ffffff; color: #334155; border-radius: 6px; padding: 5px 12px; font-size: 13px; font-weight: 600; transition: all 0.15s ease; }\n#nz-boot-widget .nzb-tab-btn.active { background: #2563eb; color: #ffffff; border-color: #2563eb; }\n#nz-boot-widget .nzb-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }\n@media (max-width: 680px) { #nz-boot-widget .nzb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n#nz-boot-widget .nzb-step { cursor: pointer; border: 1px solid #cbd5e1; background: #ffffff; border-radius: 7px; padding: 8px 10px; text-align: left; transition: all 0.15s ease; opacity: 0.72; }\n#nz-boot-widget .nzb-step:hover { border-color: #2563eb; opacity: 1; }\n#nz-boot-widget .nzb-step.active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.22); background: #eff6ff; opacity: 1; }\n#nz-boot-widget .nzb-s-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; color: #2563eb; font-weight: 700; }\n#nz-boot-widget .nzb-s-title { font-size: 13px; font-weight: 700; color: #0f172a; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n#nz-boot-widget .nzb-s-sub { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n#nz-boot-widget .nzb-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; font-size: 13.5px; line-height: 1.65; }\n#nz-boot-widget .nzb-row { margin-bottom: 6px; color: #1e293b; }\n#nz-boot-widget .nzb-row-zh { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f0; color: #475569; }\n#nz-boot-widget .nzb-label { font-weight: 700; color: #1d4ed8; }\n#nz-boot-widget .nzb-warn { font-weight: 700; color: #b45309; }\n#nz-boot-widget .nzb-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }\n@media (max-width: 680px) { #nz-boot-widget .nzb-compare { grid-template-columns: 1fr; } }\n#nz-boot-widget .nzb-mono-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px; margin: 8px 0; color: #0f172a; }\n#nz-boot-widget .nzb-uki-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 6px; text-align: center; }\n#nz-boot-widget .nzb-uki-chip { background: #eff6ff; border: 1px solid #93c5fd; border-radius: 4px; padding: 4px 2px; font-size: 11px; font-weight: 600; color: #1e40af; }\n<\/style>\n<div class=\"nzb-tabs\">\n  <div style=\"display:flex;gap:6px;flex-wrap:wrap;\">\n    <button type=\"button\" class=\"nzb-tab-btn active\" id=\"nzb-tab-relay\" onclick=\"window.nzSwitchBootTab('relay')\">1. Boot Relay (\u5f00\u673a\u63a5\u529b\u8d5b)<\/button>\n    <button type=\"button\" class=\"nzb-tab-btn\" id=\"nzb-tab-efi\" onclick=\"window.nzSwitchBootTab('efi')\">2. systemd-boot vs. UKI<\/button>\n  <\/div>\n  <span style=\"font-size:12px;color:#64748b;font-family:ui-monospace,monospace;\">UEFI Diskboot Explorer<\/span>\n<\/div>\n<div id=\"nzb-panel-relay\">\n  <div class=\"nzb-steps\" id=\"nzb-step-btns\"><\/div>\n  <div class=\"nzb-card\" id=\"nzb-relay-detail\"><\/div>\n<\/div>\n<div id=\"nzb-panel-efi\" style=\"display:none;\">\n  <div class=\"nzb-compare\">\n    <div class=\"nzb-card\">\n      <div style=\"font-weight:700;font-size:14px;margin-bottom:4px;\">Pattern A: Menu Loader (systemd-boot \/ GRUB)<\/div>\n      <div style=\"color:#475569;font-size:12.5px;\">Two-step decoupled loader \u00b7 \u4e24\u6b65\u8d70\u83dc\u5355\u52a0\u8f7d\u5668\uff08\u672c\u5730\u542f\u52a8\u4e3b\u6d41\uff09<\/div>\n      <div class=\"nzb-mono-box\">\n        <div>1. \/EFI\/BOOT\/BOOTAA64.EFI <span style=\"color:#64748b;\">(~100 KB menu)<\/span><\/div>\n        <div style=\"padding-left:12px;color:#2563eb;\">\u2193 reads plain-text config<\/div>\n        <div>2. \/loader\/entries\/linux.conf<\/div>\n        <div style=\"padding-left:12px;color:#2563eb;\">\u2193 loads into memory<\/div>\n        <div>3. \/vmlinuz + \/initrd.img<\/div>\n      <\/div>\n      <div style=\"font-size:12.5px;color:#334155;\">Kernel upgrades only copy a new <code>vmlinuz<\/code> and edit <code>.conf<\/code>\u2014easy A\/B rollback.<br><span style=\"color:#64748b;\">\u5347\u7ea7\u5185\u6838\u53ea\u9700\u653e\u65b0 <code>vmlinuz<\/code> \u5e76\u6539\u51e0\u884c\u6587\u672c\u914d\u7f6e\uff0c\u5929\u7136\u652f\u6301\u591a\u7248\u672c\u56de\u6eda\u3002<\/span><\/div>\n    <\/div>\n    <div class=\"nzb-card\">\n      <div style=\"font-weight:700;font-size:14px;margin-bottom:4px;\">Pattern B: Unified Kernel Image (UKI)<\/div>\n      <div style=\"color:#475569;font-size:12.5px;\">Single self-contained PE binary \u00b7 \u4e00\u6b65\u5230\u4f4d\u591a\u5408\u4e00\u955c\u50cf<\/div>\n      <div class=\"nzb-mono-box\">\n        <div style=\"font-weight:700;\">\/EFI\/BOOT\/BOOTAA64.EFI (~50 MB all-in-one):<\/div>\n        <div class=\"nzb-uki-parts\">\n          <div class=\"nzb-uki-chip\">efi.stub<\/div>\n          <div class=\"nzb-uki-chip\">.cmdline<\/div>\n          <div class=\"nzb-uki-chip\">.linux<\/div>\n          <div class=\"nzb-uki-chip\">.initrd<\/div>\n        <\/div>\n      <\/div>\n      <div style=\"font-size:12.5px;color:#334155;\">Zero external config files. Ideal for 1-file HTTP netboot and atomic Secure Boot signing.<br><span style=\"color:#64748b;\">\u96f6\u5916\u90e8\u6587\u4ef6\u4f9d\u8d56\uff0c\u6781\u9002\u5408 HTTP \u5355\u6587\u4ef6 netboot \u4e0b\u8f7d\u5373\u8dd1\u4e0e\u6574\u5305\u7b7e\u540d\u6821\u9a8c\u3002<\/span><\/div>\n    <\/div>\n  <\/div>\n<\/div>\n<script>\n(function(){\n  var steps = [\n    {\n      num: \"Step 1\", title: \"SPI Firmware\", sub: \"U-Boot \/ EDK2\",\n      en: \"<span class='nzb-label'>Role:<\/span> Runs from motherboard SPI Flash at power-on. Firmware knows nothing about ext4 or kernel version names\u2014it scans GPT to locate a vfat EFI System Partition (ESP).\",\n      enWarn: \"<span class='nzb-warn'>If missing:<\/span> Blank disk has no ESP -> firmware falls back to network boot (DHCP\/HTTP) or boot loop.\",\n      zh: \"<span class='nzb-label'>\u804c\u8d23\uff1a<\/span>\u4e0a\u7535\u76f4\u63a5\u4ece\u4e3b\u677f SPI Flash \u8fd0\u884c\u3002\u56fa\u4ef6\u4e0d\u8026\u5408 Linux \u5185\u6838\u6587\u4ef6\u540d\uff0c\u53ea\u6309 UEFI \u6807\u51c6\u53bb\u626b\u786c\u76d8 GPT \u627e\u6253\u6807\u4e3a ESP \u7684 vfat \u5206\u533a\u3002<br><span class='nzb-warn'>\u7f3a\u5931\u540e\u679c\uff1a<\/span>\u65b0\u51fa\u5382\u7a7a\u767d\u76d8\u6ca1\u6709 ESP\uff0c\u56fa\u4ef6\u5c31\u4f1a\u56de\u9000\u5230\u7f51\u7edc\u542f\u52a8 (netboot) \u6216\u5faa\u73af\u91cd\u8bd5\u3002\"\n    },\n    {\n      num: \"Step 2\", title: \"ESP (\/boot\/efi)\", sub: \"nvme0n1p1 \u00b7 vfat\",\n      en: \"<span class='nzb-label'>Role:<\/span> Small FAT32 (vfat) partition readable by minimal firmware drivers. Once Linux boots, it mounts this partition at \/boot\/efi for easy updates.\",\n      enWarn: \"<span class='nzb-warn'>If missing:<\/span> If formatted as ext4 instead of vfat, standard UEFI firmware cannot open the boot partition.\",\n      zh: \"<span class='nzb-label'>\u804c\u8d23\uff1a<\/span>\u6781\u7b80 FAT32 (vfat) \u5c0f\u5206\u533a\uff0c\u4efb\u4f55\u56fa\u4ef6\u81ea\u5e26\u9a71\u52a8\u90fd\u80fd\u8bfb\uff1bLinux \u542f\u52a8\u540e\u628a\u5b83 mount \u5230 \/boot\/efi \u65b9\u4fbf\u66f4\u65b0\u3002<br><span class='nzb-warn'>\u7f3a\u5931\u540e\u679c\uff1a<\/span>\u5982\u679c\u8bef\u683c\u6210 ext4 \u6216\u6f0f\u6807 ESP GUID\uff0cUEFI \u56fa\u4ef6\u5c06\u65e0\u6cd5\u8bc6\u522b\u542f\u52a8\u5206\u533a\u3002\"\n    },\n    {\n      num: \"Step 3\", title: \"BOOTAA64.EFI\", sub: \"\/EFI\/BOOT\/ entry\",\n      en: \"<span class='nzb-label'>Role:<\/span> The hardcoded UEFI fallback path (\/EFI\/BOOT\/BOOTAA64.EFI on ARM64, BOOTX64.EFI on x86_64). Can be either systemd-boot\/GRUB or a self-contained UKI.\",\n      enWarn: \"<span class='nzb-warn'>If missing:<\/span> Firmware finds the NVMe drive and ESP, but immediately exits with 'Boot failed'.\",\n      zh: \"<span class='nzb-label'>\u804c\u8d23\uff1a<\/span>UEFI \u5199\u6b7b\u7684\u9ed8\u8ba4\u515c\u5e95\u5165\u53e3\uff08ARM64 \u53eb BOOTAA64.EFI\uff0cx86_64 \u53eb BOOTX64.EFI\uff09\u3002\u91cc\u9762\u65e2\u80fd\u653e systemd-boot \u83dc\u5355\u7a0b\u5e8f\uff0c\u4e5f\u80fd\u653e\u5355\u6587\u4ef6 UKI\u3002<br><span class='nzb-warn'>\u7f3a\u5931\u540e\u679c\uff1a<\/span>\u56fa\u4ef6\u80fd\u8ba4\u51fa\u786c\u76d8\u4f46\u627e\u4e0d\u5230\u5165\u53e3\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u62a5\u9519 Boot failed\u3002\"\n    },\n    {\n      num: \"Step 4\", title: \"Kernel + initramfs\", sub: \"switch_root -> \/\",\n      en: \"<span class='nzb-label'>Role:<\/span> Kernel boots with a tiny memory rootfs (initramfs) that loads NVMe\/crypto drivers, mounts nvme0n1p2 (from cmdline root=...), and calls switch_root to launch PID 1 systemd.\",\n      enWarn: \"<span class='nzb-warn'>If missing:<\/span> Without block drivers or switch_root, the kernel panics ('Unable to mount root fs') or stays stuck in RAM.\",\n      zh: \"<span class='nzb-label'>\u804c\u8d23\uff1a<\/span>\u5185\u6838\u5148\u6302\u8d77 memory \u91cc\u7684\u4e34\u65f6 initramfs \u52a0\u8f7d\u9a71\u52a8\u3001\u628a\u7269\u7406\u6839\u5206\u533a nvme0n1p2 mount \u597d\uff0c\u518d\u6267\u884c switch_root \u5207\u8fdb\u771f\u6b63\u7684 \/ \u5e76\u62c9\u8d77 systemd\u3002<br><span class='nzb-warn'>\u7f3a\u5931\u540e\u679c\uff1a<\/span>\u7f3a\u9a71\u52a8\u6216\u6ca1\u8dd1 switch_root \u4f1a\u5bfc\u81f4 Kernel Panic \u6216\u4e00\u76f4\u5361\u5728\u5185\u5b58\u76d8\u91cc\u3002\"\n    },\n    {\n      num: \"Step 5\", title: \"\/etc\/fstab\", sub: \"systemd mounts rest\",\n      en: \"<span class='nzb-label'>Role:<\/span> When systemd starts, ONLY \/ is mounted! systemd-fstab-generator reads \/etc\/fstab to fsck and mount \/data (p3) and \/boot\/efi (p1).\",\n      enWarn: \"<span class='nzb-warn'>If missing:<\/span> \/data stays an ordinary folder on the small root partition, leaving your 200 GB data partition completely unused!\",\n      zh: \"<span class='nzb-label'>\u804c\u8d23\uff1a<\/span>\u521a\u8fdb systemd \u65f6\u53ea\u6709 \/ \u4e00\u4e2a\u5206\u533a\u6302\u597d\u4e86\uff01systemd \u9760\u8bfb \/etc\/fstab \u81ea\u52a8\u628a \/data \u548c \/boot\/efi \u7b49\u5269\u4f59\u5206\u533a\u5168\u90e8 mount \u5230\u4f4d\u3002<br><span class='nzb-warn'>\u7f3a\u5931\u540e\u679c\uff1a<\/span>\/data \u9000\u5316\u6210\u6839\u5206\u533a\u91cc\u7684\u666e\u901a\u6587\u4ef6\u5939\uff0c\u6570\u636e\u76d8\u95f2\u7f6e\u4e14\u6839\u76d8\u6781\u6613\u88ab\u65e5\u5fd7\u5199\u6ee1\u3002\"\n    }\n  ];\n  window.nzSwitchBootTab = function(tab) {\n    document.getElementById(\"nzb-panel-relay\").style.display = tab === \"relay\" ? \"block\" : \"none\";\n    document.getElementById(\"nzb-panel-efi\").style.display = tab === \"efi\" ? \"block\" : \"none\";\n    document.getElementById(\"nzb-tab-relay\").className = \"nzb-tab-btn\" + (tab === \"relay\" ? \" active\" : \"\");\n    document.getElementById(\"nzb-tab-efi\").className = \"nzb-tab-btn\" + (tab === \"efi\" ? \" active\" : \"\");\n  };\n  window.nzSelectBootStep = function(idx) {\n    var wrap = document.getElementById(\"nzb-step-btns\");\n    wrap.innerHTML = \"\";\n    for (var i = 0; i < steps.length; i++) {\n      var btn = document.createElement(\"button\");\n      btn.type = \"button\";\n      btn.className = \"nzb-step\" + (i === idx ? \" active\" : \"\");\n      btn.setAttribute(\"onclick\", \"window.nzSelectBootStep(\" + i + \")\");\n      btn.innerHTML = '<div class=\"nzb-s-num\">' + steps[i].num + '<\/div><div class=\"nzb-s-title\">' + steps[i].title + '<\/div><div class=\"nzb-s-sub\">' + steps[i].sub + '<\/div>';\n      wrap.appendChild(btn);\n    }\n    var st = steps[idx];\n    document.getElementById(\"nzb-relay-detail\").innerHTML = '<div style=\"font-weight:700;font-size:14px;margin-bottom:6px;\">' + st.num + ' \u00b7 ' + st.title + ' <span style=\"font-weight:400;color:#64748b;\">(' + st.sub + ')<\/span><\/div><div class=\"nzb-row\">' + st.en + '<\/div><div class=\"nzb-row\">' + st.enWarn + '<\/div><div class=\"nzb-row-zh\">' + st.zh + '<\/div>';\n  };\n  window.nzSelectBootStep(0);\n})();\n<\/script>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3.1 Firmware, ESP (\/boot\/efi), and BOOTAA64.EFI<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Motherboard firmware in SPI Flash (<code>U-Boot<\/code> on many ARM64 platforms, or <code>EDK2<\/code> UEFI on x86\/ARM servers) stays fixed while Linux kernel filenames (<code>vmlinuz-6.12...<\/code>) change constantly inside <code>ext4<\/code>. Under the UEFI standard, firmware simply finds the <code>vfat<\/code> <strong><code>ESP<\/code><\/strong> <code>partition<\/code> in <code>GPT<\/code> and executes the architecture&#8217;s default fallback path: <strong><code>\/EFI\/BOOT\/BOOTAA64.EFI<\/code><\/strong> on 64-bit ARM (<code>AArch64<\/code>) or <strong><code>\/EFI\/BOOT\/BOOTX64.EFI<\/code><\/strong> on <code>x86_64<\/code>. Because Linux later <code>mount<\/code>s that <code>ESP<\/code> <code>partition<\/code> at <code>\/boot\/efi<\/code>, the same file appears at <code>\/boot\/efi\/EFI\/BOOT\/BOOTAA64.EFI<\/code> inside Linux.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3b\u677f SPI Flash \u91cc\u7684\u56fa\u4ef6\uff08ARM64 \u5e38\u89c1\u4e3a <code>U-Boot<\/code>\uff0cx86\/\u901a\u7528\u670d\u52a1\u5668\u5e38\u89c1\u4e3a <code>EDK2<\/code> UEFI\uff09\u662f\u56fa\u5316\u5c11\u53d8\u7684\uff0c\u800c <code>ext4<\/code> \u91cc\u7684\u5185\u6838\u6587\u4ef6\u540d\u6bcf\u6b21\u5347\u7ea7\u90fd\u5728\u53d8\u3002\u56e0\u6b64 UEFI \u6807\u51c6\u89c4\u5b9a\uff1a\u56fa\u4ef6\u5728\u7a7a\u767d\u65b0\u76d8\u4e0a\u53ea\u9700\u627e\u5230 <code>GPT<\/code> \u91cc\u6253\u6807\u4e3a <strong><code>ESP<\/code><\/strong> \u7684 <code>vfat<\/code> \u5206\u533a\uff0c\u76f4\u63a5\u52a0\u8f7d\u5199\u6b7b\u7684\u9ed8\u8ba4\u5165\u53e3\u8def\u5f84\u2014\u2014ARM64 \u53eb <strong><code>\/EFI\/BOOT\/BOOTAA64.EFI<\/code><\/strong>\uff08<code>AA64<\/code> = <code>AArch64<\/code>\uff09\uff0cx86_64 \u53eb <strong><code>\/EFI\/BOOT\/BOOTX64.EFI<\/code><\/strong>\u3002\u7b49\u8fdb\u5165 Linux \u540e\uff0c\u56e0\u4e3a\u4e60\u60ef\u628a <code>ESP<\/code> <code>mount<\/code> \u5728 <code>\/boot\/efi<\/code> \u76ee\u5f55\uff0c\u5b83\u5728\u7cfb\u7edf\u91cc\u7684\u5b8c\u6574\u8def\u5f84\u5c31\u6210\u4e86 <code>\/boot\/efi\/EFI\/BOOT\/BOOTAA64.EFI<\/code>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.2 Menu Bootloader (systemd-boot) vs. Unified Kernel Image (UKI)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Any valid UEFI PE\/COFF executable can sit at <code>BOOTAA64.EFI<\/code>. In <strong>Pattern A (Menu Loader)<\/strong>, <code>BOOTAA64.EFI<\/code> is a tiny ~100 KB manager like <code>systemd-bootaa64.efi<\/code> that parses <code>\/loader\/entries\/*.conf<\/code> and loads separate <code>vmlinuz<\/code> and <code>initrd<\/code> files\u2014flexible for local kernel upgrades and rollbacks. In <strong>Pattern B (<code>UKI<\/code>)<\/strong>, tools like <code>ukify<\/code> or <code>objcopy<\/code> glue a UEFI stub (<code>linuxaa64.efi.stub<\/code>), <code>.cmdline<\/code>, <code>.linux<\/code> (<code>vmlinuz<\/code>), and <code>.initrd<\/code> into a single self-contained ~50 MB <code>.EFI<\/code> binary\u2014ideal for single-file HTTP <code>netboot<\/code> and atomic Secure Boot cryptographic signing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>BOOTAA64.EFI<\/code> \u6709\u4e24\u79cd\u4e3b\u6d41\u5f62\u6001\uff1a<strong>\u5f62\u6001 A\uff08\u83dc\u5355\u52a0\u8f7d\u5668\uff0c\u5982 <code>systemd-boot<\/code>\uff09<\/strong>\u653e\u7684\u662f\u7ea6 100 KB \u7684\u5c0f\u5f15\u5bfc\u5668\uff0c\u8bfb\u53d6 <code>\/loader\/entries\/*.conf<\/code> \u6587\u672c\u83dc\u5355\u518d\u53bb\u52a0\u8f7d\u72ec\u7acb\u7684 <code>vmlinuz<\/code> \u548c <code>initrd<\/code>\uff0c\u672c\u5730\u5347\u7ea7\u5185\u6838\u4e0e\u56de\u6eda\u975e\u5e38\u7075\u6d3b\uff1b<strong>\u5f62\u6001 B\uff08\u5355\u6587\u4ef6 <code>UKI<\/code>\uff09<\/strong>\u7528 <code>ukify<\/code> \u6216 <code>objcopy<\/code> \u628a\u5f15\u5bfc\u58f3 <code>linuxaa64.efi.stub<\/code>\u3001<code>.cmdline<\/code>\u3001<code>vmlinuz<\/code> \u548c <code>initrd<\/code> \u5c01\u8fdb\u540c\u4e00\u4e2a ~50 MB \u7684 <code>.EFI<\/code> \u5927\u6587\u4ef6\u91cc\uff0c\u96f6\u5916\u90e8\u914d\u7f6e\u4f9d\u8d56\uff0c\u5929\u7136\u9002\u5408\u5355\u6587\u4ef6 HTTP <code>netboot<\/code> \u4e0b\u8f7d\u5373\u542f\u52a8\u4ee5\u53ca\u6574\u5305\u5b89\u5168\u7b7e\u540d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.3 Kernel + initramfs (switch_root) \u2192 systemd + \/etc\/fstab<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the kernel starts, a small <code>memory<\/code> archive called <strong><code>initramfs<\/code><\/strong> loads block\/encryption drivers, <code>mount<\/code>s the physical root <code>partition<\/code> specified by <code>root=...<\/code> on the kernel command line, and runs <strong><code>switch_root<\/code><\/strong> to hand PID 1 over to <strong><code>systemd<\/code><\/strong>. At that moment, <em>only <code>\/<\/code> is mounted<\/em>! Early in initialization, <code>systemd-fstab-generator<\/code> parses <strong><code>\/etc\/fstab<\/code><\/strong> to automatically <code>fsck<\/code> and <code>mount<\/code> <code>\/data<\/code>, <code>\/boot\/efi<\/code>, and all remaining partitions before launching user-space services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5185\u6838\u542f\u52a8\u540e\uff0c\u5148\u7531\u9a7b\u7559\u5728 <code>memory<\/code> \u91cc\u7684\u5fae\u578b <strong><code>initramfs<\/code><\/strong> \u52a0\u8f7d\u5b58\u50a8\u6216\u89e3\u5bc6\u9a71\u52a8\uff0c\u6309 <code>cmdline<\/code> \u91cc\u7684 <code>root=...<\/code> \u628a\u7269\u7406\u6839\u5206\u533a <code>mount<\/code> \u597d\uff0c\u518d\u901a\u8fc7 <strong><code>switch_root<\/code><\/strong> \u6276\u6b63\u4e3a\u771f\u6b63\u7684 <code>\/<\/code> \u5e76\u62c9\u8d77 1 \u53f7\u8fdb\u7a0b <strong><code>systemd<\/code><\/strong>\u3002\u6ce8\u610f\u6b64\u65f6\u6574\u53f0\u673a\u5668<em>\u53ea\u6709 <code>\/<\/code> \u8fd9\u4e00\u4e2a\u5206\u533a\u6302\u597d\u4e86<\/em>\uff01\u968f\u540e <code>systemd<\/code> \u901a\u8fc7 <code>systemd-fstab-generator<\/code> \u8bfb\u53d6 <strong><code>\/etc\/fstab<\/code><\/strong> \u6e05\u5355\uff0c\u81ea\u52a8\u628a <code>\/data<\/code> \u548c <code>\/boot\/efi<\/code> \u7b49\u5176\u4f59 <code>partition<\/code> \u4f9d\u6b21 <code>mount<\/code> \u5230\u4f4d\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4. 30-Second Diagnostic Cheat Sheet (\u5b9e\u6218\u901f\u67e5\u547d\u4ee4)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run these five read-only commands on any unfamiliar Linux machine to map out its entire storage and boot chain in 30 seconds:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4efb\u4f55\u964c\u751f\u7684 Linux \u673a\u5668\u4e0a\u6572\u5b8c\u4e0b\u9762 5 \u6761\u53ea\u8bfb\u547d\u4ee4\uff0c30 \u79d2\u5c31\u80fd\u6478\u6e05\u5b83\u7684\u5b8c\u6574\u5b58\u50a8\u4e0e\u542f\u52a8\u62d3\u6251\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. Block devices -&gt; partitions -&gt; filesystem types -&gt; UUIDs -&gt; mount points\n# 1. \u4e00\u773c\u770b\u6e05\uff1a\u88f8\u76d8 -&gt; partition -&gt; filesystem type -&gt; UUID -&gt; mount point\nlsblk -f\n\n# 2. Raw GPT partition table (LBA boundaries, sizes, Partition Type GUIDs)\n# 2. \u67e5\u770b\u88f8\u76d8 GPT \u5206\u533a\u8868\uff08\u8d77\u6b62\u6247\u533a\u3001\u5927\u5c0f\u3001\u7528\u9014 GUID \u6807\u7b7e\uff09\nsudo sgdisk -p \/dev\/nvme0n1\n\n# 3. Active physical mounts and mount options (filtering out virtual fs noise)\n# 3. \u67e5\u770b\u5f53\u524d\u751f\u6548\u7684\u6240\u6709\u771f\u5b9e\u7269\u7406 mount \u5173\u7cfb\u4e0e\u53c2\u6570\nfindmnt --real\n\n# 4. Kernel boot arguments passed by UEFI \/ systemd-boot \/ UKI\n# 4. \u67e5\u770b\u4e0a\u4e00\u68d2\uff08\u56fa\u4ef6 \/ systemd-boot \/ UKI\uff09\u4f20\u7ed9\u5185\u6838\u7684\u542f\u52a8\u53c2\u6570\ncat \/proc\/cmdline\n\n# 5. Persistent boot-time mount table\n# 5. \u67e5\u770b\u5f00\u673a\u81ea\u52a8 mount \u6e05\u5355\uff0c\u6838\u5bf9\u662f\u5426\u4e0e findmnt \u4e00\u81f4\ncat \/etc\/fstab<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When writing user-space application code, we take directories like \/etc, \/var\/log, and \/home for granted. Rarely do we pause to ask which physical chip stores those bytes, how a partition gets grafted onto the directory tree, or how power-on firmware locates the Linux kernel in the first place. Yet the moment you work on automated&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"0","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76,16,22],"tags":[],"class_list":["post-1828","post","type-post","status-publish","format-standard","hentry","category-embedded","category-linux","category-operation-systems"],"_links":{"self":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts\/1828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/comments?post=1828"}],"version-history":[{"count":1,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts\/1828\/revisions"}],"predecessor-version":[{"id":1829,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/posts\/1828\/revisions\/1829"}],"wp:attachment":[{"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/media?parent=1828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/categories?post=1828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nanzhou.cc\/index.php\/wp-json\/wp\/v2\/tags?post=1828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}