Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #178518

Re: Some help with dd backing up into an iso

From David Christensen <dpchrist@holgerdanske.com>
Newsgroups linux.debian.user
Subject Re: Some help with dd backing up into an iso
Date 2017-03-07 06:10 +0100
Message-ID <tifxL-2pD-1@gated-at.bofh.it> (permalink)
References <tib17-7Ap-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 03/06/2017 04:11 PM, GiaThnYgeia wrote:
> I am not very confident I am doing this right and it seems wrong,  I
> can't locate any documentation that results into proper options.
> I tried backing up an 8gb USB that has 2 partitions in it, one had 1.7gb
> of data on it.
> I used dd if=/dev/sdb of=usbfilename.iso
> The resulting image was the full size of the disk.
> To test the validity I restored reversing the order of the filenames
> if/of  but that took for ever and it was a hog on resources.  After a
> while I just gave up and killed the process.  I looked at the disk and
> it seemed complete with all files in tact, so maybe I killed it
> somewhere in the verification process.
> So I used a program called etcher which I have used with 100% success in
> the past and was surprisingly fast in burning images.
> It took for ever as well, eventually it run a verification routine and
> it was done.
> Is there someway one can avoid creating such a large iso for no reason,
> when the filesize is a fraction of the whole disk.  One way I thought of
> was to shrink the partitions to just about 99% full, and leave the blank
> part of the disk as not allocated.  Would that help?
> Is there some fancy command line that does just that?

Copying a raw device to a file, or vice-versa, I call "imaging".


ISO implies binary data structures ("format") on optical media so as to 
create a file system containing files and directories.


AFAIK USB flash drives use the same formats as hard disk drives and 
solid-state drives ("master boot record" (MBR) partition table, 
partition(s), and file system(s) within those partition(s)).


ISO and HDD/SSD formats are fundamentally different.  Taking an image of 
a USB flash drive and naming the output file with an *.iso extension 
will not translate the format to ISO.  Achieving that result requires 
tools other than 'dd'.


As for reducing the size of image files, the standard trick is to zero 
out the unused blocks first, and then compress the binary data stream 
while you take the image:

     # dd if=/dev/sda | gzip > myimage.img


For Linux and ext2, ext3, and ext4 file systems, the tool for zeroing 
unused blocks is zerofree(8):

https://manpages.debian.org/jessie/zerofree/zerofree.8.en.html


If you have an SSD, fstrim(8) will discard all unused blocks, regardless 
of file system.  They should then read as zeros:

https://manpages.debian.org/jessie/util-linux/fstrim.8.en.html


But, most USB flash drives come factory formatted with FAT32.  The 
'sdelete' Windows utility can be used to zero unused blocks for both 
NTFS and FAT file systems:

https://technet.microsoft.com/en-us/sysinternals/sdelete.aspx


David

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Some help with dd backing up into an iso GiaThnYgeia <GiaThnYgeia@openmailbox.org> - 2017-03-07 01:20 +0100
  Re: Some help with dd backing up into an iso Michael Lange <klappnase@freenet.de> - 2017-03-07 02:10 +0100
  Re: Some help with dd backing up into an iso David Christensen <dpchrist@holgerdanske.com> - 2017-03-07 06:10 +0100
    Re: Some help with dd backing up into an iso David Christensen <dpchrist@holgerdanske.com> - 2017-03-07 07:00 +0100
      Re: Some help with dd backing up into an iso "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-07 09:00 +0100
        Re: Some help with dd backing up into an iso GiaThnYgeia <GiaThnYgeia@openmailbox.org> - 2017-03-07 18:30 +0100
          Re: Some help with dd backing up into an iso "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-07 20:20 +0100
            Re: Some help with dd backing up into an iso GiaThnYgeia <GiaThnYgeia@openmailbox.org> - 2017-03-08 05:00 +0100
              Re: Some help with dd backing up into an iso David Christensen <dpchrist@holgerdanske.com> - 2017-03-08 07:00 +0100
              Re: Some help with dd backing up into an iso "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-08 12:10 +0100
                MBR partitioning, and content after partition table but before first  partition David Christensen <dpchrist@holgerdanske.com> - 2017-03-09 06:50 +0100
                Re: MBR partitioning, and content after partition table but before  first partition Felix Miata <mrmazda@earthlink.net> - 2017-03-09 08:00 +0100
                Re: MBR partitioning, and content after partition table but before  first partition David Christensen <dpchrist@holgerdanske.com> - 2017-03-10 06:10 +0100
                Re: MBR partitioning, and content after partition table but before  first partition Jonathan Dowland <jmtd@debian.org> - 2017-03-10 10:00 +0100
                Re: MBR partitioning, and content after partition table but before  first partition David Christensen <dpchrist@holgerdanske.com> - 2017-03-11 07:10 +0100
                Re: MBR partitioning, and content after partition table but before  first partition Jonathan Dowland <jmtd@debian.org> - 2017-03-13 10:10 +0100
                Re: MBR partitioning, and content after partition table but before  first partition David Christensen <dpchrist@holgerdanske.com> - 2017-03-14 04:40 +0100
                Re: MBR partitioning, and content after partition table but before  first partition David <bouncingcats@gmail.com> - 2017-03-14 11:40 +0100
                Re: MBR partitioning, and content after partition table but before  first partition David Christensen <dpchrist@holgerdanske.com> - 2017-03-15 03:50 +0100
                Re: MBR partitioning, and content after partition table but before  first partition The Wanderer <wanderer@fastmail.fm> - 2017-03-14 13:00 +0100
                Re: MBR partitioning, and content after partition table but before  first partition David Christensen <dpchrist@holgerdanske.com> - 2017-03-15 04:10 +0100
                Re: MBR partitioning, and content after partition table but before  first partition Andy Smith <andy@strugglers.net> - 2017-03-15 04:40 +0100
                Re: MBR partitioning, and content after partition table but before  first partition Jonathan Dowland <jmtd@debian.org> - 2017-03-15 13:00 +0100
                Re: MBR partitioning, and content after partition table but before first partition "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-09 08:30 +0100
                Re: MBR partitioning, and content after partition table but before  first partition Jonathan Dowland <jmtd@debian.org> - 2017-03-09 15:40 +0100
    Re: Some help with dd backing up into an iso Teemu Likonen <tlikonen@iki.fi> - 2017-03-07 09:30 +0100
      Re: Some help with dd backing up into an iso <tomas@tuxteam.de> - 2017-03-07 09:40 +0100
        Re: Some help with dd backing up into an iso Teemu Likonen <tlikonen@iki.fi> - 2017-03-07 10:00 +0100
          Re: Some help with dd backing up into an iso <tomas@tuxteam.de> - 2017-03-07 10:10 +0100
          Re: Some help with dd backing up into an iso David Wright <deblis@lionunicorn.co.uk> - 2017-03-07 16:20 +0100
      Re: Some help with dd backing up into an iso Jonathan Dowland <jmtd@debian.org> - 2017-03-07 11:10 +0100
      Re: Some help with dd backing up into an iso David Christensen <dpchrist@holgerdanske.com> - 2017-03-08 06:00 +0100
  Re: Some help with dd backing up into an iso Mark Fletcher <mark27q1@gmail.com> - 2017-03-07 12:10 +0100
  Re: Some help with dd backing up into an iso Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> - 2017-03-07 14:50 +0100
  Re: Some help with dd backing up into an iso Elimar Riesebieter <riesebie@lxtec.de> - 2017-03-07 15:20 +0100
  Re: Some help with dd backing up into an iso David Wright <deblis@lionunicorn.co.uk> - 2017-03-07 16:20 +0100
    Re: Some help with dd backing up into an iso "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-07 18:10 +0100
      Re: Some help with dd backing up into an iso David Wright <deblis@lionunicorn.co.uk> - 2017-03-07 19:00 +0100
        Re: Some help with dd backing up into an iso "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-07 20:30 +0100
          Re: Some help with dd backing up into an iso David Wright <deblis@lionunicorn.co.uk> - 2017-03-07 21:30 +0100
            Re: Some help with dd backing up into an iso "Thomas Schmitt" <scdbackup@gmx.net> - 2017-03-07 22:10 +0100
              Re: Some help with dd backing up into an iso GiaThnYgeia <GiaThnYgeia@openmailbox.org> - 2017-03-08 18:30 +0100
                Re: Some help with dd backing up into an iso David Wright <deblis@lionunicorn.co.uk> - 2017-03-08 19:20 +0100

csiph-web