How to mount btrfs subvolume, it isn't working / mounting











up vote
2
down vote

favorite












I just did:



# btrfs subvolume create /@srv


then:



# btrfs subvolume list /
ID 257 gen 73 top level 5 path @
ID 258 gen 71 top level 5 path @home
ID 260 gen 65 top level 257 path @srv


And added to /etc/fstab, like this:



/dev/mapper/fs--1--vg-root /home            btrfs   defaults,compress=zlib,subvol=@home 0       2
/dev/mapper/fs--1--vg-root /srv btrfs defaults,compress=zlib,subvol=@srv 0 2


...where /home is the default that come from Ubuntu's installation and /srv is the one that I manually added, based on what I'm seeing "as an example (i.e., /home)".



But it does not mount, look:



# mount /srv
mount: mount(2) failed: No such file or directory


Subdir /srv exists:



# file /srv
/srv: directory


What am I missing?



BTW, the subvolumes @ and @home are okay. But I am unable to create more subvolumes and mount it, side by side with, for example, @home.










share|improve this question
























  • Does the subdirectory /srv exists? mount needs the target directory to already exist before the partition/subvolume can be mounted there.
    – Lie Ryan
    Feb 15 '15 at 1:27










  • Yes, /srv is somehow a "default" directory that always exists in a fresh install.
    – ThiagoCMC
    Feb 15 '15 at 2:07










  • So, this might be a BUG. But against which package should I register it at Launchpad.net?
    – ThiagoCMC
    Feb 19 '15 at 15:36










  • Why do you seem to be mounting an LVM VG (volume group)? Shouldn't you be mounting an LV (logical volume)? I'm currently not at my workstation that has LVM and BTRFS right now, so I can't check whether the mapper name should look like (/dev/mapper/fs--1--vg-root), but they look odd. If I recall correctly, in my workstation the BTRFS is mounted with the LV's UUID. I believe you can also mount with the /dev/vgblah/lvbleh, but I've never tried mounting it with /dev/mapper. From a quick search, the naming convention used by device mapper for an LV seems to be /dev/mapper/vgblah-lvbleh.
    – Lie Ryan
    Feb 19 '15 at 16:46












  • Hey Ryan! I've updated the question, I added the /home partition that come from installation, I've used it as an example, and it mounts using /dev/mapper, so, I tried to copy it as an example. Still doesn't work... I'm wondering here... Are you able to mount a BTRFS subvolume created by you after the installation?
    – ThiagoCMC
    Feb 20 '15 at 0:58















up vote
2
down vote

favorite












I just did:



# btrfs subvolume create /@srv


then:



# btrfs subvolume list /
ID 257 gen 73 top level 5 path @
ID 258 gen 71 top level 5 path @home
ID 260 gen 65 top level 257 path @srv


And added to /etc/fstab, like this:



/dev/mapper/fs--1--vg-root /home            btrfs   defaults,compress=zlib,subvol=@home 0       2
/dev/mapper/fs--1--vg-root /srv btrfs defaults,compress=zlib,subvol=@srv 0 2


...where /home is the default that come from Ubuntu's installation and /srv is the one that I manually added, based on what I'm seeing "as an example (i.e., /home)".



But it does not mount, look:



# mount /srv
mount: mount(2) failed: No such file or directory


Subdir /srv exists:



# file /srv
/srv: directory


What am I missing?



BTW, the subvolumes @ and @home are okay. But I am unable to create more subvolumes and mount it, side by side with, for example, @home.










share|improve this question
























  • Does the subdirectory /srv exists? mount needs the target directory to already exist before the partition/subvolume can be mounted there.
    – Lie Ryan
    Feb 15 '15 at 1:27










  • Yes, /srv is somehow a "default" directory that always exists in a fresh install.
    – ThiagoCMC
    Feb 15 '15 at 2:07










  • So, this might be a BUG. But against which package should I register it at Launchpad.net?
    – ThiagoCMC
    Feb 19 '15 at 15:36










  • Why do you seem to be mounting an LVM VG (volume group)? Shouldn't you be mounting an LV (logical volume)? I'm currently not at my workstation that has LVM and BTRFS right now, so I can't check whether the mapper name should look like (/dev/mapper/fs--1--vg-root), but they look odd. If I recall correctly, in my workstation the BTRFS is mounted with the LV's UUID. I believe you can also mount with the /dev/vgblah/lvbleh, but I've never tried mounting it with /dev/mapper. From a quick search, the naming convention used by device mapper for an LV seems to be /dev/mapper/vgblah-lvbleh.
    – Lie Ryan
    Feb 19 '15 at 16:46












  • Hey Ryan! I've updated the question, I added the /home partition that come from installation, I've used it as an example, and it mounts using /dev/mapper, so, I tried to copy it as an example. Still doesn't work... I'm wondering here... Are you able to mount a BTRFS subvolume created by you after the installation?
    – ThiagoCMC
    Feb 20 '15 at 0:58













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I just did:



# btrfs subvolume create /@srv


then:



# btrfs subvolume list /
ID 257 gen 73 top level 5 path @
ID 258 gen 71 top level 5 path @home
ID 260 gen 65 top level 257 path @srv


And added to /etc/fstab, like this:



/dev/mapper/fs--1--vg-root /home            btrfs   defaults,compress=zlib,subvol=@home 0       2
/dev/mapper/fs--1--vg-root /srv btrfs defaults,compress=zlib,subvol=@srv 0 2


...where /home is the default that come from Ubuntu's installation and /srv is the one that I manually added, based on what I'm seeing "as an example (i.e., /home)".



But it does not mount, look:



# mount /srv
mount: mount(2) failed: No such file or directory


Subdir /srv exists:



# file /srv
/srv: directory


What am I missing?



BTW, the subvolumes @ and @home are okay. But I am unable to create more subvolumes and mount it, side by side with, for example, @home.










share|improve this question















I just did:



# btrfs subvolume create /@srv


then:



# btrfs subvolume list /
ID 257 gen 73 top level 5 path @
ID 258 gen 71 top level 5 path @home
ID 260 gen 65 top level 257 path @srv


And added to /etc/fstab, like this:



/dev/mapper/fs--1--vg-root /home            btrfs   defaults,compress=zlib,subvol=@home 0       2
/dev/mapper/fs--1--vg-root /srv btrfs defaults,compress=zlib,subvol=@srv 0 2


...where /home is the default that come from Ubuntu's installation and /srv is the one that I manually added, based on what I'm seeing "as an example (i.e., /home)".



But it does not mount, look:



# mount /srv
mount: mount(2) failed: No such file or directory


Subdir /srv exists:



# file /srv
/srv: directory


What am I missing?



BTW, the subvolumes @ and @home are okay. But I am unable to create more subvolumes and mount it, side by side with, for example, @home.







mount btrfs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 20 '15 at 0:55

























asked Feb 15 '15 at 0:23









ThiagoCMC

3743922




3743922












  • Does the subdirectory /srv exists? mount needs the target directory to already exist before the partition/subvolume can be mounted there.
    – Lie Ryan
    Feb 15 '15 at 1:27










  • Yes, /srv is somehow a "default" directory that always exists in a fresh install.
    – ThiagoCMC
    Feb 15 '15 at 2:07










  • So, this might be a BUG. But against which package should I register it at Launchpad.net?
    – ThiagoCMC
    Feb 19 '15 at 15:36










  • Why do you seem to be mounting an LVM VG (volume group)? Shouldn't you be mounting an LV (logical volume)? I'm currently not at my workstation that has LVM and BTRFS right now, so I can't check whether the mapper name should look like (/dev/mapper/fs--1--vg-root), but they look odd. If I recall correctly, in my workstation the BTRFS is mounted with the LV's UUID. I believe you can also mount with the /dev/vgblah/lvbleh, but I've never tried mounting it with /dev/mapper. From a quick search, the naming convention used by device mapper for an LV seems to be /dev/mapper/vgblah-lvbleh.
    – Lie Ryan
    Feb 19 '15 at 16:46












  • Hey Ryan! I've updated the question, I added the /home partition that come from installation, I've used it as an example, and it mounts using /dev/mapper, so, I tried to copy it as an example. Still doesn't work... I'm wondering here... Are you able to mount a BTRFS subvolume created by you after the installation?
    – ThiagoCMC
    Feb 20 '15 at 0:58


















  • Does the subdirectory /srv exists? mount needs the target directory to already exist before the partition/subvolume can be mounted there.
    – Lie Ryan
    Feb 15 '15 at 1:27










  • Yes, /srv is somehow a "default" directory that always exists in a fresh install.
    – ThiagoCMC
    Feb 15 '15 at 2:07










  • So, this might be a BUG. But against which package should I register it at Launchpad.net?
    – ThiagoCMC
    Feb 19 '15 at 15:36










  • Why do you seem to be mounting an LVM VG (volume group)? Shouldn't you be mounting an LV (logical volume)? I'm currently not at my workstation that has LVM and BTRFS right now, so I can't check whether the mapper name should look like (/dev/mapper/fs--1--vg-root), but they look odd. If I recall correctly, in my workstation the BTRFS is mounted with the LV's UUID. I believe you can also mount with the /dev/vgblah/lvbleh, but I've never tried mounting it with /dev/mapper. From a quick search, the naming convention used by device mapper for an LV seems to be /dev/mapper/vgblah-lvbleh.
    – Lie Ryan
    Feb 19 '15 at 16:46












  • Hey Ryan! I've updated the question, I added the /home partition that come from installation, I've used it as an example, and it mounts using /dev/mapper, so, I tried to copy it as an example. Still doesn't work... I'm wondering here... Are you able to mount a BTRFS subvolume created by you after the installation?
    – ThiagoCMC
    Feb 20 '15 at 0:58
















Does the subdirectory /srv exists? mount needs the target directory to already exist before the partition/subvolume can be mounted there.
– Lie Ryan
Feb 15 '15 at 1:27




Does the subdirectory /srv exists? mount needs the target directory to already exist before the partition/subvolume can be mounted there.
– Lie Ryan
Feb 15 '15 at 1:27












Yes, /srv is somehow a "default" directory that always exists in a fresh install.
– ThiagoCMC
Feb 15 '15 at 2:07




Yes, /srv is somehow a "default" directory that always exists in a fresh install.
– ThiagoCMC
Feb 15 '15 at 2:07












So, this might be a BUG. But against which package should I register it at Launchpad.net?
– ThiagoCMC
Feb 19 '15 at 15:36




So, this might be a BUG. But against which package should I register it at Launchpad.net?
– ThiagoCMC
Feb 19 '15 at 15:36












Why do you seem to be mounting an LVM VG (volume group)? Shouldn't you be mounting an LV (logical volume)? I'm currently not at my workstation that has LVM and BTRFS right now, so I can't check whether the mapper name should look like (/dev/mapper/fs--1--vg-root), but they look odd. If I recall correctly, in my workstation the BTRFS is mounted with the LV's UUID. I believe you can also mount with the /dev/vgblah/lvbleh, but I've never tried mounting it with /dev/mapper. From a quick search, the naming convention used by device mapper for an LV seems to be /dev/mapper/vgblah-lvbleh.
– Lie Ryan
Feb 19 '15 at 16:46






Why do you seem to be mounting an LVM VG (volume group)? Shouldn't you be mounting an LV (logical volume)? I'm currently not at my workstation that has LVM and BTRFS right now, so I can't check whether the mapper name should look like (/dev/mapper/fs--1--vg-root), but they look odd. If I recall correctly, in my workstation the BTRFS is mounted with the LV's UUID. I believe you can also mount with the /dev/vgblah/lvbleh, but I've never tried mounting it with /dev/mapper. From a quick search, the naming convention used by device mapper for an LV seems to be /dev/mapper/vgblah-lvbleh.
– Lie Ryan
Feb 19 '15 at 16:46














Hey Ryan! I've updated the question, I added the /home partition that come from installation, I've used it as an example, and it mounts using /dev/mapper, so, I tried to copy it as an example. Still doesn't work... I'm wondering here... Are you able to mount a BTRFS subvolume created by you after the installation?
– ThiagoCMC
Feb 20 '15 at 0:58




Hey Ryan! I've updated the question, I added the /home partition that come from installation, I've used it as an example, and it mounts using /dev/mapper, so, I tried to copy it as an example. Still doesn't work... I'm wondering here... Are you able to mount a BTRFS subvolume created by you after the installation?
– ThiagoCMC
Feb 20 '15 at 0:58










2 Answers
2






active

oldest

votes

















up vote
0
down vote













Looks like bug - I've stumbled across a similiar problem: https://unix.stackexchange.com/q/190698/34801



Mounting with subvolid= works.



This should work:



/dev/mapper/fs--1--vg-root /srv            btrfs   defaults,compress=zlib,subvolid=260 0       2





share|improve this answer






























    up vote
    0
    down vote













    Just tried it and found out, that you should specify subvol=/@ or subvol=/@home – with a leading slash.



    So, my working /etc/fstab with one automount and one manually mountable subvolume now looks like this:



    /dev/sdb /backup btrfs noatime,nodiratime,subvol=/@ 0 0
    /dev/sdb /snapshots btrfs noauto,noatime,nodiratime,subvol=/@snapshots 0 0


    Before, I didn't use leading slashes and mount /snapshots failed. Now mount /snapshot works.



    System:



    # uname -a
    Linux debian-9 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
    # btrfs --version
    btrfs-progs v4.7.3
    # btrfs subvolume list -up /backup
    ID 258 gen 10 parent 5 top level 5 uuid b2740892-9b17-9147-b930-83de797d20df path @
    ID 259 gen 8 parent 5 top level 5 uuid 10560ce1-b6f5-1248-94a0-c0a7734b804f path @snapshots





    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f585603%2fhow-to-mount-btrfs-subvolume-it-isnt-working-mounting%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      Looks like bug - I've stumbled across a similiar problem: https://unix.stackexchange.com/q/190698/34801



      Mounting with subvolid= works.



      This should work:



      /dev/mapper/fs--1--vg-root /srv            btrfs   defaults,compress=zlib,subvolid=260 0       2





      share|improve this answer



























        up vote
        0
        down vote













        Looks like bug - I've stumbled across a similiar problem: https://unix.stackexchange.com/q/190698/34801



        Mounting with subvolid= works.



        This should work:



        /dev/mapper/fs--1--vg-root /srv            btrfs   defaults,compress=zlib,subvolid=260 0       2





        share|improve this answer

























          up vote
          0
          down vote










          up vote
          0
          down vote









          Looks like bug - I've stumbled across a similiar problem: https://unix.stackexchange.com/q/190698/34801



          Mounting with subvolid= works.



          This should work:



          /dev/mapper/fs--1--vg-root /srv            btrfs   defaults,compress=zlib,subvolid=260 0       2





          share|improve this answer














          Looks like bug - I've stumbled across a similiar problem: https://unix.stackexchange.com/q/190698/34801



          Mounting with subvolid= works.



          This should work:



          /dev/mapper/fs--1--vg-root /srv            btrfs   defaults,compress=zlib,subvolid=260 0       2






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:37









          Community

          1




          1










          answered Mar 17 '15 at 12:15









          mt_

          1162




          1162
























              up vote
              0
              down vote













              Just tried it and found out, that you should specify subvol=/@ or subvol=/@home – with a leading slash.



              So, my working /etc/fstab with one automount and one manually mountable subvolume now looks like this:



              /dev/sdb /backup btrfs noatime,nodiratime,subvol=/@ 0 0
              /dev/sdb /snapshots btrfs noauto,noatime,nodiratime,subvol=/@snapshots 0 0


              Before, I didn't use leading slashes and mount /snapshots failed. Now mount /snapshot works.



              System:



              # uname -a
              Linux debian-9 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
              # btrfs --version
              btrfs-progs v4.7.3
              # btrfs subvolume list -up /backup
              ID 258 gen 10 parent 5 top level 5 uuid b2740892-9b17-9147-b930-83de797d20df path @
              ID 259 gen 8 parent 5 top level 5 uuid 10560ce1-b6f5-1248-94a0-c0a7734b804f path @snapshots





              share|improve this answer

























                up vote
                0
                down vote













                Just tried it and found out, that you should specify subvol=/@ or subvol=/@home – with a leading slash.



                So, my working /etc/fstab with one automount and one manually mountable subvolume now looks like this:



                /dev/sdb /backup btrfs noatime,nodiratime,subvol=/@ 0 0
                /dev/sdb /snapshots btrfs noauto,noatime,nodiratime,subvol=/@snapshots 0 0


                Before, I didn't use leading slashes and mount /snapshots failed. Now mount /snapshot works.



                System:



                # uname -a
                Linux debian-9 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
                # btrfs --version
                btrfs-progs v4.7.3
                # btrfs subvolume list -up /backup
                ID 258 gen 10 parent 5 top level 5 uuid b2740892-9b17-9147-b930-83de797d20df path @
                ID 259 gen 8 parent 5 top level 5 uuid 10560ce1-b6f5-1248-94a0-c0a7734b804f path @snapshots





                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Just tried it and found out, that you should specify subvol=/@ or subvol=/@home – with a leading slash.



                  So, my working /etc/fstab with one automount and one manually mountable subvolume now looks like this:



                  /dev/sdb /backup btrfs noatime,nodiratime,subvol=/@ 0 0
                  /dev/sdb /snapshots btrfs noauto,noatime,nodiratime,subvol=/@snapshots 0 0


                  Before, I didn't use leading slashes and mount /snapshots failed. Now mount /snapshot works.



                  System:



                  # uname -a
                  Linux debian-9 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
                  # btrfs --version
                  btrfs-progs v4.7.3
                  # btrfs subvolume list -up /backup
                  ID 258 gen 10 parent 5 top level 5 uuid b2740892-9b17-9147-b930-83de797d20df path @
                  ID 259 gen 8 parent 5 top level 5 uuid 10560ce1-b6f5-1248-94a0-c0a7734b804f path @snapshots





                  share|improve this answer












                  Just tried it and found out, that you should specify subvol=/@ or subvol=/@home – with a leading slash.



                  So, my working /etc/fstab with one automount and one manually mountable subvolume now looks like this:



                  /dev/sdb /backup btrfs noatime,nodiratime,subvol=/@ 0 0
                  /dev/sdb /snapshots btrfs noauto,noatime,nodiratime,subvol=/@snapshots 0 0


                  Before, I didn't use leading slashes and mount /snapshots failed. Now mount /snapshot works.



                  System:



                  # uname -a
                  Linux debian-9 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
                  # btrfs --version
                  btrfs-progs v4.7.3
                  # btrfs subvolume list -up /backup
                  ID 258 gen 10 parent 5 top level 5 uuid b2740892-9b17-9147-b930-83de797d20df path @
                  ID 259 gen 8 parent 5 top level 5 uuid 10560ce1-b6f5-1248-94a0-c0a7734b804f path @snapshots






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 2 at 21:37









                  Thomas Praxl

                  1363




                  1363






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f585603%2fhow-to-mount-btrfs-subvolume-it-isnt-working-mounting%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How did Captain America manage to do this?

                      迪纳利

                      南乌拉尔铁路局