How to delete btrfs subvolume?












2














I have a snapshot that I'd like to delete:



04:03:21::mlissner@pounamu::~ 
↪ sudo btrfs subvolume list /
ID 257 gen 267078 top level 5 path @badroot
ID 258 gen 267151 top level 5 path @home
ID 422 gen 267151 top level 5 path @


The one called @badroot is bad and must go. But:



04:03:23::mlissner@pounamu::~ 
↪ sudo btrfs subvolume delete @badroot
ERROR: error accessing '@badroot'
04:03:31::mlissner@pounamu::~


So I don't know where to proceed. I tried reading the help file:



↪ sudo btrfs subvolume delete --help
usage: btrfs subvolume delete <subvolume> [<subvolume>...]

Delete subvolume(s)


But that's useless too. Perhaps the kind people of the Internet have ideas.










share|improve this question













migrated from serverfault.com Mar 8 '15 at 10:47


This question came from our site for system and network administrators.




















    2














    I have a snapshot that I'd like to delete:



    04:03:21::mlissner@pounamu::~ 
    ↪ sudo btrfs subvolume list /
    ID 257 gen 267078 top level 5 path @badroot
    ID 258 gen 267151 top level 5 path @home
    ID 422 gen 267151 top level 5 path @


    The one called @badroot is bad and must go. But:



    04:03:23::mlissner@pounamu::~ 
    ↪ sudo btrfs subvolume delete @badroot
    ERROR: error accessing '@badroot'
    04:03:31::mlissner@pounamu::~


    So I don't know where to proceed. I tried reading the help file:



    ↪ sudo btrfs subvolume delete --help
    usage: btrfs subvolume delete <subvolume> [<subvolume>...]

    Delete subvolume(s)


    But that's useless too. Perhaps the kind people of the Internet have ideas.










    share|improve this question













    migrated from serverfault.com Mar 8 '15 at 10:47


    This question came from our site for system and network administrators.


















      2












      2








      2


      1





      I have a snapshot that I'd like to delete:



      04:03:21::mlissner@pounamu::~ 
      ↪ sudo btrfs subvolume list /
      ID 257 gen 267078 top level 5 path @badroot
      ID 258 gen 267151 top level 5 path @home
      ID 422 gen 267151 top level 5 path @


      The one called @badroot is bad and must go. But:



      04:03:23::mlissner@pounamu::~ 
      ↪ sudo btrfs subvolume delete @badroot
      ERROR: error accessing '@badroot'
      04:03:31::mlissner@pounamu::~


      So I don't know where to proceed. I tried reading the help file:



      ↪ sudo btrfs subvolume delete --help
      usage: btrfs subvolume delete <subvolume> [<subvolume>...]

      Delete subvolume(s)


      But that's useless too. Perhaps the kind people of the Internet have ideas.










      share|improve this question













      I have a snapshot that I'd like to delete:



      04:03:21::mlissner@pounamu::~ 
      ↪ sudo btrfs subvolume list /
      ID 257 gen 267078 top level 5 path @badroot
      ID 258 gen 267151 top level 5 path @home
      ID 422 gen 267151 top level 5 path @


      The one called @badroot is bad and must go. But:



      04:03:23::mlissner@pounamu::~ 
      ↪ sudo btrfs subvolume delete @badroot
      ERROR: error accessing '@badroot'
      04:03:31::mlissner@pounamu::~


      So I don't know where to proceed. I tried reading the help file:



      ↪ sudo btrfs subvolume delete --help
      usage: btrfs subvolume delete <subvolume> [<subvolume>...]

      Delete subvolume(s)


      But that's useless too. Perhaps the kind people of the Internet have ideas.







      btrfs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 '15 at 0:08









      mlissnermlissner

      123118




      123118




      migrated from serverfault.com Mar 8 '15 at 10:47


      This question came from our site for system and network administrators.






      migrated from serverfault.com Mar 8 '15 at 10:47


      This question came from our site for system and network administrators.
























          1 Answer
          1






          active

          oldest

          votes


















          10














          First possibility



          It seems like you are referring to @badroot using the wrong path.



          If I am reading your shell prompt correctly, your current directory is ~, your home directory — which is probably /home/mlissner or similar. You are specifying the path to the subvolume as a relative path (does not start with /), so you are effectively asking to delete something like /home/mlissner/@badroot... which does not exist.



          Try an absolute path instead:



          sudo btrfs subvolume delete /@badroot


          Second possibility



          Perhaps you have a non-default subvolume mounted on /, for example number 422, @. In this case, only that subvolume appears under / and you cannot see anything above that path, including the other two subvolumes plus any regular files located in the root of the Btrfs.



          In this case, mount the true Btrfs root somewhere else so that you can access its contents. The Btrfs's true root is known as subvolume ID 0 (and is not listed by btrfs subvolume list). Find or create a free mount point and mount as follows:



          mount -o subvolid=0 /dev/some-device /mnt


          Now you should be able to see /mnt/@, /mnt/@badroot, /mnt/@home, plus maybe some other files under /mnt. You can delete subvolume /mnt/@badroot as usual.






          share|improve this answer























          • Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
            – mlissner
            Mar 8 '15 at 17:06










          • Ah, so that was wrong. I added another possibility to my answer.
            – Celada
            Mar 9 '15 at 1:10











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f188860%2fhow-to-delete-btrfs-subvolume%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          10














          First possibility



          It seems like you are referring to @badroot using the wrong path.



          If I am reading your shell prompt correctly, your current directory is ~, your home directory — which is probably /home/mlissner or similar. You are specifying the path to the subvolume as a relative path (does not start with /), so you are effectively asking to delete something like /home/mlissner/@badroot... which does not exist.



          Try an absolute path instead:



          sudo btrfs subvolume delete /@badroot


          Second possibility



          Perhaps you have a non-default subvolume mounted on /, for example number 422, @. In this case, only that subvolume appears under / and you cannot see anything above that path, including the other two subvolumes plus any regular files located in the root of the Btrfs.



          In this case, mount the true Btrfs root somewhere else so that you can access its contents. The Btrfs's true root is known as subvolume ID 0 (and is not listed by btrfs subvolume list). Find or create a free mount point and mount as follows:



          mount -o subvolid=0 /dev/some-device /mnt


          Now you should be able to see /mnt/@, /mnt/@badroot, /mnt/@home, plus maybe some other files under /mnt. You can delete subvolume /mnt/@badroot as usual.






          share|improve this answer























          • Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
            – mlissner
            Mar 8 '15 at 17:06










          • Ah, so that was wrong. I added another possibility to my answer.
            – Celada
            Mar 9 '15 at 1:10
















          10














          First possibility



          It seems like you are referring to @badroot using the wrong path.



          If I am reading your shell prompt correctly, your current directory is ~, your home directory — which is probably /home/mlissner or similar. You are specifying the path to the subvolume as a relative path (does not start with /), so you are effectively asking to delete something like /home/mlissner/@badroot... which does not exist.



          Try an absolute path instead:



          sudo btrfs subvolume delete /@badroot


          Second possibility



          Perhaps you have a non-default subvolume mounted on /, for example number 422, @. In this case, only that subvolume appears under / and you cannot see anything above that path, including the other two subvolumes plus any regular files located in the root of the Btrfs.



          In this case, mount the true Btrfs root somewhere else so that you can access its contents. The Btrfs's true root is known as subvolume ID 0 (and is not listed by btrfs subvolume list). Find or create a free mount point and mount as follows:



          mount -o subvolid=0 /dev/some-device /mnt


          Now you should be able to see /mnt/@, /mnt/@badroot, /mnt/@home, plus maybe some other files under /mnt. You can delete subvolume /mnt/@badroot as usual.






          share|improve this answer























          • Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
            – mlissner
            Mar 8 '15 at 17:06










          • Ah, so that was wrong. I added another possibility to my answer.
            – Celada
            Mar 9 '15 at 1:10














          10












          10








          10






          First possibility



          It seems like you are referring to @badroot using the wrong path.



          If I am reading your shell prompt correctly, your current directory is ~, your home directory — which is probably /home/mlissner or similar. You are specifying the path to the subvolume as a relative path (does not start with /), so you are effectively asking to delete something like /home/mlissner/@badroot... which does not exist.



          Try an absolute path instead:



          sudo btrfs subvolume delete /@badroot


          Second possibility



          Perhaps you have a non-default subvolume mounted on /, for example number 422, @. In this case, only that subvolume appears under / and you cannot see anything above that path, including the other two subvolumes plus any regular files located in the root of the Btrfs.



          In this case, mount the true Btrfs root somewhere else so that you can access its contents. The Btrfs's true root is known as subvolume ID 0 (and is not listed by btrfs subvolume list). Find or create a free mount point and mount as follows:



          mount -o subvolid=0 /dev/some-device /mnt


          Now you should be able to see /mnt/@, /mnt/@badroot, /mnt/@home, plus maybe some other files under /mnt. You can delete subvolume /mnt/@badroot as usual.






          share|improve this answer














          First possibility



          It seems like you are referring to @badroot using the wrong path.



          If I am reading your shell prompt correctly, your current directory is ~, your home directory — which is probably /home/mlissner or similar. You are specifying the path to the subvolume as a relative path (does not start with /), so you are effectively asking to delete something like /home/mlissner/@badroot... which does not exist.



          Try an absolute path instead:



          sudo btrfs subvolume delete /@badroot


          Second possibility



          Perhaps you have a non-default subvolume mounted on /, for example number 422, @. In this case, only that subvolume appears under / and you cannot see anything above that path, including the other two subvolumes plus any regular files located in the root of the Btrfs.



          In this case, mount the true Btrfs root somewhere else so that you can access its contents. The Btrfs's true root is known as subvolume ID 0 (and is not listed by btrfs subvolume list). Find or create a free mount point and mount as follows:



          mount -o subvolid=0 /dev/some-device /mnt


          Now you should be able to see /mnt/@, /mnt/@badroot, /mnt/@home, plus maybe some other files under /mnt. You can delete subvolume /mnt/@badroot as usual.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 9 '15 at 1:09

























          answered Mar 8 '15 at 12:41









          CeladaCelada

          30.7k46484




          30.7k46484












          • Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
            – mlissner
            Mar 8 '15 at 17:06










          • Ah, so that was wrong. I added another possibility to my answer.
            – Celada
            Mar 9 '15 at 1:10


















          • Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
            – mlissner
            Mar 8 '15 at 17:06










          • Ah, so that was wrong. I added another possibility to my answer.
            – Celada
            Mar 9 '15 at 1:10
















          Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
          – mlissner
          Mar 8 '15 at 17:06




          Hm, yeah, that was my thinking too, but I couldn't find @badroot. Any easy way to find these subvolumes?
          – mlissner
          Mar 8 '15 at 17:06












          Ah, so that was wrong. I added another possibility to my answer.
          – Celada
          Mar 9 '15 at 1:10




          Ah, so that was wrong. I added another possibility to my answer.
          – Celada
          Mar 9 '15 at 1:10


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f188860%2fhow-to-delete-btrfs-subvolume%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

          Morgemoulin

          Scott Moir

          Souastre