Next
Previous
Contents
Creating the BOOT disk
- compile a recent kernel with many harware support,
and many file systems (as ext2, fat, reiser, ntfs)
with make bzImage (do not use DMA by default)
- use rdev on the image:
rdev bzImage /dev/fd0
rdev -r bzImage 49152 (49152 = ask disk, and read from 0)
rdev -R bzImage 0 (to make the root RW and allow to login)
- dd if=bzImage of=/dev/fd0
Creating the ROOT disk
- dd if=/dev/zero of=image count=3733 bs=1k
- mkfs.minix image
- mount -o loop -t minix image /mnt/image
- remove debug data from binaries executables
libraries and programs to save space:
program: strip program
shared library: objcopy --stripdebug library.so
- copy all files to /mnt/image
- umount /mnt/image
- cat image | gzip -9 > image.gz
- dd if=image.gz of=/dev/fd0
Creating the Eltorito bootcd image
The best way is to update an existring image. The size of the file is 2.88 MB (2949120 bytes). It contains a FAT file systems.
First, mount the image: mount -o loop bootcd.img /mnt/bootcd
Then, replace the vmlinuz with a new kernel (it can be the bootdisk.raw), and replace the
initrd.img with another root (it can be rootdisk.raw).
You will need syslinux to make this image bootable. It's easier to use than LILO.
Now, umount the bootcd image with umount /mnt/bootcd
Run losetup /dev/loop0 bootcd.img, run syslinux syslinux -s bootcd.img, and detach the loop device: losetup -d /dev/loop0
In this section, we will explian how to test the file system support of partimage. Then, it does not explains how to test all the options (compression, splitting,) but
only how to be sure the data of the file system can be saved and restored successfully, and the result will be the exact copy of the original. The goal of this test is
to know if you will obtain a valid partition after the restoration, with all your files, or if a bug will encounter the data lost.
Tests are more useful if they are made on difficult file systems. For example it's easier to encounter a bug on a fragmented file system. Thus, making tests on fragmented
partitions can give better informations to the developpers, because it can work, even when it's not the best condition of use. Likewise, making test on partitions which contains
free space is more interesting.
If you want to create a test partition, the best thing to do it to fill all the space with files, and to erase some of them after, in order to create a fragmented file system.
There are two ways to test the copy of a partition:
a) Using two test partitions of the same size
You need to have free disk space, to save an image, and to create a new partition. We will copy an existing partition to another one, using partimage.
We need two partitions:
- The original one: it will only be read (/dev/hdc5 in our example)
- The destination one: it will be written on restoring, and compared to the original one (/dev/hdc6 in our example)
What to do:
- Download and install the last version of Partition Image: don't signal bugs which are already fixed.
- Create an image of an existing partition (/dev/hdc5 in our example). This is the original partition we will copy.
- Create an empty partition on your hard-drive, with the same size as the original one. (/dev/hdc6 in our example)
- Erase the new partition with dd if=/dev/zero of=/dev/xxx (/dev/hdc6 in our example)
- Restore the image into the new created partition. (/dev/hdc6 in our example)
- To test, try to use the new created partition (/dev/hdc6). Try to mount it, and to run a file system check with
e2fsck /dev/hdc6 if this is an ext2fs partition, or run scandisk under Windows if a FAT one. You can compare the
original partition files with the files of the new one. To do it, mount the two partitions (on /mnt/part1 and /mnt/part2 for example),
and run the following command: diff -ur /mnt/part1 /mnt/part2. If nothing is printed on the screen, there are no difference between files of the partitions.
Then it succeed. If there is something, then there are differences. You can send a bug report (and the partimage-debug.log file) to the debug mailing list,
by giving all the details (size of the partition, state (percent usage: empty, full), file system, details (many small files, only 5 files)).
b) Using only one partition and aide
First, you will require AIDE (Advanced Intrusion Detection Environment). It's a free software.
Next
Previous
Contents