Wednesday, April 30, 2014

cp, dd, dump, rsync -- diff

I want to back-up some items, and have 3 requirements, plus 3 hopefuls.

1.) Back-up to an ISO, eg to "20141231_bak.iso"
2.) Able to exclude some directories from the process.
3.) Fast
4.) If possible, backup an unmounted partition to avoid any "live acquisition" write errors
5.) If possible, update the ISO with file changes.
6.) If possible, prior to, or following backup, an app which locates duplicate files.

cp solution

For a mounted partition, cp is a reasonable option. We can take an entire data directory, say /home/foo, and safely back it up to an external HDD with a date. We would have to cycle the dumps, since there will be no indexes of changed files.
$ cp -a /home/foo/. /dev/hdb/20140430
Problem: again, slow. Doesn't write to a file, eg to an ISO. Doesn't allow excluded directories. Only works on mounted drives.

dd solution

We prefer backing-up an unmounted partition since there's no chance of new data being written during the backup -- dd fits this bill. Also it's fast. Thirdly, it does exactly what we want for our format: writes from a device to a file
$ dd if=/dev/hda2/ of=/home/foo/20141231_bak.iso
Problem: No directory exclusion since dd backs-up the entire partition. A second problem with duplicating the entire partition is the image includes all free space on the partition, requiring equivalent backup space to the partition. Solution: possibly use "conv=sparse" option to exclude blank space. This means, prior to backups, using something like zerofree to rapidly zero unallocated areas on the partion.

rsync solution

Rsync is not so fast the first time it's run, but subsequent incremental back-ups can be fast, and delta transfer (-W flag) may increase speed even on a USB (as opposed to network) backup. Problem: It's live acquisition; disk must be mounted. It doesn't natively write to a file.

Tuesday, April 8, 2014

Is an ellipse really a conic?

I don't think so. Consider that an ellipse is supposed to have equal eccentricity on each end -- it's not supposed to be shaped like a cross section of an egg.

But now consider that a cone has a varying radius from it's base to its vertex. At the vertex of a cone, the peak of the cone, the radius is zero, at its base, the radius of the cone is however large you want to make it.

The ellipse is (supposedly) the result of cutting the cone at a SLANT. This means the radius of the cone is different at one end of the ellipse than the other. This means that the only way to have a true ellipse is to have a section of a cylinder, not of a cone. Nevertheless, they persist in calling it a "conic". Is there something I overlooked?