1

A common practice is to use non-preallocated virtual disks.

Since they only grow as needed, it makes them perfect for fast backup, overallocation and creation speed.

Since file systems are usually based on physical disks they have the tendency to use the whole area available1 in order to increase the speed2 or reliability3.

I'm searching a filesystem that does the exact opposite : try to touch the minimum blocks need by an aggressive block reuse.

I would happily trade some performance for space usage.

There is already a similar question, but it is rather general. I have very specific goal : space-efficiency.

1. Like page caching uses all the free physical memory
2. Canonical example : online defragmentation
3. Canonical example : snapshotting

Steve Schnepp
  • 2,222
  • 3
  • 21
  • 27

2 Answers2

1

If you don't mind being on the edge, you can do this with the new btrfs filesystem. The backup target device will occupy no more space than is used by the copied data.

https://btrfs.wiki.kernel.org/index.php/Main_Page

  1. Create a partition (using LVM logical volume or regular)
  2. Format: mkfs -t btrfs
  3. Mount it: mount -t btrfs /mnt/btrfs
  4. Create a brts sub-volume: btrfsctl -S home_template /mnt/btrfs
  5. Umount /mnt/btrfs and mount the subvol: mount -t btrfs -o subvol=home_template /mnt/template
  6. Populate /mnt/template with files/folders if needed in the backup target
  7. Make a snapshot of the home_template subvol for each user. This occupies 0 space until mounted and written to. btrfsctl -s /mnt/joeblow /mnt/template 8 Mount the snapshot as needed and let the backups begin: mount -t btrfs -o subvol=joeblow /mnt/backup
user38808
  • 199
  • 3
-1

you can also use LVM volumes, adding PVs as necessary to a VG in order to grow it, and using lvextend to grow LVs dedicated to VMs

dyasny
  • 18,482
  • 6
  • 48
  • 63