Take an image of a device, creating a log file

ddrescue

  • Data recovery tool that reads data from damaged block devices.
    More information: <https://www.gnu.org/software/ddrescue/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

sudo ddrescue {{/dev/sdb}} {{path/to/image.dd}} {{path/to/log.txt}}

click the source code to copy install ddrescue on any operating system with command-not-found.com