Re: muLinux base floppy image and DOS tools

From: Gerhard Thimm (gthimm@zbw.ch)
Date: Mon May 01 2000 - 14:55:25 CEST


Jef Knoors schrieb:
>
> ----- Original Message -----
> From: Miguel Angel <maacruz@navegalia.com>
> To: Mulinux <mulinux@sunsite.auc.dk>
> Sent: Friday, April 28, 2000 4:41 PM
> Subject: Re: muLinux base floppy image and DOS tools
>
> > El Fri, 28 Apr 2000, "Jef Knoors" <jknoors@zonnet.nl> kindly wrote:
> > > I would like to make a raw image of my harddisk (the first 300Mb) is
> that
> > > possible with
> > > "dd if=/dev/hda1 bs=1024k count=300000 of=/tmp/myfile"
> > > or am I mistaken ? (I don't dear to try and lose all information)
> > > Jef
> >
> > Really no problem at all. I used a sort of this to make backups of entire
> > partitions many times and neved had a problem:
> >
> > dd if=/dev/hda1 bs=4096 |gzip >/tmp/myfile.gz
> >
> > Note that bs=4096, that is better targeted at maximun hard disk
> transference
> > speed. You do not need to use "count" since once reached the partition's
> end it
> > will stop the dump anyway.
>
> My partition is 1200 Mb, I only want to back up the first 300 Mb that is
> used. (backup the free space would enlarge the backup file ? or not?) I did
> run defrag on the partition.
> See , the problem is that I work in an office where I do all the computer
> stuff, but my boss is not able to look any further than an desktop icon.
> That means we have to use windows95 no mather how often it will crash.
> Reinstalling means : losing a productive day of work
> Thats why I need the 'rescue file'
>
> >I also piped it to gzip to get a compressed image
> > (less space, less time).
> >
> > Hint! You can increase the compresion ratio a lot cleaning the free space
> > writing a dumb file.
> > Suppose /dev/hda1 is mounted under /mnt
> > If it is a FAT partition:
> > dd if=/dev/zero of=/mnt/dumbfile
> > rm /mnt/dumbfile
> > umount /mnt
> > will work fine
>
> Sorry, I don't understand what will happen, you create an empty file and
> than erase it again ?

No answer since yet, so will I try.
This empty file is a very clever trick to zero all unused blocks on the
partition. to-zero means to erase the old deleted data. WinDos does not
physically erase the data just logically, that means only the
FAT-entries and the directory-entry is handled but all file-content-data
still remain on disk. Because dd makes a physical-dump, it stores all
that "old trash" which is a hard work for gzip to compress. if on the
other hand this zero-dd-trick is used, gzip is able to shrink the
dd-dump really good (instead of 800MB it stores only the info "there are
800'000'000 Zero-Bytes (nearly that way:-))).
I normally clean the whole volume with dd if=/dev/zero of=/dev/hdaX
before I install WinDos and than I dd-dump the installation, which is a
proper rescue image. With the recept above you can do that all the time.
Really really nice.

BTW: Be really careful if you just dump a part of a partition. I never
would do that for a rescue image. There are so many tricks in
WinDos-Software with mirror-files, defect-marked sectors, "lost-sectors"
for copy-protections. I think this is really dangerous. dd the whole
partition. dd works fine in my computers but it is hard to garantee.
And try to rescue also!

Bye, Gerhard

>
> > If it is ext2, since sectors full of 0 are not written to disk, you must
> use
> > any other fixed pattern (yes, for example)
> > yes|dd of=/mnt/dumbfile
> > ...
> >
> > Hope this help
> > --
> > Don't see the world trought a window, be open{source}minded, and be free
> :-)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
> > For additional commands, e-mail: mulinux-help@sunsite.auc.dk
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
> For additional commands, e-mail: mulinux-help@sunsite.auc.dk

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:14 CET