Can I recover a single partition with ddrescue?












0














I have a failed hdd (seagate 1Tb) with bad sector.
I want to make an image of it with ddrescue. The problem is that I don't have a 1tb hdd to put the image on.
The files that I have to rescue are just 90gb. So. Can I shrink the hdd and use ddrescue on one partition so the result image is of 100gb maximum?










share|improve this question



























    0














    I have a failed hdd (seagate 1Tb) with bad sector.
    I want to make an image of it with ddrescue. The problem is that I don't have a 1tb hdd to put the image on.
    The files that I have to rescue are just 90gb. So. Can I shrink the hdd and use ddrescue on one partition so the result image is of 100gb maximum?










    share|improve this question

























      0












      0








      0


      0





      I have a failed hdd (seagate 1Tb) with bad sector.
      I want to make an image of it with ddrescue. The problem is that I don't have a 1tb hdd to put the image on.
      The files that I have to rescue are just 90gb. So. Can I shrink the hdd and use ddrescue on one partition so the result image is of 100gb maximum?










      share|improve this question













      I have a failed hdd (seagate 1Tb) with bad sector.
      I want to make an image of it with ddrescue. The problem is that I don't have a 1tb hdd to put the image on.
      The files that I have to rescue are just 90gb. So. Can I shrink the hdd and use ddrescue on one partition so the result image is of 100gb maximum?







      linux external-hard-drive dd ddrescue






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 5 at 9:23









      Psygno

      61




      61






















          2 Answers
          2






          active

          oldest

          votes


















          0














          Is the drive still actively failing, getting worse, making weird noises, etc?



          If not, and it's still readable (aside from a single bad sector) and mountable, why not just quickly mount it read-only / ro (don't boot from it) and copy the files you want. Or if it's not mountable, use a program like testdisk that might be able to copy only a few files. Or maybe photorec, though it tries to read an entire device but only saves the found files.



          If the drive does sound bad and has errors all over the place, you should really get another backup drive that's big enough to store the image, see Why is it impossible to compress on the fly images by ddrescue? If you want the entire drive, you'll just have to beg/borrow/buy a big enough drive, even just for a few hours. You can compress the image after ddrescue is finished creating it, but watch out for compression that doesn't allow on-the-fly access like gz, xz, etc... squashfs might work.



          Or maybe you're in luck and the single partition you want to backup is small enough for your storage, after all it can't be any larger than the entire drive.






          share|improve this answer





















          • I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
            – Psygno
            Dec 6 at 8:39












          • The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
            – Xen2050
            Dec 6 at 10:37



















          0














          Maybe you can compress the image on-the-fly by piping to gzip or other compression? https://serverfault.com/questions/52260/compressing-dd-backup-on-the-fly



          Something like



          sudo bash -c "dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-11december18.gz"





          share|improve this answer























          • Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
            – bertieb
            Dec 5 at 9:37











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f1380943%2fcan-i-recover-a-single-partition-with-ddrescue%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









          0














          Is the drive still actively failing, getting worse, making weird noises, etc?



          If not, and it's still readable (aside from a single bad sector) and mountable, why not just quickly mount it read-only / ro (don't boot from it) and copy the files you want. Or if it's not mountable, use a program like testdisk that might be able to copy only a few files. Or maybe photorec, though it tries to read an entire device but only saves the found files.



          If the drive does sound bad and has errors all over the place, you should really get another backup drive that's big enough to store the image, see Why is it impossible to compress on the fly images by ddrescue? If you want the entire drive, you'll just have to beg/borrow/buy a big enough drive, even just for a few hours. You can compress the image after ddrescue is finished creating it, but watch out for compression that doesn't allow on-the-fly access like gz, xz, etc... squashfs might work.



          Or maybe you're in luck and the single partition you want to backup is small enough for your storage, after all it can't be any larger than the entire drive.






          share|improve this answer





















          • I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
            – Psygno
            Dec 6 at 8:39












          • The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
            – Xen2050
            Dec 6 at 10:37
















          0














          Is the drive still actively failing, getting worse, making weird noises, etc?



          If not, and it's still readable (aside from a single bad sector) and mountable, why not just quickly mount it read-only / ro (don't boot from it) and copy the files you want. Or if it's not mountable, use a program like testdisk that might be able to copy only a few files. Or maybe photorec, though it tries to read an entire device but only saves the found files.



          If the drive does sound bad and has errors all over the place, you should really get another backup drive that's big enough to store the image, see Why is it impossible to compress on the fly images by ddrescue? If you want the entire drive, you'll just have to beg/borrow/buy a big enough drive, even just for a few hours. You can compress the image after ddrescue is finished creating it, but watch out for compression that doesn't allow on-the-fly access like gz, xz, etc... squashfs might work.



          Or maybe you're in luck and the single partition you want to backup is small enough for your storage, after all it can't be any larger than the entire drive.






          share|improve this answer





















          • I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
            – Psygno
            Dec 6 at 8:39












          • The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
            – Xen2050
            Dec 6 at 10:37














          0












          0








          0






          Is the drive still actively failing, getting worse, making weird noises, etc?



          If not, and it's still readable (aside from a single bad sector) and mountable, why not just quickly mount it read-only / ro (don't boot from it) and copy the files you want. Or if it's not mountable, use a program like testdisk that might be able to copy only a few files. Or maybe photorec, though it tries to read an entire device but only saves the found files.



          If the drive does sound bad and has errors all over the place, you should really get another backup drive that's big enough to store the image, see Why is it impossible to compress on the fly images by ddrescue? If you want the entire drive, you'll just have to beg/borrow/buy a big enough drive, even just for a few hours. You can compress the image after ddrescue is finished creating it, but watch out for compression that doesn't allow on-the-fly access like gz, xz, etc... squashfs might work.



          Or maybe you're in luck and the single partition you want to backup is small enough for your storage, after all it can't be any larger than the entire drive.






          share|improve this answer












          Is the drive still actively failing, getting worse, making weird noises, etc?



          If not, and it's still readable (aside from a single bad sector) and mountable, why not just quickly mount it read-only / ro (don't boot from it) and copy the files you want. Or if it's not mountable, use a program like testdisk that might be able to copy only a few files. Or maybe photorec, though it tries to read an entire device but only saves the found files.



          If the drive does sound bad and has errors all over the place, you should really get another backup drive that's big enough to store the image, see Why is it impossible to compress on the fly images by ddrescue? If you want the entire drive, you'll just have to beg/borrow/buy a big enough drive, even just for a few hours. You can compress the image after ddrescue is finished creating it, but watch out for compression that doesn't allow on-the-fly access like gz, xz, etc... squashfs might work.



          Or maybe you're in luck and the single partition you want to backup is small enough for your storage, after all it can't be any larger than the entire drive.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 5 at 12:25









          Xen2050

          9,95431536




          9,95431536












          • I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
            – Psygno
            Dec 6 at 8:39












          • The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
            – Xen2050
            Dec 6 at 10:37


















          • I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
            – Psygno
            Dec 6 at 8:39












          • The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
            – Xen2050
            Dec 6 at 10:37
















          I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
          – Psygno
          Dec 6 at 8:39






          I tried and it worked (copy on read only) but some of my pics are broken I just thought that ddrescue could at least save some of them. One time it did it. One last thing: you talk about partition, so you think I could make a partition and do a ddrescue that output an image that is big as the partition and not as the entire disk? Maybe I didn't understand (the failed drive was almost full before the failing but I menage do delete many useless thing because I thought that ddrescue didn't look for them)
          – Psygno
          Dec 6 at 8:39














          The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
          – Xen2050
          Dec 6 at 10:37




          The partitions are a fixed size, resizing or moving one usually needs a lot of reads & writes, you don't want to do that before copying all your data, if the drive is failing. gnome-disk-utility or gparted or fdisk -l show partition sizes nicely, they're they the 1, 2, 3... devices in /dev/sda1, /dev/sda2 while the entire drive is just /dev/sda. If you only want data from /dev/sda2 you could ignore the other partitions. ddrescue just reads every sector or a device (drive or partition), free space and files alike. Photorec only tries to read data... but if the files are corrupted...
          – Xen2050
          Dec 6 at 10:37













          0














          Maybe you can compress the image on-the-fly by piping to gzip or other compression? https://serverfault.com/questions/52260/compressing-dd-backup-on-the-fly



          Something like



          sudo bash -c "dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-11december18.gz"





          share|improve this answer























          • Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
            – bertieb
            Dec 5 at 9:37
















          0














          Maybe you can compress the image on-the-fly by piping to gzip or other compression? https://serverfault.com/questions/52260/compressing-dd-backup-on-the-fly



          Something like



          sudo bash -c "dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-11december18.gz"





          share|improve this answer























          • Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
            – bertieb
            Dec 5 at 9:37














          0












          0








          0






          Maybe you can compress the image on-the-fly by piping to gzip or other compression? https://serverfault.com/questions/52260/compressing-dd-backup-on-the-fly



          Something like



          sudo bash -c "dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-11december18.gz"





          share|improve this answer














          Maybe you can compress the image on-the-fly by piping to gzip or other compression? https://serverfault.com/questions/52260/compressing-dd-backup-on-the-fly



          Something like



          sudo bash -c "dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-11december18.gz"






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 11 at 9:14

























          answered Dec 5 at 9:32









          manscher

          12




          12












          • Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
            – bertieb
            Dec 5 at 9:37


















          • Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
            – bertieb
            Dec 5 at 9:37
















          Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
          – bertieb
          Dec 5 at 9:37




          Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
          – bertieb
          Dec 5 at 9:37


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1380943%2fcan-i-recover-a-single-partition-with-ddrescue%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

          Plaza Victoria

          Puebla de Zaragoza

          Musa