skip navigation

Valid XHTML 1.0!

Valid CSS!

This page is standards compliant and Section 508 accessible

End of navigation

Unix/Linux Software Tips and Tricks

How to backup and restore across a network
How to recover data from damaged discs
Printing 2-up the right way

How to backup up and restore a raw hard disk across a network (for GNU/Linux)

If you don't have enough space to store a backup on the local machine, here's a handy tip for creating a low-level backup of a hard disk across a network. For the example, you have a machine whose root hard disk partition /dev/hda1 needs a backup. The computer to be backed up will be booted with Mulinux or Knoppix and the network address set to 192.168.1.1. The computer to hold the backup will be at 192.168.1.2.

mulinux (floppy-boot GNU/Linux):
Get and install mulinux using the directions on the site (both the WWW site and the FTP), create the root and boot mulinux disks, and the SRV add-on disk.

Knoppix (CD-boot GNU/Linux):
Get an ISO image from Knoppix.org. Burn the ISO image to a CD. Power off your computer. Change the BIOS settings to boot from CD. Boot from CD.

Backup procedure:

  1. Boot laptop using mulinux or Knoppix
  2. Get ethernet connection working (ifconfig, route)
  3. On computer to hold the backup:
    $ nc -lp 6666 | bzip2 | dd of=partition.bz2
  4. On computer to back up:
    $ dd if=/dev/hda1 | nc 192.168.1.2 6666
  5. When finished, press Ctrl-C on laptop and desktop

To restore across a network:

  1. Repeat steps 1 and 2 from backup instructions
  2. On machine that needs to be restored to:
    $ nc -lp 6666 | dd of=/dev/hda1
  3. On machine that has the backup image:
    $ cat partition.bz2 | bzip2 -d | nc 192.168.1.1 6666

How to recover data from damaged discs

The ddrescue utility is like the dd utility except that it works well even when reading from a damaged source. See here for a more detailed description, and for a rundown on the confusing difference between the "dd_rescue" program and the "ddrescue" program (hint: use GNU ddrescue).

Printing 2-up the Right Way

Most 2-up printing utilities simply take the pages exactly as they are, and try to fit them two to a page. This looks terrible, because the margins for a 1-up page are much larger as a fraction of the page than needed for a 2-up page. The only utility I have seen that readjusts the margins is the impose+ package (requires Perl). See the page for an example of the difference between their 2-up pages and normal 2-up pages produced by "psnup -2" (and every other 2-up utility I have tried).