[OLUG] RE: cat command

Adam Lassek lunatik at radiks.net
Sun Apr 16 23:25:50 UTC 2000


Here's the original message

Dave Burchell wrote:
> 
> mesc says:
> 
> > lunatik at radiks.net wrote:
> 
> > > Oh cool, I didn't know cat could do binary transfers. I would have done
> > > it this way:
> > > dd if=/dev/hda1 of=/home/mesc/win_img
> 
> That works too.  In fact, it is better, because it tells you at the end
> how much data was transfered.
> 
> > Just to see if i have this straight,my windows partition amounts to 1.3 GB so
> > if I made a  file like DOS in /home/mesc/DOS the DOS file would be 1.3 GB also
> > after cat < /dev/hda1 > /home/mesc/DOS?If so that won't work for me because i
> > have no partions over 1.3 GB.
> 
> You still have a few options.
> 
> 1) Split that 1.3 GB partition into two smaller ones.  Make one (your C:
> drive) the home for your MS Win OS.  Make the other (D:) the place you keep
> your data for use with Windows.  Then back the two up separately.  You
> shouldn't need an "image" of the D: drive.  I consider this a good idea
> for other reasons as well.
> 
> 2) Back up the 1.3 GB partition in parts.  Use "dd" with the options "skip"
> and "count".  Break it up into 2 or more files, each of which can be copied
> off or compressed (e.g., with "gzip") separately.  For your disk you have
> about 2.7 million 512 byte blocks.  Do two files of about 1 million blocks
> each, then a third with the rest, like so:
> 
> dd if=/dev/hda1 of=/home/msec/win_img_1 count=1000000
> dd if=/dev/hda1 of=/home/msec/win_img_2 count=1000000 skip=1000000
> dd if=/dev/hda1 of=/home/msec/win_img_3 skip=2000000
> 
> When the time comes to restore you will need to write the data back out
> to the MS Win partition using "dd" as well using "seek":
> 
> dd if=/home/msec/win_img_1 of=/dev/hda1
> dd if=/home/msec/win_img_2 of=/dev/hda1 seek=1000000
> dd if=/home/msec/win_img_3 of=/dev/hda1 seek=2000000
> 
> 3) Compress the output file on the fly.  Try
>    cat < /dev/hda1 | gzip -c > /home/msec/win_img.gz
> 
> Please note that there may be errors in the above instructions, so
> verify that I have the right syntax before risking your data and ALWAYS
> BACK UP DATA YOU CANNOT REPLACE before doing anything I suggested with
> your disk.
> 
> >                     Thank you,Gary Martin
> 
> > P.S.or do you mean I just need the basic windows files before all my crap is
> > installed on it ? :)
> 
> I'd say back up a system that is working fairly well and has been
> stable for a week or so.  (Tough to find with Microsoft products, I
> know.)
> 
> Keep in mind that the less you ask of Windows the more likely it will
> be to deliver.  Don't get into the habit of adding or removing Windows
> software.  That is what Linux is good at, not Windows.  Windows has no
> package manager, so trying to install, uninstall, and reinstall
> software under Windows is a no win proposition.  Stick with OSes that
> incorporate package managers for your tweeking and experimentation
> whenever possible.
> 
> --
> Dave Burchell                                          40.49'N, 96.41'W
> Free your mind and your software will follow.              402-467-1619
> http://incolor.inetnebr.com/burchell/                  burchell at acm.org
> 
> -------------------------------------------------------------------------
> Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/
> To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net`

-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/ 
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net` 



More information about the OLUG mailing list