Assumption 1: I cannot back up an entire partition to a DVD unless that partition is smaller than the available DVD space.
Yes, your (compressed, if you like) backup must fit in the available space. No surprises there, you can't fight against the math.
Assumption 2: I cannot use
dd to create a bootable version of a partition to a DVD or USB.
Not quite true: you can't create a bootable DVD with
dd or other byte-level tools because optical disks have a different layout from hard disks and flash disks. You can use
dd to clone a hard disk partition onto a USB stick; your only limitation is that the partition must fit on the stick, but see also Cloning a bootable USB stick to a different-size stick.
Assumption 3: I can use
dd to create a bootable partition on a second disk drive.
Yes. You can use
cat, too, since the magic is not in
dd but in the device file
/dev/sda or the like; see dd vs cat -- is dd still relevant these days?. Browse the cloning tag on this site for examples.
Assumption 4: If I wanted to back up a live system, is the best way to boot from a live cd or second partition?
You can back up a system from itself too, that's what most people do. But fully backing up a live system has some limitations:
- The backup will be that of a live system, not of a properly shut down system. It will be indistinguishable from having backed up a system that just crashed.
- The backup may be inconsistent, i.e. it may show a state of the system that never existed. That happens when an application always modifies file A then file B, but the backup process backed up file A just before the application touched both files and file B later, after the application has modified it, so that the back up contains the old A and the new B whereas this never happens on the live system. Whether that matters depends on the applications you run on your system. It is vital for databases, and in fact databases are not normally backed up by copying files but by dumping them (i.e. building a sequence of commands that would recreate the database). Most other applications can cope.
If you back up a live system naively, you must back up at the file level, not at the volume level. At the partition level, the chance of getting an inconsistent, unrecoverable backup is very high.
You can make a consistent volume-level backup by taking a snapshot of the volume. LVM is a typical way of making volume snapshots (the volume must be an LVM logical volume, not a partition).
Question 1: If I use
dd to copy
sda has 1TB of disk space and
sdb has 2TB
Then half the space on
sdb will be wasted. It would be easier to back up only the partition(s) on
sda. Alternatively, back up
sda as a whole, then edit the partition table on
sdb to add one or more partitions occupying the second TB.
Question 2: If a partition will fit on DVD and I write to it by using
dd if=/dev/sda1 of=/dev/dvd
Note that this command is equivalent to
cat /dev/sda1 >/dev/dvd. It won't work so easily, because writing to optical disks is not straightforward: they are not random-access devices like hard disks and flash disks, you need to write them all at once (or at least large chunks at once) at a controlled speed.
You can use software such as CDRecord, Cdrkit/wodim or DVD+RW-tools/Growisofs to burn either a straight volume image (containing the usual filesystem, e.g. ext4) or an ISO 9660 filesystem, which is the filesystem typically found on CDs and many DVDs. With the Rock Ridge extension, which is supported by almost every Unix system, you can put the usual Unix metadata (hard links, symbolic links, permissions, case-sensitive names, …) on an ISO 9660 filesystem.
Alternatively, you can use packet writing and treat the DVD like any other volume, if your system supports it.
- If you want a straight copy of your system, use a volume management system that permits snapshotting, such as LVM (where you create snapshots of logical volumes) or any RAID-1 system (add a component to the array, synch, remove a component from the array).
- For everyday use, make incremental file backups (i.e. back up only the files that have changed, or even only the parts of files that have changed).
- Asking about
dd is the wrong question at this stage (and not just because the answer is that
dd doesn't matter). First, you need to get a clear idea of what you want to back up, where and when. Learn to separate policy from implementation. Once you know what you need to achieve, study what tools would best reach your objectives.