How to resolve btrfs errors? copying from btrfs to another partition?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















I had a working system that was running out of space. So I added space to the end of the disk.



Boot from gparted ISO



  1. launched gparted moved partition 3 of 3 to the right. Went to resize partition 2 of 3 to claim unused space.


  2. Error: About 100 files have csum errors.


  3. btrfs check --repair /dev/sda2


  4. Errors persist


  5. Ok so clean out the crc --init-csum-tree


  6. Errors persist, and can't extend partition


Question how should I have resolved this?



So I added a hard drive, made a new partition, and used cp -r -p /source/* /destination/
(the actually name of the mounted folder doesn't matter)



Since repairing the original partition failed, and I thought I had backed everything up I formatted the source partition.



Now after the partition repaired, put data back.



cp -r -p /destination/* /source



Had to resolve some grub errors and the UUID in fstab.



So it boot, but with errors complaining about /usr/local and several other locations.



Research shows that these locations are subvolumes.



Most of them were relatively harmless, as in I can just re-install them. However, var had some mysql databases in it.



Is my data gone? Why didn't cp copy it? Most importantly how do I copy all files to another partition so I can format(file system damaged beyond --repair) the original, and copy the files back without losing data due to subvolumes or etc?










share|improve this question


























    0















    I had a working system that was running out of space. So I added space to the end of the disk.



    Boot from gparted ISO



    1. launched gparted moved partition 3 of 3 to the right. Went to resize partition 2 of 3 to claim unused space.


    2. Error: About 100 files have csum errors.


    3. btrfs check --repair /dev/sda2


    4. Errors persist


    5. Ok so clean out the crc --init-csum-tree


    6. Errors persist, and can't extend partition


    Question how should I have resolved this?



    So I added a hard drive, made a new partition, and used cp -r -p /source/* /destination/
    (the actually name of the mounted folder doesn't matter)



    Since repairing the original partition failed, and I thought I had backed everything up I formatted the source partition.



    Now after the partition repaired, put data back.



    cp -r -p /destination/* /source



    Had to resolve some grub errors and the UUID in fstab.



    So it boot, but with errors complaining about /usr/local and several other locations.



    Research shows that these locations are subvolumes.



    Most of them were relatively harmless, as in I can just re-install them. However, var had some mysql databases in it.



    Is my data gone? Why didn't cp copy it? Most importantly how do I copy all files to another partition so I can format(file system damaged beyond --repair) the original, and copy the files back without losing data due to subvolumes or etc?










    share|improve this question
























      0












      0








      0








      I had a working system that was running out of space. So I added space to the end of the disk.



      Boot from gparted ISO



      1. launched gparted moved partition 3 of 3 to the right. Went to resize partition 2 of 3 to claim unused space.


      2. Error: About 100 files have csum errors.


      3. btrfs check --repair /dev/sda2


      4. Errors persist


      5. Ok so clean out the crc --init-csum-tree


      6. Errors persist, and can't extend partition


      Question how should I have resolved this?



      So I added a hard drive, made a new partition, and used cp -r -p /source/* /destination/
      (the actually name of the mounted folder doesn't matter)



      Since repairing the original partition failed, and I thought I had backed everything up I formatted the source partition.



      Now after the partition repaired, put data back.



      cp -r -p /destination/* /source



      Had to resolve some grub errors and the UUID in fstab.



      So it boot, but with errors complaining about /usr/local and several other locations.



      Research shows that these locations are subvolumes.



      Most of them were relatively harmless, as in I can just re-install them. However, var had some mysql databases in it.



      Is my data gone? Why didn't cp copy it? Most importantly how do I copy all files to another partition so I can format(file system damaged beyond --repair) the original, and copy the files back without losing data due to subvolumes or etc?










      share|improve this question














      I had a working system that was running out of space. So I added space to the end of the disk.



      Boot from gparted ISO



      1. launched gparted moved partition 3 of 3 to the right. Went to resize partition 2 of 3 to claim unused space.


      2. Error: About 100 files have csum errors.


      3. btrfs check --repair /dev/sda2


      4. Errors persist


      5. Ok so clean out the crc --init-csum-tree


      6. Errors persist, and can't extend partition


      Question how should I have resolved this?



      So I added a hard drive, made a new partition, and used cp -r -p /source/* /destination/
      (the actually name of the mounted folder doesn't matter)



      Since repairing the original partition failed, and I thought I had backed everything up I formatted the source partition.



      Now after the partition repaired, put data back.



      cp -r -p /destination/* /source



      Had to resolve some grub errors and the UUID in fstab.



      So it boot, but with errors complaining about /usr/local and several other locations.



      Research shows that these locations are subvolumes.



      Most of them were relatively harmless, as in I can just re-install them. However, var had some mysql databases in it.



      Is my data gone? Why didn't cp copy it? Most importantly how do I copy all files to another partition so I can format(file system damaged beyond --repair) the original, and copy the files back without losing data due to subvolumes or etc?







      opensuse file-copy btrfs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 25 at 19:13









      cybernardcybernard

      1356




      1356




















          1 Answer
          1






          active

          oldest

          votes


















          0














          My heart stopped the moment you moved a partition.



          Such disk operations are DANGEROUS. Particularly if you don't have a validated backup.



          The checksum errors is BTRFS's way of telling you that your files are corrupted. Attempting to convince BTRFS that the files are OK is probably not what you want.



          cp does not copy subvolumes. Instead it copies them as directories. I don't know how you backed everything up, but it sounds like it did not backup your subvolumes. I recommend using btrfs-send and btrfs-receive to make backups.



          As for your databases, given you formatted the source partition, I'd consider them gone, unfortunately.



          TIP. If you're going to use BTRFS, reading the BTRFS wiki is a must. It's no ordinary filesystem. You must become intimate with it's functionality in order to use it effectively: https://btrfs.wiki.kernel.org/






          share|improve this answer























          • I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

            – cybernard
            Feb 25 at 22:58











          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%2f502973%2fhow-to-resolve-btrfs-errors-copying-from-btrfs-to-another-partition%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









          0














          My heart stopped the moment you moved a partition.



          Such disk operations are DANGEROUS. Particularly if you don't have a validated backup.



          The checksum errors is BTRFS's way of telling you that your files are corrupted. Attempting to convince BTRFS that the files are OK is probably not what you want.



          cp does not copy subvolumes. Instead it copies them as directories. I don't know how you backed everything up, but it sounds like it did not backup your subvolumes. I recommend using btrfs-send and btrfs-receive to make backups.



          As for your databases, given you formatted the source partition, I'd consider them gone, unfortunately.



          TIP. If you're going to use BTRFS, reading the BTRFS wiki is a must. It's no ordinary filesystem. You must become intimate with it's functionality in order to use it effectively: https://btrfs.wiki.kernel.org/






          share|improve this answer























          • I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

            – cybernard
            Feb 25 at 22:58
















          0














          My heart stopped the moment you moved a partition.



          Such disk operations are DANGEROUS. Particularly if you don't have a validated backup.



          The checksum errors is BTRFS's way of telling you that your files are corrupted. Attempting to convince BTRFS that the files are OK is probably not what you want.



          cp does not copy subvolumes. Instead it copies them as directories. I don't know how you backed everything up, but it sounds like it did not backup your subvolumes. I recommend using btrfs-send and btrfs-receive to make backups.



          As for your databases, given you formatted the source partition, I'd consider them gone, unfortunately.



          TIP. If you're going to use BTRFS, reading the BTRFS wiki is a must. It's no ordinary filesystem. You must become intimate with it's functionality in order to use it effectively: https://btrfs.wiki.kernel.org/






          share|improve this answer























          • I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

            – cybernard
            Feb 25 at 22:58














          0












          0








          0







          My heart stopped the moment you moved a partition.



          Such disk operations are DANGEROUS. Particularly if you don't have a validated backup.



          The checksum errors is BTRFS's way of telling you that your files are corrupted. Attempting to convince BTRFS that the files are OK is probably not what you want.



          cp does not copy subvolumes. Instead it copies them as directories. I don't know how you backed everything up, but it sounds like it did not backup your subvolumes. I recommend using btrfs-send and btrfs-receive to make backups.



          As for your databases, given you formatted the source partition, I'd consider them gone, unfortunately.



          TIP. If you're going to use BTRFS, reading the BTRFS wiki is a must. It's no ordinary filesystem. You must become intimate with it's functionality in order to use it effectively: https://btrfs.wiki.kernel.org/






          share|improve this answer













          My heart stopped the moment you moved a partition.



          Such disk operations are DANGEROUS. Particularly if you don't have a validated backup.



          The checksum errors is BTRFS's way of telling you that your files are corrupted. Attempting to convince BTRFS that the files are OK is probably not what you want.



          cp does not copy subvolumes. Instead it copies them as directories. I don't know how you backed everything up, but it sounds like it did not backup your subvolumes. I recommend using btrfs-send and btrfs-receive to make backups.



          As for your databases, given you formatted the source partition, I'd consider them gone, unfortunately.



          TIP. If you're going to use BTRFS, reading the BTRFS wiki is a must. It's no ordinary filesystem. You must become intimate with it's functionality in order to use it effectively: https://btrfs.wiki.kernel.org/







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 25 at 22:50









          Emmanuel RosaEmmanuel Rosa

          3,3301612




          3,3301612












          • I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

            – cybernard
            Feb 25 at 22:58


















          • I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

            – cybernard
            Feb 25 at 22:58

















          I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

          – cybernard
          Feb 25 at 22:58






          I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to.

          – cybernard
          Feb 25 at 22:58


















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502973%2fhow-to-resolve-btrfs-errors-copying-from-btrfs-to-another-partition%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 to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay