Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #178520
| From | "Thomas Schmitt" <scdbackup@gmx.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Some help with dd backing up into an iso |
| Date | 2017-03-07 09:00 +0100 |
| Message-ID | <tiici-4lr-27@gated-at.bofh.it> (permalink) |
| References | <tigk9-2R6-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
GiaThnYgeia wrote:
> > I used dd if=/dev/sdb of=usbfilename.iso
> > The resulting image was the full size of the disk.
That's the job of dd: Copying block by block.
As David stated, the file usbfilename.iso will not be an ISO 9660 filesystem
but rather a disk image.
David Christensen wrote:
> dd if=/dev/sda | gzip > myimage.img
The name suffix .img is more appropriate than .iso, indeed.
If your USB stick contains a lot of blocks with zeros, you may get even
better compression by using bzip2 instead of gzip:
dd if=/dev/sdb | bzip2 >usbfilename.img
Zeroing the unused blocks before running dd will normally improve the
compression ratio and thus yield an even smaller .img file.
When you put it back on the USB stick, you need to uncompress:
bunzip2 <usbfilename.img | dd of=/dev/sdb
This will recreate your two partitions and the filesystems which reside in
them.
> To test the validity I restored reversing the order of the filenames
> if/of but that took for ever
By default dd copies chunks of 512 bytes.
Changing to 1 MiB chunks by dd option
bs=1M
might speed up copying substantially.
> I looked at the disk and
> it seemed complete with all files in tact, so maybe I killed it
> somewhere in the verification process.
There is no verification process with plain dd.
Probably you successfully copied the first partition and the directory
tree of the second one. It has to be expected that not all files in the
second partition bear their original content, because it was not copied.
> Is there someway one can avoid creating such a large iso for no reason,
> when the filesize is a fraction of the whole disk.
That's called backup and archiving.
While the filesystem is mounted but fewly busy, you let a program read
the files and pack them up in that program's archive format.
The classic archiver is called "tar". Caution: wrong arguments or wrong
sequence of arguments can easily shoot your foot.
Assumed you have your filesystems mounted as
/mnt/usb_part1
/mnt/usb_part2
you may pack them up gzip compressed by
tar cvzf usb_part1.tar.gz /mnt/usb_part1
tar cvzf usb_part2.tar.gz /mnt/usb_part2
The archive files usb_part1.tar.gz and usb_part2.tar.gz can be unpacked into
some directory by:
cd /some/directory/for/part1
tar xzf /where/it/is/usb_part1.tar.gz
cd /some/directory/for/part2
tar xzf /where/it/is/usb_part2.tar.gz
If the archive shall be an ISO 9660 filesystem, you may create it by
xorriso -for_backup \
-outdev usb_part1_and_2.iso \
-map /mnt/usb_part1 /part1 \
-map /mnt/usb_part2 /part2 \
The superuser will be able to mount the result for random access:
mkdir /mnt/usb_par1_and_2
mount -o loop /where/it/is/usb_part1_and2.iso /mnt/usb_par1_and_2
The normal user will then see and be able to read two file trees
/mnt/usb_par1_and_2/part1
/mnt/usb_par1_and_2/part2
To unmount the .iso, the superuser later does:
umount /mnt/usb_par1_and_2
Have a nice day :)
Thomas
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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