DeveloperInfo

From Partimage-ng

Various bits on partimage-ng internals, filesystems, etc.

Contents

Implementing support for new filesystems

Coming soon.

LVM support

It seems that the linux kernel doesn't like partitioned LVM volumes. If you create a partition table of some kind on it, the kernel won't parse it until someone explicitly tell it to parse (via a syscall like libparted or partprobe does). And after a reboot the kernel forgets about the partitions again. While there is nothing wrong with having a partition table on an LVM volume (one can use it for a virtual machine) we better don't not mess with the kernel.

Say, we have a logical volume /dev/mapper/vol1 with a partition table. libparted then reports that it has (for example) 2 partitions: /dev/mapper/vol1p1 and /dev/mapper/vol1p2. But by default there are no such device files in /dev/mapper, and the linux kernel doesn't create them on its own. Therefore, we can't read data off the partitions via device files, only via the parent device file /dev/mappers/vol1 which is cumbersome.

In my opinion, the best solution is to:

  • if a partitioned LVM volume is detected print a big warning saying that this is not a regular case and partimage-ng will ignore this device unless the user runs partprobe to make the kernel parse the partition table and create the corresponding device files in /dev/mapper
  • once it is done the user can point partimage-ng to that LVM volume and back it up

On restore, if an image of a partitioned disk is to be restored on an LVM volume, print a big warning saying that this operation has a side-effect: device files in /dev/mapper for every partition will be created but they will go away after reboot.

Tests

Ideally, we should write scripts to test all the functionality unattended. Until then we have to run the tests manually.

LabelImager

  • backup a label and restore it onto an empty drive
  • backup a label and restore it onto a partitioned drive
  • backup a label excluding a primary partition and restore it onto a drive
  • backup a label excluding a logical partition and restore it onto a drive
  • backup a label excluding the entire extended partition and restore it onto a drive

PartitionImager

  • backup a primary partition and restore it onto another primary partition
  • backup a logical partition and restore it onto another logical partition
  • backup the extended partition and restore it onto another extended partition (the target partition should have the same layout as the original partition)
  • backup the extended partition and restore one of the logical partitions onto another primary/logical partition
  • backup a primary/logical partition from one drive and the extended partition from another drive and cross-restore them
  • backup a primary/logical partition and restore it twice onto the same drive
  • backup a primary/logical partition and restore it twice onto different drives
  • backup a single-drive partition and restore it onto a partitioned drive

Options

  • MBR boot code
  • GRUB boot code
  • Linux swap
  • Force if mounted
  • Ignore bad sectors
  • Clear the bad blocks map on NTFS