I do not have a reliable and speedy backup device for my system (tape drive, CD/RW, etc) but I have plenty of space on my disk drives to maintain a bootable backup copy of my complete Linux system. From time to time, after major installs for example, I execute this procedure to backup my system to the alternate hard drive, thus providing some protection against head crashes and software installation failure.
I have a dual-boot Win95/eDesktop2.4 system with partitioning as shown below (Win95 on hda, production Linux on hdb). I still use a seperate /boot partition, but current grub/lilo makes that less critical. Your setup will vary, but its a good idea to keep a printed copy of your partitioning layout around. I produced these with (and then added comments):
fdisk /dev/hda > hda.outfdisk /dev/hdb > hdb.out
Disk /dev/hda: 255 heads, 63 sectors, 1868 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System DOS C:/Win95
/dev/hda1 * 1 261 2096451 6 FAT16
/dev/hda2 262 1867 12900195 f Win95 Ext'd (LBA)
/dev/hda5 262 522 2096451 6 FAT16 DOS D:/Win95
/dev/hda6 523 542 160618+ 83 Linux SPARE /boot
/dev/hda7 543 562 160618+ 83 Linux /boot EMERGENCY
/dev/hda8 563 690 1028128+ 82 Linux swap
/dev/hda9 691 1190 4016218+ 83 Linux / EMERGENCY
/dev/hda10 1191 1528 2714953+ 83 Linux SPARE
/dev/hda11 1529 1867 2722986 83 Linux SPARE
Disk /dev/hdb: 255 heads, 63 sectors, 1662 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 124 995998+ 83 Linux /boot SPARE
/dev/hdb2 125 1662 12353985 f Win95 Ext'd (LBA)
/dev/hdb5 125 144 160618+ 83 Linux /boot ACTIVE
/dev/hdb6 145 204 481918+ 82 Linux swap
/dev/hdb7 205 803 4811436 83 Linux / ACTIVE
/dev/hdb8 804 1401 4803403+ 83 Linux SPARE
/dev/hdb9 1402 1662 2096451 6 FAT16 DOS E: SPARE
The best time to layout your disks is before installing Linux, but you can create an EMERGENCY system later if you have adequate space on one of your dirves. If you don't understand how to use fdisk to create a new partition, get help with that before continuing with this procedure. You must have an empty partitiont (in my case a boot partition and a swap partition also) to make use of this procedure.
My example shows an EMERGENCY system on a seperate drive, but you can create an EMERGENCY system even if you only have a single drive. This won't be much help if the disk crashes though.
/boot partition, ignore the instructions for hdb5 and hda7.mke2fs /dev/hda7mke2fs /dev/hda9mkswap /dev/hda8mount /dev/hda9 /mnt/hda9cd /mnt/hda9mkdir bin boot dev etc home initrd lib lost+found mnt optmkdir proc root sbin shlib tmp usr varchmod 1777 tmpln -s var/lib/LST installcd mntmkdir ...(see below)mount /dev/hda7 /mnt/hda9/bootcd /cp -a /bin/* /mnt/hda9/bincp -a /boot/* /mnt/hda9/bootcp -a /dev/* /mnt/hda9/devcp -a /etc/* /mnt/hda9/etccp -a /home/* /mnt/hda9/homecp -a /initrd/* /mnt/hda9/initrdcp -a /lib/* /mnt/hda9/libcp -a /opt/* /mnt/hda9/optcp -a /root/* /mnt/hda9/rootcp -a /sbin/* /mnt/hda9/sbincp -a /shlib/* /mnt/hda9/shlibcp -a /usr/* /mnt/hda9/usrcp -a /var/* /mnt/hda9/var
boot = /dev/fd0
install = /boot/boot.b
vga = normal
prompt
timeout = 100
# default entry
image = /boot/vmlinuz-2.2.17-pre1
label = linux
root = /dev/hdb7
read-only
image = /boot/vmlinuz-pc97-2.2.14-modular
label = linuxorig
root = /dev/hdb7
read-only
image = /boot/vmlinuz-2.2.17-pre1
label = emerga1
root = /dev/hda9
read-only
image = /boot/vmlinuz-pc97-2.2.14-modular
label = emerga2
root = /dev/hda9
read-only
/sbin/lilo|
|
|