Just moozing

Before you can check your notes, you must make them…

USB stick backup

leave a comment »

A student of mine made a Windows 7 install USB stick. It requires a running windows 7, and I have no intention of redoing it – so I back up the stick for later use 🙂

As mentioned in this blog, I back up sticks using dd and gzip.


dd if=/dev/sdc1 bs=4M | gzip -c > Win7_InstallUsb.img.gz

You can test by dd’ing the other way. It is an 8 GB USB stick with 3.1 GB in use and the zipped image file is 7.1 GB! I found that to be too big for my taste.

In order to reduce the size, the trick is to zero fill the available part of the disk, and delete the file afterwards.


cd /media/WinUSB
dd if=/dev/zero of=ALotOfZeroes.txt BS=4M
rm ALotOfZeroes.txt
sync

Redo the dd and gzip


dd if=/dev/sdc1 bs=4M | gzip -c > Win7_InstallUsb2.img.gz

and comparing the result.


$ ls -lh
total 9.9G
-rw-r--r-- 1 moz moz 2.9G Oct 29 21:32 Win7_InstallUsb_2.img.gz
-rw-r--r-- 1 moz moz 7.1G Oct 29 21:11 Win7_InstallUsb.img.gz

We just saved 4.2 GB of backup space. I suspect the compressed image size is the same should we choose to use a 16 GB stick.

Advertisements

Written by moozing

October 30, 2012 at 09:00

Posted in Tech

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: