[00/17] BTRFS support on IPFire 2.x (experimental)

Message ID 20240315191442.3951-1-stefan.schantl@ipfire.org
Headers
Series BTRFS support on IPFire 2.x (experimental) |

Message

Stefan Schantl March 15, 2024, 7:14 p.m. UTC
  Hello mailinglist followers,

this first patchset will introduce basic BTRFS support in IPFire 2.x.

It allows to choose BTRFS during installation as filesystem, will
install IPFire and bring it up as usual.

The main difference to the other file system will be displayed when
showing the current mounted filesystems. When using BTRFS a lot of so
called subvolumes will be created. They act as some kind of logical
partition and are needed in two cases.

This kind of fragmentation allows to create snapshots of such a
subvolume and only the stored data on it. The more important reason of
using subvolumes is, that while creating a snapshot any files which are
located on a different subvolume will not be part of it.

So, when creating a snaphot of the filesystem root and restoring
it back later, no files which are part of a subvolume (logfile, database
files etc) are rolled-back. This helps us debugging because the old logs
are still there and mostly important prevents from data lost of altered
databases or newly created files!

Currently there is still some work to do see:

Wiki-Roadmap: https://www.ipfire.org/docs/roadmap/btrfs
Bugzilla: https://bugzilla.ipfire.org/show_bug.cgi?id=13606

Stefan Schantl (17):
  btrfs-progs: New package
  installer: Allow to install IPFire on BTRFS
  installer: Ensure to always create the /boot directory.
  installer: Disable seperate boot partition
  installer: Add code to create a BTRFS subvolume layout.
  installer: Correctly umount main BTRFS partition.
  installer: Add recurisve mkdir function
  installer: Mount BTRFS layout  before installing the system
  installer: Add /var/tmp to the BTRFS layout
  installer: Fix using BTRFS mount options when mounting the layout
  installer: Add code to proper unmount the BTRFS layout
  installer: Add code to correctly write the fstab when installing on
    BTRFS
  installer: Define common mount options for BTRFS volumes
  inotify-tools: New package
  grub-btrfs: New package
  installer: Mark BTRFS support as experimental
  installer: Adjust BTRFS layout

 config/rootfiles/common/btrfs-progs         |  33 +++
 config/rootfiles/common/grub-btrfs          |  14 ++
 config/rootfiles/common/inotify-tools       |  19 ++
 config/rootfiles/common/x86_64/initscripts  |   4 +
 lfs/btrfs-progs                             |  85 ++++++++
 lfs/grub-btrfs                              |  79 +++++++
 lfs/initscripts                             |   3 +
 lfs/inotify-tools                           |  83 ++++++++
 make.sh                                     |   3 +
 src/initscripts/system/grub-btrfsd          |  61 ++++++
 src/installer/dracut-module/module-setup.sh |   4 +-
 src/installer/hw.c                          | 221 +++++++++++++++++++-
 src/installer/hw.h                          |   8 +
 src/installer/main.c                        |   1 +
 14 files changed, 606 insertions(+), 12 deletions(-)
 create mode 100644 config/rootfiles/common/btrfs-progs
 create mode 100644 config/rootfiles/common/grub-btrfs
 create mode 100644 config/rootfiles/common/inotify-tools
 create mode 100644 lfs/btrfs-progs
 create mode 100644 lfs/grub-btrfs
 create mode 100644 lfs/inotify-tools
 create mode 100644 src/initscripts/system/grub-btrfsd
  

Comments

Michael Tremer March 18, 2024, 4:18 p.m. UTC | #1
Hello Stefan,

> On 15 Mar 2024, at 19:14, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> Hello mailinglist followers,
> 
> this first patchset will introduce basic BTRFS support in IPFire 2.x.

Thank you for submitting this. I have been looking forward to see this on here.

Although it is still early days, I would like to merge this as soon as possible and generally consider this an experimental feature for a long time to come. There probably won't be any tangible advantages for our users, but we should have a better option to roll back any physical installations if any experimental updates go wrong.

> It allows to choose BTRFS during installation as filesystem, will
> install IPFire and bring it up as usual.
> 
> The main difference to the other file system will be displayed when
> showing the current mounted filesystems. When using BTRFS a lot of so
> called subvolumes will be created. They act as some kind of logical
> partition and are needed in two cases.
> 
> This kind of fragmentation allows to create snapshots of such a
> subvolume and only the stored data on it. The more important reason of
> using subvolumes is, that while creating a snapshot any files which are
> located on a different subvolume will not be part of it.
> 
> So, when creating a snaphot of the filesystem root and restoring
> it back later, no files which are part of a subvolume (logfile, database
> files etc) are rolled-back. This helps us debugging because the old logs
> are still there and mostly important prevents from data lost of altered
> databases or newly created files!
> 
> Currently there is still some work to do see:
> 
> Wiki-Roadmap: https://www.ipfire.org/docs/roadmap/btrfs
> Bugzilla: https://bugzilla.ipfire.org/show_bug.cgi?id=13606
> 
> Stefan Schantl (17):
>  btrfs-progs: New package
>  installer: Allow to install IPFire on BTRFS
>  installer: Ensure to always create the /boot directory.
>  installer: Disable seperate boot partition
>  installer: Add code to create a BTRFS subvolume layout.
>  installer: Correctly umount main BTRFS partition.
>  installer: Add recurisve mkdir function
>  installer: Mount BTRFS layout  before installing the system
>  installer: Add /var/tmp to the BTRFS layout
>  installer: Fix using BTRFS mount options when mounting the layout
>  installer: Add code to proper unmount the BTRFS layout
>  installer: Add code to correctly write the fstab when installing on
>    BTRFS
>  installer: Define common mount options for BTRFS volumes
>  inotify-tools: New package
>  grub-btrfs: New package
>  installer: Mark BTRFS support as experimental
>  installer: Adjust BTRFS layout
> 
> config/rootfiles/common/btrfs-progs         |  33 +++
> config/rootfiles/common/grub-btrfs          |  14 ++
> config/rootfiles/common/inotify-tools       |  19 ++
> config/rootfiles/common/x86_64/initscripts  |   4 +
> lfs/btrfs-progs                             |  85 ++++++++
> lfs/grub-btrfs                              |  79 +++++++
> lfs/initscripts                             |   3 +
> lfs/inotify-tools                           |  83 ++++++++
> make.sh                                     |   3 +
> src/initscripts/system/grub-btrfsd          |  61 ++++++
> src/installer/dracut-module/module-setup.sh |   4 +-
> src/installer/hw.c                          | 221 +++++++++++++++++++-
> src/installer/hw.h                          |   8 +
> src/installer/main.c                        |   1 +
> 14 files changed, 606 insertions(+), 12 deletions(-)
> create mode 100644 config/rootfiles/common/btrfs-progs
> create mode 100644 config/rootfiles/common/grub-btrfs
> create mode 100644 config/rootfiles/common/inotify-tools
> create mode 100644 lfs/btrfs-progs
> create mode 100644 lfs/grub-btrfs
> create mode 100644 lfs/inotify-tools
> create mode 100644 src/initscripts/system/grub-btrfsd
> 
> -- 
> 2.39.2
>