A Wikiful of Hacks: Hacks.Wiki is an experiment to organise quick hacks, notes, bookmarks and tools into an easy-to-build-and-maintain “Digital Garden”.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
12 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1">
  5. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  6. <link rel="icon" href="/public/logo.png">
  7. <link rel="stylesheet" href="/public/style.css">
  8. <title>🗄️ Mounting BTRFS subvolumes | Hacks.Wiki - A wikiful of hacks</title>
  9. <link href="/+/feed.rss" rel="alternate" title="Hacks.Wiki - A wikiful of hacks" type="application/rss+xml"><link href='https://hacks.wiki/+/activitypub/@hacks' rel='alternate' type='application/activity+json'><link rel="stylesheet" href="public/custom.css"><link rel="manifest" href="/manifest.json">
  10. <meta property="og:site_name" content="Hacks.Wiki - A wikiful of hacks" />
  11. <meta property="og:title" content="Mounting BTRFS subvolumes" />
  12. <meta property="og:description" content="If you have installed GNU/Linux with BTRFS as the filesystem, chances are that your OS installer has used sub-volumes for the root , home and other mount points. You can verify this by mounting the a" />
  13. <meta property="og:image" content="" />
  14. <meta property="og:url" content="https://hacks.wiki/Mounting%20BTRFS%20subvolumes" />
  15. <meta property="og:type" content="website" />
  16. <meta name="twitter:title" content="Mounting BTRFS subvolumes" />
  17. <meta name="twitter:description" content="If you have installed GNU/Linux with BTRFS as the filesystem, chances are that your OS installer has used sub-volumes for the root , home and other mount points. You can verify this by mounting the a" />
  18. <meta name="twitter:image" content="" />
  19. <meta name="twitter:card" content="summary_large_image" />
  20. <meta name="twitter:creator" content="abhasabhinav" />
  21. <meta name="twitter:site" content="abhasabhinav" />
  22. <meta name="twitter:image:alt" content="Mounting BTRFS subvolumes" />
  23. </head>
  24. <body>
  25. <div class="container is-max-desktop px-3" dir="auto" style="margin-bottom: 50vh;">
  26. <div class="columns pt-5">
  27. <div class="column">
  28. <a class="icon-text title is-5 pt-2" href="/">
  29. <span class="icon"><img alt="logo" src="/public/logo.png"/></span>
  30. <span>Hacks.Wiki - A wikiful of hacks</span>
  31. </a>
  32. </div>
  33. </div>
  34. <div dir="auto" class="title is-1 has-text-weight-bold">🗄️ Mounting BTRFS subvolumes</div>
  35. <div class="content">
  36. <div class="columns subtitle is-size-7">
  37. <div class="column">
  38. <span class="icon-text">
  39. <span class="icon"> <i class="fa-solid fa-clock"></i> </span>
  40. <span>Monday 27 February 2023</span>
  41. <span class="icon"> <i class="fa-solid fa-code-branch"></i> </span>
  42. <span>2 versions</span>
  43. </span>
  44. </div>
  45. </div>
  46. <div class="view">
  47. <p dir="auto">If you have installed GNU/Linux with BTRFS as the filesystem, chances are that your OS installer has used <strong>sub-volumes</strong> for the <code>root</code>, <code>home</code> and other mount points. &#x1f5c4;&#xfe0f;</p>
  48. <p dir="auto">You can verify this by mounting the actual root filesystem device and listing its contents:</p>
  49. <pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;"><code><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span><span style="color:#6272a4"># ls -l /mnt/</span>
  50. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span>total <span style="color:#bd93f9">0</span>
  51. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">204</span> Feb <span style="color:#bd93f9">22</span> 13:28 @
  52. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">180</span> Feb <span style="color:#bd93f9">22</span> 14:29 @cache
  53. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">10</span> Dec <span style="color:#bd93f9">2</span> 10:52 @home
  54. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">482</span> Feb <span style="color:#bd93f9">26</span> 00:00 @log
  55. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7</span><span>drwxr-x--- <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">350</span> Feb <span style="color:#bd93f9">23</span> 15:40 @root
  56. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">8</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">14</span> Oct <span style="color:#bd93f9">19</span> 07:42 @srv
  57. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">9</span><span>drwxrwxrwt <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">1576</span> Feb <span style="color:#bd93f9">27</span> 17:18 @tmp
  58. </span></span></code></pre><p dir="auto">Here <code>@</code>, <code>@home</code>, <code>@log</code> etc. are the BTRFS sub-volumes. <code>@</code> is the OS root sub-volume. You can mount by giving the <code>-osubvol=@</code> option to the mount command:</p>
  59. <pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;"><code><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span><span style="color:#6272a4"># mount -osubvol=@ /dev/dm-0 /mnt/</span>
  60. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span><span style="color:#6272a4"># ls -l /mnt/</span>
  61. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span>total <span style="color:#bd93f9">24</span>
  62. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span>lrwxrwxrwx <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">7</span> Feb <span style="color:#bd93f9">1</span> 02:21 bin -&gt; usr/bin
  63. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">208</span> Feb <span style="color:#bd93f9">22</span> 13:30 boot
  64. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">8</span> Oct <span style="color:#bd93f9">20</span> 18:39 dev
  65. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">5018</span> Feb <span style="color:#bd93f9">25</span> 10:56 etc
  66. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">0</span> Dec <span style="color:#bd93f9">2</span> 10:48 home
  67. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span>lrwxrwxrwx <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">7</span> Feb <span style="color:#bd93f9">1</span> 02:21 lib -&gt; usr/lib
  68. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span>lrwxrwxrwx <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">7</span> Feb <span style="color:#bd93f9">1</span> 02:21 lib64 -&gt; usr/lib
  69. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">22</span> Dec <span style="color:#bd93f9">16</span> 13:00 mnt
  70. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">214</span> Feb <span style="color:#bd93f9">23</span> 15:50 opt
  71. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">0</span> Dec <span style="color:#bd93f9">2</span> 10:48 proc
  72. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14</span><span>drwxr-xr-x <span style="color:#bd93f9">1</span> root root <span style="color:#bd93f9">66</span> Oct <span style="color:#bd93f9">20</span> 18:47 root
  73. </span></span><span style="display:flex;"><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15</span><span> .... .... ....
  74. </span></span></code></pre><p dir="auto"><a href="/+/tag/linux" class="tag is-info is-light">#linux</a> <a href="/+/tag/btrfs" class="tag is-info is-light">#btrfs</a> <a href="/+/tag/systemrescue" class="tag is-info is-light">#systemrescue</a> <a href="/+/tag/filesystem" class="tag is-info is-light">#filesystem</a></p>
  75. <h1> Backlinks </h1>
  76. <ul>
  77. <li>
  78. <a href="/Migrate%20from%20UEFI%20to%20%28Legacy%29%20BIOS" dir="auto">🔁 Migrate from UEFI to (Legacy) BIOS</a> <time class="has-text-grey is-size-7">Tuesday 28 February 2023</time>
  79. </li>
  80. </ul>
  81. <h1> See Also </h1>
  82. <ul>
  83. <li>
  84. <a href="/Chromebox-Audio" dir="auto">🎧 Chromebox-Audio</a> <time class="has-text-grey is-size-7">Monday 27 February 2023</time>
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. <footer class="mt-6 p-3 py-5">
  90. <hr/>
  91. <nav class="breadcrumb has-bullet-separator">
  92. <ul>
  93. <li>
  94. <a href="/&#43;/tags" class="icon-text has-text-grey-dark">
  95. <span class="icon">
  96. <i class="fa-solid fa-tags"></i>
  97. </span>
  98. <span>Hashtags</span>
  99. </a>
  100. </li>
  101. <li>
  102. <a href="/&#43;/recent" class="icon-text has-text-grey-dark">
  103. <span class="icon">
  104. <i class="fa-solid fa-clock-rotate-left"></i>
  105. </span>
  106. <span>Recent</span>
  107. </a>
  108. </li>
  109. <li>
  110. <a href="/&#43;/feed.rss" class="icon-text has-text-grey-dark">
  111. <span class="icon">
  112. <i class="fa-solid fa-rss"></i>
  113. </span>
  114. <span>RSS</span>
  115. </a>
  116. </li>
  117. <li>
  118. <a href="/Home" class="icon-text has-text-grey-dark">
  119. <span class="icon">
  120. 🏡
  121. </span>
  122. <span>Home</span>
  123. </a>
  124. </li>
  125. </ul>
  126. </nav>
  127. </footer>
  128. </div>
  129. </body>
  130. </html>