[{"data":1,"prerenderedAt":2106},["ShallowReactive",2],{"page-\u002Flinux\u002F03-filesystem-hierarchy":3},{"id":4,"title":5,"body":6,"description":2099,"extension":2100,"meta":2101,"navigation":572,"path":2102,"seo":2103,"stem":2104,"__hash__":2105},"content\u002Flinux\u002F03-filesystem-hierarchy.md","03 — Filesystem Hierarchy",{"type":7,"value":8,"toc":2078},"minimark",[9,13,35,40,383,390,399,615,627,697,701,708,833,876,880,1023,1027,1169,1179,1183,1190,1332,1339,1438,1476,1518,1522,1572,1576,1693,1751,1755,1856,1860,1954,1958,1969,2074],[10,11,5],"h1",{"id":12},"_03-filesystem-hierarchy",[14,15,16,17,21,22,25,26,29,30,34],"p",{},"Linux organizes every file under a single root directory, ",[18,19,20],"code",{},"\u002F",". There are no drive letters (",[18,23,24],{},"C:",", ",[18,27,28],{},"D:",") — additional disks are ",[31,32,33],"strong",{},"mounted"," into the tree at directories (mount points). This chapter covers the standard layout, virtual filesystems, inodes, and mount mechanics — through production patterns and edge-case behavior.",[36,37,39],"h2",{"id":38},"the-root-directory","The Root Directory",[41,42,44],"code-wrapper",{"language":43},"bash",[45,46,50],"pre",{"className":47,"code":48,"language":43,"meta":49,"style":49},"language-bash shiki shiki-themes github-light github-dark","\u002F\n├── bin\u002F      → \u002Fusr\u002Fbin    (user binaries)\n├── sbin\u002F     → \u002Fusr\u002Fsbin   (system binaries)\n├── lib\u002F      → \u002Fusr\u002Flib    (shared libraries)\n├── usr\u002F                    (most user-facing software lives here)\n│   ├── bin\u002F\n│   ├── sbin\u002F\n│   ├── lib\u002F\n│   ├── local\u002F             (locally compiled software)\n│   └── share\u002F             (architecture-independent data, man pages)\n├── etc\u002F                   (system configuration — text files)\n├── home\u002F                  (user home directories)\n│   └── alice\u002F\n├── root\u002F                  (root user's home — NOT under \u002Fhome)\n├── var\u002F                   (variable data: logs, mail, caches, spool)\n│   ├── log\u002F\n│   ├── lib\u002F\n│   ├── cache\u002F\n│   └── spool\u002F\n├── tmp\u002F                   (temporary files — cleared on reboot)\n├── proc\u002F                  (virtual: kernel & process info)\n├── sys\u002F                   (virtual: hardware & kernel info)\n├── dev\u002F                   (device files)\n├── boot\u002F                  (kernel, initramfs, bootloader)\n├── opt\u002F                   (optional, third-party software)\n├── mnt\u002F                   (temporary mount points)\n├── media\u002F                 (removable media — USB, CD)\n└── run\u002F                   (runtime data: PID files, sockets)\n","",[18,51,52,61,87,108,129,154,166,176,186,206,231,256,275,285,299,305,311,317,323,329,335,341,347,353,359,365,371,377],{"__ignoreMap":49},[53,54,57],"span",{"class":55,"line":56},"line",1,[53,58,60],{"class":59},"sIsaT","\u002F\n",[53,62,64,67,71,74,77,81,84],{"class":55,"line":63},2,[53,65,66],{"class":59},"├──",[53,68,70],{"class":69},"sJ6F3"," bin\u002F",[53,72,73],{"class":69},"      →",[53,75,76],{"class":69}," \u002Fusr\u002Fbin",[53,78,80],{"class":79},"ssxIu","    (user ",[53,82,83],{"class":69},"binaries",[53,85,86],{"class":79},")\n",[53,88,90,92,95,98,101,104,106],{"class":55,"line":89},3,[53,91,66],{"class":59},[53,93,94],{"class":69}," sbin\u002F",[53,96,97],{"class":69},"     →",[53,99,100],{"class":69}," \u002Fusr\u002Fsbin",[53,102,103],{"class":79},"   (system ",[53,105,83],{"class":69},[53,107,86],{"class":79},[53,109,111,113,116,118,121,124,127],{"class":55,"line":110},4,[53,112,66],{"class":59},[53,114,115],{"class":69}," lib\u002F",[53,117,73],{"class":69},[53,119,120],{"class":69}," \u002Fusr\u002Flib",[53,122,123],{"class":79},"    (shared ",[53,125,126],{"class":69},"libraries",[53,128,86],{"class":79},[53,130,132,134,137,140,143,146,149,152],{"class":55,"line":131},5,[53,133,66],{"class":59},[53,135,136],{"class":69}," usr\u002F",[53,138,139],{"class":79},"                    (most ",[53,141,142],{"class":69},"user-facing",[53,144,145],{"class":69}," software",[53,147,148],{"class":69}," lives",[53,150,151],{"class":69}," here",[53,153,86],{"class":79},[53,155,157,160,163],{"class":55,"line":156},6,[53,158,159],{"class":59},"│",[53,161,162],{"class":69},"   ├──",[53,164,165],{"class":69}," bin\u002F\n",[53,167,169,171,173],{"class":55,"line":168},7,[53,170,159],{"class":59},[53,172,162],{"class":69},[53,174,175],{"class":69}," sbin\u002F\n",[53,177,179,181,183],{"class":55,"line":178},8,[53,180,159],{"class":59},[53,182,162],{"class":69},[53,184,185],{"class":69}," lib\u002F\n",[53,187,189,191,193,196,199,202,204],{"class":55,"line":188},9,[53,190,159],{"class":59},[53,192,162],{"class":69},[53,194,195],{"class":69}," local\u002F",[53,197,198],{"class":79},"             (locally ",[53,200,201],{"class":69},"compiled",[53,203,145],{"class":69},[53,205,86],{"class":79},[53,207,209,211,214,217,220,223,226,229],{"class":55,"line":208},10,[53,210,159],{"class":59},[53,212,213],{"class":69},"   └──",[53,215,216],{"class":69}," share\u002F",[53,218,219],{"class":79},"             (architecture-independent ",[53,221,222],{"class":69},"data,",[53,224,225],{"class":69}," man",[53,227,228],{"class":69}," pages",[53,230,86],{"class":79},[53,232,234,236,239,242,245,248,251,254],{"class":55,"line":233},11,[53,235,66],{"class":59},[53,237,238],{"class":69}," etc\u002F",[53,240,241],{"class":79},"                   (system ",[53,243,244],{"class":69},"configuration",[53,246,247],{"class":69}," —",[53,249,250],{"class":69}," text",[53,252,253],{"class":69}," files",[53,255,86],{"class":79},[53,257,259,261,264,267,270,273],{"class":55,"line":258},12,[53,260,66],{"class":59},[53,262,263],{"class":69}," home\u002F",[53,265,266],{"class":79},"                  (user ",[53,268,269],{"class":69},"home",[53,271,272],{"class":69}," directories",[53,274,86],{"class":79},[53,276,278,280,282],{"class":55,"line":277},13,[53,279,159],{"class":59},[53,281,213],{"class":69},[53,283,284],{"class":69}," alice\u002F\n",[53,286,288,290,293,296],{"class":55,"line":287},14,[53,289,66],{"class":59},[53,291,292],{"class":69}," root\u002F",[53,294,295],{"class":79},"                  (root ",[53,297,298],{"class":69},"user's home — NOT under \u002Fhome)\n",[53,300,302],{"class":55,"line":301},15,[53,303,304],{"class":69},"├── var\u002F                   (variable data: logs, mail, caches, spool)\n",[53,306,308],{"class":55,"line":307},16,[53,309,310],{"class":69},"│   ├── log\u002F\n",[53,312,314],{"class":55,"line":313},17,[53,315,316],{"class":69},"│   ├── lib\u002F\n",[53,318,320],{"class":55,"line":319},18,[53,321,322],{"class":69},"│   ├── cache\u002F\n",[53,324,326],{"class":55,"line":325},19,[53,327,328],{"class":69},"│   └── spool\u002F\n",[53,330,332],{"class":55,"line":331},20,[53,333,334],{"class":69},"├── tmp\u002F                   (temporary files — cleared on reboot)\n",[53,336,338],{"class":55,"line":337},21,[53,339,340],{"class":69},"├── proc\u002F                  (virtual: kernel & process info)\n",[53,342,344],{"class":55,"line":343},22,[53,345,346],{"class":69},"├── sys\u002F                   (virtual: hardware & kernel info)\n",[53,348,350],{"class":55,"line":349},23,[53,351,352],{"class":69},"├── dev\u002F                   (device files)\n",[53,354,356],{"class":55,"line":355},24,[53,357,358],{"class":69},"├── boot\u002F                  (kernel, initramfs, bootloader)\n",[53,360,362],{"class":55,"line":361},25,[53,363,364],{"class":69},"├── opt\u002F                   (optional, third-party software)\n",[53,366,368],{"class":55,"line":367},26,[53,369,370],{"class":69},"├── mnt\u002F                   (temporary mount points)\n",[53,372,374],{"class":55,"line":373},27,[53,375,376],{"class":69},"├── media\u002F                 (removable media — USB, CD)\n",[53,378,380],{"class":55,"line":379},28,[53,381,382],{"class":69},"└── run\u002F                   (runtime data: PID files, sockets)\n",[36,384,386,389],{"id":385},"proc-process-kernel-info-virtual",[18,387,388],{},"\u002Fproc"," — Process & Kernel Info (Virtual)",[14,391,392,394,395,398],{},[18,393,388],{}," is a ",[31,396,397],{},"virtual filesystem"," — the files don't exist on disk; the kernel generates their content on the fly when you read them.",[41,400,401],{"language":43},[45,402,404],{"className":47,"code":403,"language":43,"meta":49,"style":49},"# Complex Implementation: read per-process state from \u002Fproc\u002F\u003Cpid>\u002F\n# — no ps\u002Ftop needed; the kernel exposes everything as files\npid=1\ncat \u002Fproc\u002F$pid\u002Fcomm                    # process name (e.g., \"systemd\")\ncat \u002Fproc\u002F$pid\u002Fcmdline | tr '\\0' ' '   # args (null-separated → space)\nls -l \u002Fproc\u002F$pid\u002Fcwd                   # symlink to working directory\nls -l \u002Fproc\u002F$pid\u002Fexe                   # symlink to the executable\nls -l \u002Fproc\u002F$pid\u002Ffd\u002F                   # open file descriptors (symlinks)\ncat \u002Fproc\u002F$pid\u002Fenviron | tr '\\0' '\\n'  # environment (null-separated → newline)\ncat \u002Fproc\u002F$pid\u002Fstatus | head -15       # human-readable status (UID, memory, state)\n\n# Kernel tunables — read AND write (writing changes live kernel state):\ncat \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward      # 0 or 1\necho 1 | sudo tee \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward  # enable IP forwarding NOW\n# (prefer: sudo sysctl -w net.ipv4.ip_forward=1)\n",[18,405,406,412,417,429,446,472,491,507,523,546,568,574,579,589,610],{"__ignoreMap":49},[53,407,408],{"class":55,"line":56},[53,409,411],{"class":410},"sdCPZ","# Complex Implementation: read per-process state from \u002Fproc\u002F\u003Cpid>\u002F\n",[53,413,414],{"class":55,"line":63},[53,415,416],{"class":410},"# — no ps\u002Ftop needed; the kernel exposes everything as files\n",[53,418,419,422,426],{"class":55,"line":89},[53,420,421],{"class":79},"pid",[53,423,425],{"class":424},"svdQ7","=",[53,427,428],{"class":69},"1\n",[53,430,431,434,437,440,443],{"class":55,"line":110},[53,432,433],{"class":59},"cat",[53,435,436],{"class":69}," \u002Fproc\u002F",[53,438,439],{"class":79},"$pid",[53,441,442],{"class":69},"\u002Fcomm",[53,444,445],{"class":410},"                    # process name (e.g., \"systemd\")\n",[53,447,448,450,452,454,457,460,463,466,469],{"class":55,"line":131},[53,449,433],{"class":59},[53,451,436],{"class":69},[53,453,439],{"class":79},[53,455,456],{"class":69},"\u002Fcmdline",[53,458,459],{"class":424}," |",[53,461,462],{"class":59}," tr",[53,464,465],{"class":69}," '\\0'",[53,467,468],{"class":69}," ' '",[53,470,471],{"class":410},"   # args (null-separated → space)\n",[53,473,474,477,481,483,485,488],{"class":55,"line":156},[53,475,476],{"class":59},"ls",[53,478,480],{"class":479},"snvgF"," -l",[53,482,436],{"class":69},[53,484,439],{"class":79},[53,486,487],{"class":69},"\u002Fcwd",[53,489,490],{"class":410},"                   # symlink to working directory\n",[53,492,493,495,497,499,501,504],{"class":55,"line":168},[53,494,476],{"class":59},[53,496,480],{"class":479},[53,498,436],{"class":69},[53,500,439],{"class":79},[53,502,503],{"class":69},"\u002Fexe",[53,505,506],{"class":410},"                   # symlink to the executable\n",[53,508,509,511,513,515,517,520],{"class":55,"line":178},[53,510,476],{"class":59},[53,512,480],{"class":479},[53,514,436],{"class":69},[53,516,439],{"class":79},[53,518,519],{"class":69},"\u002Ffd\u002F",[53,521,522],{"class":410},"                   # open file descriptors (symlinks)\n",[53,524,525,527,529,531,534,536,538,540,543],{"class":55,"line":188},[53,526,433],{"class":59},[53,528,436],{"class":69},[53,530,439],{"class":79},[53,532,533],{"class":69},"\u002Fenviron",[53,535,459],{"class":424},[53,537,462],{"class":59},[53,539,465],{"class":69},[53,541,542],{"class":69}," '\\n'",[53,544,545],{"class":410},"  # environment (null-separated → newline)\n",[53,547,548,550,552,554,557,559,562,565],{"class":55,"line":208},[53,549,433],{"class":59},[53,551,436],{"class":69},[53,553,439],{"class":79},[53,555,556],{"class":69},"\u002Fstatus",[53,558,459],{"class":424},[53,560,561],{"class":59}," head",[53,563,564],{"class":479}," -15",[53,566,567],{"class":410},"       # human-readable status (UID, memory, state)\n",[53,569,570],{"class":55,"line":233},[53,571,573],{"emptyLinePlaceholder":572},true,"\n",[53,575,576],{"class":55,"line":258},[53,577,578],{"class":410},"# Kernel tunables — read AND write (writing changes live kernel state):\n",[53,580,581,583,586],{"class":55,"line":277},[53,582,433],{"class":59},[53,584,585],{"class":69}," \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward",[53,587,588],{"class":410},"      # 0 or 1\n",[53,590,591,594,597,599,602,605,607],{"class":55,"line":287},[53,592,593],{"class":479},"echo",[53,595,596],{"class":479}," 1",[53,598,459],{"class":424},[53,600,601],{"class":59}," sudo",[53,603,604],{"class":69}," tee",[53,606,585],{"class":69},[53,608,609],{"class":410},"  # enable IP forwarding NOW\n",[53,611,612],{"class":55,"line":301},[53,613,614],{"class":410},"# (prefer: sudo sysctl -w net.ipv4.ip_forward=1)\n",[616,617,619,620,622,623,626],"h3",{"id":618},"edge-case-proc-and-sys-are-ram-only","Edge Case: ",[18,621,388],{}," and ",[18,624,625],{},"\u002Fsys"," Are RAM-Only",[41,628,629],{"language":43},[45,630,632],{"className":47,"code":631,"language":43,"meta":49,"style":49},"# NAIVE: try to measure \u002Fproc size (it's all virtual, in-kernel)\ndu -sh \u002Fproc                          # reports 0 or errors\n# Anti-Pattern: backing up \u002Fproc, \u002Fsys, \u002Fdev — they're generated at read time\n# sudo tar -czf backup.tar.gz \u002F                     → includes garbage\n# PRODUCTION: always exclude virtual filesystems\nsudo tar -czf backup.tar.gz --exclude=\u002Fproc --exclude=\u002Fsys --exclude=\u002Fdev --exclude=\u002Frun \u002F\n",[18,633,634,639,653,658,663,668],{"__ignoreMap":49},[53,635,636],{"class":55,"line":56},[53,637,638],{"class":410},"# NAIVE: try to measure \u002Fproc size (it's all virtual, in-kernel)\n",[53,640,641,644,647,650],{"class":55,"line":63},[53,642,643],{"class":59},"du",[53,645,646],{"class":479}," -sh",[53,648,649],{"class":69}," \u002Fproc",[53,651,652],{"class":410},"                          # reports 0 or errors\n",[53,654,655],{"class":55,"line":89},[53,656,657],{"class":410},"# Anti-Pattern: backing up \u002Fproc, \u002Fsys, \u002Fdev — they're generated at read time\n",[53,659,660],{"class":55,"line":110},[53,661,662],{"class":410},"# sudo tar -czf backup.tar.gz \u002F                     → includes garbage\n",[53,664,665],{"class":55,"line":131},[53,666,667],{"class":410},"# PRODUCTION: always exclude virtual filesystems\n",[53,669,670,673,676,679,682,685,688,691,694],{"class":55,"line":156},[53,671,672],{"class":59},"sudo",[53,674,675],{"class":69}," tar",[53,677,678],{"class":479}," -czf",[53,680,681],{"class":69}," backup.tar.gz",[53,683,684],{"class":479}," --exclude=\u002Fproc",[53,686,687],{"class":479}," --exclude=\u002Fsys",[53,689,690],{"class":479}," --exclude=\u002Fdev",[53,692,693],{"class":479}," --exclude=\u002Frun",[53,695,696],{"class":69}," \u002F\n",[36,698,700],{"id":699},"inodes-how-files-actually-work","Inodes — How Files Actually Work",[14,702,703,704,707],{},"A filesystem stores files as ",[31,705,706],{},"inodes"," (index nodes), not names. An inode holds the file's metadata and data block pointers; the directory just maps names to inode numbers.",[41,709,710],{"language":43},[45,711,713],{"className":47,"code":712,"language":43,"meta":49,"style":49},"Directory entry:        Inode (stored in the filesystem):\n  \"passwd\" → inode 123     inode 123:\n                              type: regular file\n                              size: 3218\n                              mode: 0644\n                              owner UID: 0\n                              mtime: 2026-06-15\n                              data blocks: [block 42, block 87, ...]\n",[18,714,715,741,761,775,783,791,802,810],{"__ignoreMap":49},[53,716,717,720,723,726,729,732,735,738],{"class":55,"line":56},[53,718,719],{"class":59},"Directory",[53,721,722],{"class":69}," entry:",[53,724,725],{"class":69},"        Inode",[53,727,728],{"class":79}," (stored ",[53,730,731],{"class":69},"in",[53,733,734],{"class":69}," the",[53,736,737],{"class":69}," filesystem",[53,739,740],{"class":79},"):\n",[53,742,743,746,749,752,755,758],{"class":55,"line":63},[53,744,745],{"class":59},"  \"passwd\"",[53,747,748],{"class":69}," →",[53,750,751],{"class":69}," inode",[53,753,754],{"class":479}," 123",[53,756,757],{"class":69},"     inode",[53,759,760],{"class":69}," 123:\n",[53,762,763,766,769,772],{"class":55,"line":89},[53,764,765],{"class":479},"                              type",[53,767,768],{"class":69},":",[53,770,771],{"class":69}," regular",[53,773,774],{"class":69}," file\n",[53,776,777,780],{"class":55,"line":110},[53,778,779],{"class":59},"                              size:",[53,781,782],{"class":479}," 3218\n",[53,784,785,788],{"class":55,"line":131},[53,786,787],{"class":59},"                              mode:",[53,789,790],{"class":479}," 0644\n",[53,792,793,796,799],{"class":55,"line":156},[53,794,795],{"class":59},"                              owner",[53,797,798],{"class":69}," UID:",[53,800,801],{"class":479}," 0\n",[53,803,804,807],{"class":55,"line":168},[53,805,806],{"class":59},"                              mtime:",[53,808,809],{"class":69}," 2026-06-15\n",[53,811,812,815,818,821,824,827,830],{"class":55,"line":178},[53,813,814],{"class":59},"                              data",[53,816,817],{"class":69}," blocks:",[53,819,820],{"class":79}," [block ",[53,822,823],{"class":69},"42,",[53,825,826],{"class":69}," block",[53,828,829],{"class":69}," 87,",[53,831,832],{"class":69}," ...]\n",[41,834,835],{"language":43},[45,836,838],{"className":47,"code":837,"language":43,"meta":49,"style":49},"ls -i \u002Fetc\u002Fpasswd         # show inode number (e.g., 12345)\nstat \u002Fetc\u002Fpasswd          # full inode info\ndf -i \u002F                   # inode usage per filesystem (you can run out!)\n",[18,839,840,853,863],{"__ignoreMap":49},[53,841,842,844,847,850],{"class":55,"line":56},[53,843,476],{"class":59},[53,845,846],{"class":479}," -i",[53,848,849],{"class":69}," \u002Fetc\u002Fpasswd",[53,851,852],{"class":410},"         # show inode number (e.g., 12345)\n",[53,854,855,858,860],{"class":55,"line":63},[53,856,857],{"class":479},"stat",[53,859,849],{"class":69},[53,861,862],{"class":410},"          # full inode info\n",[53,864,865,868,870,873],{"class":55,"line":89},[53,866,867],{"class":59},"df",[53,869,846],{"class":479},[53,871,872],{"class":69}," \u002F",[53,874,875],{"class":410},"                   # inode usage per filesystem (you can run out!)\n",[616,877,879],{"id":878},"edge-case-inode-exhaustion","Edge Case: Inode Exhaustion",[41,881,882],{"language":43},[45,883,885],{"className":47,"code":884,"language":43,"meta":49,"style":49},"# Complex Implementation: diagnose \"No space left on device\" when df shows free space\ndf -h \u002F                  # space: 40 GB free\ndf -i \u002F                  # inodes: IUse% = 100% (exhausted!)\n\n# Find the directory consuming the most inodes:\nfor d in \u002F*; do echo $(find \"$d\" -xdev 2>\u002Fdev\u002Fnull | wc -l) \"$d\"; done | sort -rn | head\n# Typical culprit: millions of tiny files (cache, mail queue, session files)\n\n# Fix: delete the files, or reformat with more inodes:\n# sudo mkfs.ext4 -i 4096 \u002Fdev\u002Fsdb1   # one inode per 4 KB (default is 16384)\n",[18,886,887,892,904,915,919,924,1004,1009,1013,1018],{"__ignoreMap":49},[53,888,889],{"class":55,"line":56},[53,890,891],{"class":410},"# Complex Implementation: diagnose \"No space left on device\" when df shows free space\n",[53,893,894,896,899,901],{"class":55,"line":63},[53,895,867],{"class":59},[53,897,898],{"class":479}," -h",[53,900,872],{"class":69},[53,902,903],{"class":410},"                  # space: 40 GB free\n",[53,905,906,908,910,912],{"class":55,"line":89},[53,907,867],{"class":59},[53,909,846],{"class":479},[53,911,872],{"class":69},[53,913,914],{"class":410},"                  # inodes: IUse% = 100% (exhausted!)\n",[53,916,917],{"class":55,"line":110},[53,918,573],{"emptyLinePlaceholder":572},[53,920,921],{"class":55,"line":131},[53,922,923],{"class":410},"# Find the directory consuming the most inodes:\n",[53,925,926,929,932,934,937,940,943,946,949,952,955,958,961,964,967,970,972,975,977,980,982,984,986,988,991,993,996,999,1001],{"class":55,"line":156},[53,927,928],{"class":424},"for",[53,930,931],{"class":79}," d ",[53,933,731],{"class":424},[53,935,936],{"class":69}," \u002F*",[53,938,939],{"class":79},"; ",[53,941,942],{"class":424},"do",[53,944,945],{"class":479}," echo",[53,947,948],{"class":79}," $(",[53,950,951],{"class":59},"find",[53,953,954],{"class":69}," \"",[53,956,957],{"class":79},"$d",[53,959,960],{"class":69},"\"",[53,962,963],{"class":479}," -xdev",[53,965,966],{"class":424}," 2>",[53,968,969],{"class":69},"\u002Fdev\u002Fnull",[53,971,459],{"class":424},[53,973,974],{"class":59}," wc",[53,976,480],{"class":479},[53,978,979],{"class":79},") ",[53,981,960],{"class":69},[53,983,957],{"class":79},[53,985,960],{"class":69},[53,987,939],{"class":79},[53,989,990],{"class":424},"done",[53,992,459],{"class":424},[53,994,995],{"class":59}," sort",[53,997,998],{"class":479}," -rn",[53,1000,459],{"class":424},[53,1002,1003],{"class":59}," head\n",[53,1005,1006],{"class":55,"line":168},[53,1007,1008],{"class":410},"# Typical culprit: millions of tiny files (cache, mail queue, session files)\n",[53,1010,1011],{"class":55,"line":178},[53,1012,573],{"emptyLinePlaceholder":572},[53,1014,1015],{"class":55,"line":188},[53,1016,1017],{"class":410},"# Fix: delete the files, or reformat with more inodes:\n",[53,1019,1020],{"class":55,"line":208},[53,1021,1022],{"class":410},"# sudo mkfs.ext4 -i 4096 \u002Fdev\u002Fsdb1   # one inode per 4 KB (default is 16384)\n",[616,1024,1026],{"id":1025},"hard-links-vs-symlinks","Hard Links vs Symlinks",[41,1028,1029],{"language":43},[45,1030,1032],{"className":47,"code":1031,"language":43,"meta":49,"style":49},"# Complex Implementation: demonstrate the inode-level difference\necho \"hello\" > original.txt\nln original.txt hardlink.txt        # hard link (same inode)\nln -s original.txt symlink.txt      # symbolic link (path pointer)\n\nls -li original.txt hardlink.txt symlink.txt\n# 12345 -rw-r--r-- 2 alice alice 6 ... original.txt\n# 12345 -rw-r--r-- 2 alice alice 6 ... hardlink.txt    ← same inode (12345)\n# 67890 lrwxrwxrwx 1 alice alice 12 ... symlink.txt -> original.txt  ← different\n\nrm original.txt\ncat hardlink.txt    # still \"hello\" (inode still has link count 1)\ncat symlink.txt     # error: No such file or directory (dangling symlink)\n\n# Find broken symlinks:\nfind \u002F -xtype l 2>\u002Fdev\u002Fnull\n",[18,1033,1034,1039,1052,1066,1081,1085,1099,1104,1109,1114,1118,1125,1134,1143,1147,1152],{"__ignoreMap":49},[53,1035,1036],{"class":55,"line":56},[53,1037,1038],{"class":410},"# Complex Implementation: demonstrate the inode-level difference\n",[53,1040,1041,1043,1046,1049],{"class":55,"line":63},[53,1042,593],{"class":479},[53,1044,1045],{"class":69}," \"hello\"",[53,1047,1048],{"class":424}," >",[53,1050,1051],{"class":69}," original.txt\n",[53,1053,1054,1057,1060,1063],{"class":55,"line":89},[53,1055,1056],{"class":59},"ln",[53,1058,1059],{"class":69}," original.txt",[53,1061,1062],{"class":69}," hardlink.txt",[53,1064,1065],{"class":410},"        # hard link (same inode)\n",[53,1067,1068,1070,1073,1075,1078],{"class":55,"line":110},[53,1069,1056],{"class":59},[53,1071,1072],{"class":479}," -s",[53,1074,1059],{"class":69},[53,1076,1077],{"class":69}," symlink.txt",[53,1079,1080],{"class":410},"      # symbolic link (path pointer)\n",[53,1082,1083],{"class":55,"line":131},[53,1084,573],{"emptyLinePlaceholder":572},[53,1086,1087,1089,1092,1094,1096],{"class":55,"line":156},[53,1088,476],{"class":59},[53,1090,1091],{"class":479}," -li",[53,1093,1059],{"class":69},[53,1095,1062],{"class":69},[53,1097,1098],{"class":69}," symlink.txt\n",[53,1100,1101],{"class":55,"line":168},[53,1102,1103],{"class":410},"# 12345 -rw-r--r-- 2 alice alice 6 ... original.txt\n",[53,1105,1106],{"class":55,"line":178},[53,1107,1108],{"class":410},"# 12345 -rw-r--r-- 2 alice alice 6 ... hardlink.txt    ← same inode (12345)\n",[53,1110,1111],{"class":55,"line":188},[53,1112,1113],{"class":410},"# 67890 lrwxrwxrwx 1 alice alice 12 ... symlink.txt -> original.txt  ← different\n",[53,1115,1116],{"class":55,"line":208},[53,1117,573],{"emptyLinePlaceholder":572},[53,1119,1120,1123],{"class":55,"line":233},[53,1121,1122],{"class":59},"rm",[53,1124,1051],{"class":69},[53,1126,1127,1129,1131],{"class":55,"line":258},[53,1128,433],{"class":59},[53,1130,1062],{"class":69},[53,1132,1133],{"class":410},"    # still \"hello\" (inode still has link count 1)\n",[53,1135,1136,1138,1140],{"class":55,"line":277},[53,1137,433],{"class":59},[53,1139,1077],{"class":69},[53,1141,1142],{"class":410},"     # error: No such file or directory (dangling symlink)\n",[53,1144,1145],{"class":55,"line":287},[53,1146,573],{"emptyLinePlaceholder":572},[53,1148,1149],{"class":55,"line":301},[53,1150,1151],{"class":410},"# Find broken symlinks:\n",[53,1153,1154,1156,1158,1161,1164,1166],{"class":55,"line":307},[53,1155,951],{"class":59},[53,1157,872],{"class":69},[53,1159,1160],{"class":479}," -xtype",[53,1162,1163],{"class":69}," l",[53,1165,966],{"class":424},[53,1167,1168],{"class":69},"\u002Fdev\u002Fnull\n",[1170,1171,1172,1176],"ul",{},[1173,1174,1175],"li",{},"Hard links: can't cross filesystems, can't link directories (on most filesystems), survive deletion of the \"original\".",[1173,1177,1178],{},"Symlinks: can cross filesystems, can link directories, break if the target is moved\u002Fdeleted.",[36,1180,1182],{"id":1181},"mounts-how-disks-join-the-tree","Mounts — How Disks Join the Tree",[14,1184,1185,1186,1189],{},"A ",[31,1187,1188],{},"mount"," attaches a filesystem's root to a directory in the tree. Before mounting, the directory is just an empty folder; after, its contents are the mounted filesystem's contents.",[41,1191,1192],{"language":43},[45,1193,1195],{"className":47,"code":1194,"language":43,"meta":49,"style":49},"# Complex Implementation: mount with explicit type + options + UUID\nsudo blkid                                    # get UUIDs\nsudo mount -t ext4 -o noatime UUID=abcd-1234 \u002Fmnt\u002Fdata\nsudo umount \u002Fmnt\u002Fdata                          # unmount\n\n# Edge Case: umount fails if filesystem is busy\n# NAIVE: sudo umount \u002Fmnt\u002Fusb   → \"target is busy\"\n# PRODUCTION: find what's using it\nsudo lsof +D \u002Fmnt\u002Fusb                          # processes with open files\nsudo fuser -vm \u002Fmnt\u002Fusb                        # alternative\n# Force kill (dangerous):\nsudo fuser -k \u002Fmnt\u002Fusb\n# Lazy unmount (detaches now, cleans up when busy files close):\nsudo umount -l \u002Fmnt\u002Fusb\n",[18,1196,1197,1202,1212,1237,1250,1254,1259,1264,1269,1285,1300,1305,1317,1322],{"__ignoreMap":49},[53,1198,1199],{"class":55,"line":56},[53,1200,1201],{"class":410},"# Complex Implementation: mount with explicit type + options + UUID\n",[53,1203,1204,1206,1209],{"class":55,"line":63},[53,1205,672],{"class":59},[53,1207,1208],{"class":69}," blkid",[53,1210,1211],{"class":410},"                                    # get UUIDs\n",[53,1213,1214,1216,1219,1222,1225,1228,1231,1234],{"class":55,"line":89},[53,1215,672],{"class":59},[53,1217,1218],{"class":69}," mount",[53,1220,1221],{"class":479}," -t",[53,1223,1224],{"class":69}," ext4",[53,1226,1227],{"class":479}," -o",[53,1229,1230],{"class":69}," noatime",[53,1232,1233],{"class":69}," UUID=abcd-1234",[53,1235,1236],{"class":69}," \u002Fmnt\u002Fdata\n",[53,1238,1239,1241,1244,1247],{"class":55,"line":110},[53,1240,672],{"class":59},[53,1242,1243],{"class":69}," umount",[53,1245,1246],{"class":69}," \u002Fmnt\u002Fdata",[53,1248,1249],{"class":410},"                          # unmount\n",[53,1251,1252],{"class":55,"line":131},[53,1253,573],{"emptyLinePlaceholder":572},[53,1255,1256],{"class":55,"line":156},[53,1257,1258],{"class":410},"# Edge Case: umount fails if filesystem is busy\n",[53,1260,1261],{"class":55,"line":168},[53,1262,1263],{"class":410},"# NAIVE: sudo umount \u002Fmnt\u002Fusb   → \"target is busy\"\n",[53,1265,1266],{"class":55,"line":178},[53,1267,1268],{"class":410},"# PRODUCTION: find what's using it\n",[53,1270,1271,1273,1276,1279,1282],{"class":55,"line":188},[53,1272,672],{"class":59},[53,1274,1275],{"class":69}," lsof",[53,1277,1278],{"class":69}," +D",[53,1280,1281],{"class":69}," \u002Fmnt\u002Fusb",[53,1283,1284],{"class":410},"                          # processes with open files\n",[53,1286,1287,1289,1292,1295,1297],{"class":55,"line":208},[53,1288,672],{"class":59},[53,1290,1291],{"class":69}," fuser",[53,1293,1294],{"class":479}," -vm",[53,1296,1281],{"class":69},[53,1298,1299],{"class":410},"                        # alternative\n",[53,1301,1302],{"class":55,"line":233},[53,1303,1304],{"class":410},"# Force kill (dangerous):\n",[53,1306,1307,1309,1311,1314],{"class":55,"line":258},[53,1308,672],{"class":59},[53,1310,1291],{"class":69},[53,1312,1313],{"class":479}," -k",[53,1315,1316],{"class":69}," \u002Fmnt\u002Fusb\n",[53,1318,1319],{"class":55,"line":277},[53,1320,1321],{"class":410},"# Lazy unmount (detaches now, cleans up when busy files close):\n",[53,1323,1324,1326,1328,1330],{"class":55,"line":287},[53,1325,672],{"class":59},[53,1327,1243],{"class":69},[53,1329,480],{"class":479},[53,1331,1316],{"class":69},[616,1333,1335,1338],{"id":1334},"etcfstab-persistent-mounts",[18,1336,1337],{},"\u002Fetc\u002Ffstab"," — Persistent Mounts",[41,1340,1341],{"language":43},[45,1342,1344],{"className":47,"code":1343,"language":43,"meta":49,"style":49},"# \u003Cdevice>       \u003Cmountpoint>  \u003Ctype>  \u003Coptions>     \u003Cdump>  \u003Cpass>\nUUID=ab12...   \u002F             ext4    errors=remount-ro  0  1\nUUID=cd34...   \u002Fhome         ext4    defaults,noatime  0  2\ntmpfs          \u002Ftmp          tmpfs   defaults,size=2G   0  0\n\u002Fdev\u002Fsdb1      \u002Fmnt\u002Fdata     ext4    noatime,nofail     0  2\n",[18,1345,1346,1351,1376,1399,1419],{"__ignoreMap":49},[53,1347,1348],{"class":55,"line":56},[53,1349,1350],{"class":410},"# \u003Cdevice>       \u003Cmountpoint>  \u003Ctype>  \u003Coptions>     \u003Cdump>  \u003Cpass>\n",[53,1352,1353,1356,1358,1361,1364,1367,1370,1373],{"class":55,"line":63},[53,1354,1355],{"class":79},"UUID",[53,1357,425],{"class":424},[53,1359,1360],{"class":69},"ab12...",[53,1362,1363],{"class":59},"   \u002F",[53,1365,1366],{"class":69},"             ext4",[53,1368,1369],{"class":69},"    errors=remount-ro",[53,1371,1372],{"class":479},"  0",[53,1374,1375],{"class":479},"  1\n",[53,1377,1378,1380,1382,1385,1388,1391,1394,1396],{"class":55,"line":89},[53,1379,1355],{"class":79},[53,1381,425],{"class":424},[53,1383,1384],{"class":69},"cd34...",[53,1386,1387],{"class":59},"   \u002Fhome",[53,1389,1390],{"class":69},"         ext4",[53,1392,1393],{"class":69},"    defaults,noatime",[53,1395,1372],{"class":479},[53,1397,1398],{"class":479},"  2\n",[53,1400,1401,1404,1407,1410,1413,1416],{"class":55,"line":110},[53,1402,1403],{"class":59},"tmpfs",[53,1405,1406],{"class":69},"          \u002Ftmp",[53,1408,1409],{"class":69},"          tmpfs",[53,1411,1412],{"class":69},"   defaults,size=2G",[53,1414,1415],{"class":479},"   0",[53,1417,1418],{"class":479},"  0\n",[53,1420,1421,1424,1427,1430,1433,1436],{"class":55,"line":131},[53,1422,1423],{"class":59},"\u002Fdev\u002Fsdb1",[53,1425,1426],{"class":69},"      \u002Fmnt\u002Fdata",[53,1428,1429],{"class":69},"     ext4",[53,1431,1432],{"class":69},"    noatime,nofail",[53,1434,1435],{"class":479},"     0",[53,1437,1398],{"class":479},[1170,1439,1440,1456,1464],{},[1173,1441,1442,1447,1448,1451,1452,1455],{},[31,1443,1444],{},[18,1445,1446],{},"UUID="," — identify by filesystem UUID (survives device name changes). Get with ",[18,1449,1450],{},"blkid"," or ",[18,1453,1454],{},"lsblk -f",".",[1173,1457,1458,1463],{},[31,1459,1460],{},[18,1461,1462],{},"nofail"," — boot continues if the device is absent (critical for USB\u002Fexternal disks).",[1173,1465,1466,1471,1472,1475],{},[31,1467,1468],{},[18,1469,1470],{},"pass"," — ",[18,1473,1474],{},"fsck"," order at boot (0 = skip, 1 = root first, 2 = others).",[41,1477,1478],{"language":43},[45,1479,1481],{"className":47,"code":1480,"language":43,"meta":49,"style":49},"# Complex Implementation: validate fstab BEFORE rebooting (prevents emergency mode)\nsudo findmnt --verify                        # syntax check\nsudo mount -a                                # mount everything not already mounted\n# If mount -a succeeds, reboot is safe\n",[18,1482,1483,1488,1501,1513],{"__ignoreMap":49},[53,1484,1485],{"class":55,"line":56},[53,1486,1487],{"class":410},"# Complex Implementation: validate fstab BEFORE rebooting (prevents emergency mode)\n",[53,1489,1490,1492,1495,1498],{"class":55,"line":63},[53,1491,672],{"class":59},[53,1493,1494],{"class":69}," findmnt",[53,1496,1497],{"class":479}," --verify",[53,1499,1500],{"class":410},"                        # syntax check\n",[53,1502,1503,1505,1507,1510],{"class":55,"line":89},[53,1504,672],{"class":59},[53,1506,1218],{"class":69},[53,1508,1509],{"class":479}," -a",[53,1511,1512],{"class":410},"                                # mount everything not already mounted\n",[53,1514,1515],{"class":55,"line":110},[53,1516,1517],{"class":410},"# If mount -a succeeds, reboot is safe\n",[616,1519,1521],{"id":1520},"edge-case-mounting-over-a-non-empty-directory","Edge Case: Mounting Over a Non-Empty Directory",[41,1523,1524],{"language":43},[45,1525,1527],{"className":47,"code":1526,"language":43,"meta":49,"style":49},"# If \u002Fmnt\u002Fdata has files and you mount a filesystem there:\nsudo mount \u002Fdev\u002Fsdb1 \u002Fmnt\u002Fdata\n# The existing files are HIDDEN (not deleted) until you unmount.\n# Confusing if you forgot a mount is active. Unmount to see them again:\nsudo umount \u002Fmnt\u002Fdata\nls \u002Fmnt\u002Fdata                # original files reappear\n",[18,1528,1529,1534,1545,1550,1555,1563],{"__ignoreMap":49},[53,1530,1531],{"class":55,"line":56},[53,1532,1533],{"class":410},"# If \u002Fmnt\u002Fdata has files and you mount a filesystem there:\n",[53,1535,1536,1538,1540,1543],{"class":55,"line":63},[53,1537,672],{"class":59},[53,1539,1218],{"class":69},[53,1541,1542],{"class":69}," \u002Fdev\u002Fsdb1",[53,1544,1236],{"class":69},[53,1546,1547],{"class":55,"line":89},[53,1548,1549],{"class":410},"# The existing files are HIDDEN (not deleted) until you unmount.\n",[53,1551,1552],{"class":55,"line":110},[53,1553,1554],{"class":410},"# Confusing if you forgot a mount is active. Unmount to see them again:\n",[53,1556,1557,1559,1561],{"class":55,"line":131},[53,1558,672],{"class":59},[53,1560,1243],{"class":69},[53,1562,1236],{"class":69},[53,1564,1565,1567,1569],{"class":55,"line":156},[53,1566,476],{"class":59},[53,1568,1246],{"class":69},[53,1570,1571],{"class":410},"                # original files reappear\n",[36,1573,1575],{"id":1574},"filesystem-types","Filesystem Types",[1577,1578,1579,1592],"table",{},[1580,1581,1582],"thead",{},[1583,1584,1585,1589],"tr",{},[1586,1587,1588],"th",{},"Type",[1586,1590,1591],{},"Use",[1593,1594,1595,1606,1616,1626,1636,1652,1665,1683],"tbody",{},[1583,1596,1597,1603],{},[1598,1599,1600],"td",{},[18,1601,1602],{},"ext4",[1598,1604,1605],{},"Default on most Linux distros — mature, journaling, widely supported",[1583,1607,1608,1613],{},[1598,1609,1610],{},[18,1611,1612],{},"xfs",[1598,1614,1615],{},"Default on RHEL\u002FRocky — excellent for large files, online grow",[1583,1617,1618,1623],{},[1598,1619,1620],{},[18,1621,1622],{},"btrfs",[1598,1624,1625],{},"Copy-on-write, snapshots, compression, subvolumes",[1583,1627,1628,1633],{},[1598,1629,1630],{},[18,1631,1632],{},"zfs",[1598,1634,1635],{},"Enterprise: integrity, snapshots, RAID, compression (via OpenZFS)",[1583,1637,1638,1642],{},[1598,1639,1640],{},[18,1641,1403],{},[1598,1643,1644,1645,25,1648,1651],{},"RAM-backed (used for ",[18,1646,1647],{},"\u002Ftmp",[18,1649,1650],{},"\u002Frun",") — fast, volatile",[1583,1653,1654,1662],{},[1598,1655,1656,20,1659],{},[18,1657,1658],{},"vfat",[18,1660,1661],{},"exfat",[1598,1663,1664],{},"FAT32\u002FexFAT — cross-platform USB drives",[1583,1666,1667,1672],{},[1598,1668,1669],{},[18,1670,1671],{},"ntfs",[1598,1673,1674,1675,1678,1679,1682],{},"Windows filesystem (via ",[18,1676,1677],{},"ntfs-3g"," or kernel ",[18,1680,1681],{},"ntfs3",")",[1583,1684,1685,1690],{},[1598,1686,1687],{},[18,1688,1689],{},"overlay",[1598,1691,1692],{},"OverlayFS — containers (Docker\u002FPodman layers)",[41,1694,1695],{"language":43},[45,1696,1698],{"className":47,"code":1697,"language":43,"meta":49,"style":49},"# Complex Implementation: identify all mounted filesystems with types\nfindmnt -t ext4,xfs,btrfs              # only real filesystems\ndf -hT                                 # type + size\u002Fused\u002Favail\ndf -x tmpfs -x devtmpfs -x squashfs   # exclude virtual FS from df output\n",[18,1699,1700,1705,1718,1728],{"__ignoreMap":49},[53,1701,1702],{"class":55,"line":56},[53,1703,1704],{"class":410},"# Complex Implementation: identify all mounted filesystems with types\n",[53,1706,1707,1710,1712,1715],{"class":55,"line":63},[53,1708,1709],{"class":59},"findmnt",[53,1711,1221],{"class":479},[53,1713,1714],{"class":69}," ext4,xfs,btrfs",[53,1716,1717],{"class":410},"              # only real filesystems\n",[53,1719,1720,1722,1725],{"class":55,"line":89},[53,1721,867],{"class":59},[53,1723,1724],{"class":479}," -hT",[53,1726,1727],{"class":410},"                                 # type + size\u002Fused\u002Favail\n",[53,1729,1730,1732,1735,1738,1740,1743,1745,1748],{"class":55,"line":110},[53,1731,867],{"class":59},[53,1733,1734],{"class":479}," -x",[53,1736,1737],{"class":69}," tmpfs",[53,1739,1734],{"class":479},[53,1741,1742],{"class":69}," devtmpfs",[53,1744,1734],{"class":479},[53,1746,1747],{"class":69}," squashfs",[53,1749,1750],{"class":410},"   # exclude virtual FS from df output\n",[36,1752,1754],{"id":1753},"tips-tricks","💡 Tips & Tricks",[1170,1756,1757,1782,1790,1807,1819,1843],{},[1173,1758,1759,1762,1763,1765,1766,1768,1769,1771,1772,25,1775,25,1778,1781],{},[31,1760,1761],{},"Idiom",": use ",[18,1764,1709],{}," over ",[18,1767,1188],{}," for reading mounts — ",[18,1770,1709],{}," shows a readable tree, supports ",[18,1773,1774],{},"--source",[18,1776,1777],{},"--target",[18,1779,1780],{},"--type"," filters.",[1173,1783,1784,1762,1786,1789],{},[31,1785,1761],{},[18,1787,1788],{},"lsblk"," to see the disk layout at a glance — block devices, partitions, sizes, mount points, filesystem types, in one tree.",[1173,1791,1792,1794,1795,1798,1799,1802,1803,1451,1805,1455],{},[31,1793,1761],{},": use UUIDs in ",[18,1796,1797],{},"fstab",", not ",[18,1800,1801],{},"\u002Fdev\u002Fsda1"," — device names can change across reboots. UUIDs are unique per filesystem and stable. Get them with ",[18,1804,1450],{},[18,1806,1454],{},[1173,1808,1809,1811,1812,1815,1816,1818],{},[31,1810,1761],{},": add ",[18,1813,1814],{},"noatime"," to SSD mounts in ",[18,1817,1797],{}," — disables access-time updates on every read, reducing writes and improving SSD lifespan\u002Fperformance.",[1173,1820,1821,1762,1823,1826,1827,1830,1831,1834,1835,1837,1838,1451,1841,1455],{},[31,1822,1761],{},[18,1824,1825],{},"du -x \u002F"," to measure one filesystem only — ",[18,1828,1829],{},"-x"," (",[18,1832,1833],{},"--one-file-system",") prevents descending into other mounts, so you measure just ",[18,1836,20],{}," not ",[18,1839,1840],{},"\u002Fhome",[18,1842,388],{},[1173,1844,1845,1762,1848,1851,1852,1855],{},[31,1846,1847],{},"Debug",[18,1849,1850],{},"lsof +D \u002Fmnt\u002Fusb"," (or ",[18,1853,1854],{},"fuser -vm \u002Fmnt\u002Fusb",") to find what's blocking an unmount — shows processes with open files in that directory.",[36,1857,1859],{"id":1858},"️-edge-cases-gotchas","⚠️ Edge Cases & Gotchas",[1170,1861,1862,1880,1899,1912,1930],{},[1173,1863,1864,1867,1868,1871,1872,1875,1876,1879],{},[31,1865,1866],{},"You can run out of inodes before disk space",": millions of tiny files (e.g., a cache, mail queue) exhaust inodes first. ",[18,1869,1870],{},"df -h"," shows space free, but ",[18,1873,1874],{},"df -i"," shows inodes exhausted. Fix: delete files or reformat with more inodes (",[18,1877,1878],{},"mkfs.ext4 -i 4096",").",[1173,1881,1882,1885,1886,1889,1890,622,1892,1894,1895,1898],{},[31,1883,1884],{},"Hard links can't cross filesystems",": ",[18,1887,1888],{},"ln \u002Fhome\u002Falice\u002Ffile \u002Ftmp\u002Flink"," fails if ",[18,1891,1840],{},[18,1893,1647],{}," are different filesystems. Use ",[18,1896,1897],{},"ln -s"," (symlink) instead — but it breaks if the target moves.",[1173,1900,1901,1885,1904,1907,1908,1911],{},[31,1902,1903],{},"Moving a file across filesystems is copy + delete",[18,1905,1906],{},"mv \u002Fhome\u002Fbigfile \u002Fmnt\u002Fusb\u002F"," copies then deletes. If it runs out of space mid-copy, the destination has a partial file and the source may be gone. Use ",[18,1909,1910],{},"rsync -a --remove-source-files"," for safer cross-FS moves.",[1173,1913,1914,1919,1920,1922,1923,1926,1927,1929],{},[31,1915,1916,1918],{},[18,1917,1337],{}," errors can prevent booting",": a bad ",[18,1921,1797],{}," entry causes boot to drop to emergency mode. Test with ",[18,1924,1925],{},"sudo mount -a"," before rebooting. Use ",[18,1928,1462],{}," for non-critical mounts (e.g., USB) so boot continues if absent.",[1173,1931,1932,1885,1938,1941,1942,1945,1946,1949,1950,1953],{},[31,1933,1934,1937],{},[18,1935,1936],{},"\u002Fboot"," can fill up from old kernels",[18,1939,1940],{},"apt"," keeps old kernel images. ",[18,1943,1944],{},"df -h \u002Fboot"," filling up causes upgrade failures. Clean with ",[18,1947,1948],{},"sudo apt autoremove --purge"," (Debian\u002FUbuntu) or ",[18,1951,1952],{},"dnf remove --oldinstallonly"," (Fedora).",[36,1955,1957],{"id":1956},"quick-quiz","🧠 Quick Quiz",[14,1959,1960,1961,1964,1965,1968],{},"A user runs ",[18,1962,1963],{},"df -h \u002F"," and sees 40 GB free, but ",[18,1966,1967],{},"touch \u002Ftestfile"," fails with \"No space left on device\". What's likely happening, and how do you confirm it?",[1970,1971,1972,1976,1979,2025,2067],"details",{},[1973,1974,1975],"summary",{},"Answer",[14,1977,1978],{},"Two likely causes:",[1980,1981,1982,1996],"ol",{},[1173,1983,1984,1987,1988,1991,1992,1995],{},[31,1985,1986],{},"Inode exhaustion"," — the filesystem has free space but no free inodes (too many tiny files). Confirm with ",[18,1989,1990],{},"df -i \u002F"," — if ",[18,1993,1994],{},"IUse%"," is 100%, you're out of inodes. Fix by deleting files (especially many small ones), or reformat with more inodes.",[1173,1997,1998,1471,2001,2003,2004,2006,2007,2009,2010,2013,2014,2017,2018,2021,2022,1455],{},[31,1999,2000],{},"A separate small filesystem is full",[18,2002,20],{}," might have space, but the file is being created on a different mounted filesystem (e.g., ",[18,2005,1647],{}," is ",[18,2008,1403],{}," with a ",[18,2011,2012],{},"size="," limit, or ",[18,2015,2016],{},"\u002Fvar"," is a separate partition). Confirm with ",[18,2019,2020],{},"df -h \u002Ftestfile"," (resolves the actual filesystem) or ",[18,2023,2024],{},"findmnt \u002Ftestfile",[41,2026,2027],{"language":43},[45,2028,2030],{"className":47,"code":2029,"language":43,"meta":49,"style":49},"df -i \u002F                 # check inode usage\ndf -h \u002Ftestfile         # which filesystem does \u002Ftestfile live on?\nfindmnt -T \u002Ftestfile    # same, more readable\n",[18,2031,2032,2043,2055],{"__ignoreMap":49},[53,2033,2034,2036,2038,2040],{"class":55,"line":56},[53,2035,867],{"class":59},[53,2037,846],{"class":479},[53,2039,872],{"class":69},[53,2041,2042],{"class":410},"                 # check inode usage\n",[53,2044,2045,2047,2049,2052],{"class":55,"line":63},[53,2046,867],{"class":59},[53,2048,898],{"class":479},[53,2050,2051],{"class":69}," \u002Ftestfile",[53,2053,2054],{"class":410},"         # which filesystem does \u002Ftestfile live on?\n",[53,2056,2057,2059,2062,2064],{"class":55,"line":89},[53,2058,1709],{"class":59},[53,2060,2061],{"class":479}," -T",[53,2063,2051],{"class":69},[53,2065,2066],{"class":410},"    # same, more readable\n",[14,2068,2069,2070,2073],{},"Also check filesystem quotas (",[18,2071,2072],{},"quota -v",") if enabled — a user can hit their quota even if the filesystem has space.",[2075,2076,2077],"style",{},"html pre.shiki code .sIsaT, html code.shiki .sIsaT{--shiki-default:#6F42C1;--shiki-github-dark:#B392F0}html pre.shiki code .sJ6F3, html code.shiki .sJ6F3{--shiki-default:#032F62;--shiki-github-dark:#9ECBFF}html pre.shiki code .ssxIu, html code.shiki .ssxIu{--shiki-default:#24292E;--shiki-github-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html.github-dark .shiki span {color: var(--shiki-github-dark);background: var(--shiki-github-dark-bg);font-style: var(--shiki-github-dark-font-style);font-weight: var(--shiki-github-dark-font-weight);text-decoration: var(--shiki-github-dark-text-decoration);}html pre.shiki code .sdCPZ, html code.shiki .sdCPZ{--shiki-default:#6A737D;--shiki-github-dark:#6A737D}html pre.shiki code .svdQ7, html code.shiki .svdQ7{--shiki-default:#D73A49;--shiki-github-dark:#F97583}html pre.shiki code .snvgF, html code.shiki .snvgF{--shiki-default:#005CC5;--shiki-github-dark:#79B8FF}",{"title":49,"searchDepth":63,"depth":63,"links":2079},[2080,2081,2086,2090,2095,2096,2097,2098],{"id":38,"depth":63,"text":39},{"id":385,"depth":63,"text":2082,"children":2083},"\u002Fproc — Process & Kernel Info (Virtual)",[2084],{"id":618,"depth":89,"text":2085},"Edge Case: \u002Fproc and \u002Fsys Are RAM-Only",{"id":699,"depth":63,"text":700,"children":2087},[2088,2089],{"id":878,"depth":89,"text":879},{"id":1025,"depth":89,"text":1026},{"id":1181,"depth":63,"text":1182,"children":2091},[2092,2094],{"id":1334,"depth":89,"text":2093},"\u002Fetc\u002Ffstab — Persistent Mounts",{"id":1520,"depth":89,"text":1521},{"id":1574,"depth":63,"text":1575},{"id":1753,"depth":63,"text":1754},{"id":1858,"depth":63,"text":1859},{"id":1956,"depth":63,"text":1957},"Linux organizes every file under a single root directory, \u002F. There are no drive letters (C:, D:) — additional disks are mounted into the tree at directories (mount points). This chapter covers the standard layout, virtual filesystems, inodes, and mount mechanics — through production patterns and edge-case behavior.","md",{},"\u002Flinux\u002F03-filesystem-hierarchy",{"title":5,"description":2099},"linux\u002F03-filesystem-hierarchy","Z14a-KzgOvzbO4dbFEqlrQtzEC1Y12qr9_QoyvZj3Pk",1789924649775]