#3458 Issue open: Documentation for EXCLUDE_COMPONENTS

Labels: enhancement, documentation

danboid opened issue at 2025-04-16 15:44:

Platform

Linux x64

Lack of docs for EXCLUDE_COMPONENTS

Describe the solution you'd like

It doesn't seem that EXCLUDE_COMPONENTS is documented and this is pretty much the only (one of the few) option I need to use for rear.

https://github.com/rear/rear/blob/master/doc/user-guide/06-layout-configuration.adoc

Would seem like the logical place to document it but it could instead be covered on:

https://github.com/rear/rear/blob/master/doc/user-guide/03-configuration.adoc

@jsmeix outlined it like this for me (I have genericised it a bit)

You can exclude your disk (eg /dev/sda)  via EXCLUDE_COMPONENTS like

EXCLUDE_COMPONENTS+=( /dev/sda )

(Maybe give a /dev/disk/by-id example too?)

To exclude a disk with mounted filesystems one must also specify
the filesystem mountpoints for example via

EXCLUDE_COMPONENTS+=( /dev/sdX fs:/mountpoint1 fs:/mountpoint2 )

Where fs:/mountpoint1 and fs:/mountpoint2 are mount dirs on sdX.

Describe alternatives you've considered

No response

Additional context

No response

jsmeix commented at 2025-04-17 09:55:

This depends on that my
https://github.com/rear/rear/pull/3455
is merged
and when it is merged it is already described
in usr/share/rear/conf/default.conf (excerpts)

# How to exclude something ----- EXCLUDES -------
#
# Normally a whole device (e.g. a disk device /dev/sdX) is not excluded directly
# (for exceptional cases see EXCLUDE_COMPONENTS below).
# Instead specific things on a device are excluded.
# When everything on a device is excluded then via the dependency tracker
# the whole device gets automatically excluded from the recovery
# because there is no recovery information left for that device.
...
# EXCLUDE_COMPONENTS: Exclude any component from the recovery.
# Some component types need a prefix:
# - filesystems: "fs:/var/cache"
# - physical volumes: "pv:/dev/sda2"
# - swap: "swap:/dev/mapper/system-swap"
# Volume groups look like: "/dev/system".
# For the correct syntax of a specific component see /var/lib/rear/layout/disktodo.conf
# Because EXCLUDE_COMPONENTS excludes any component from the recovery
# it can be used in exceptional cases to exclude unwanted whole disks from the very beginning,
# for example to circumvent issues with unneeded problematic disks which cause issues in ReaR
# as in https://github.com/rear/rear/issues/2995 where parted could not recognize a partition table.
# To exclude a disk with mounted filesystems their mountpoints must be also specified
# for example via EXCLUDE_COMPONENTS+=( /dev/sdX fs:/mountpoint1 fs:/mountpoint2 )
EXCLUDE_COMPONENTS=()

jsmeix commented at 2025-04-17 10:37:

Currently things do not look so good that the intent of
https://github.com/rear/rear/pull/3455
could be implemented with reasonable effort, see
https://github.com/rear/rear/pull/3455#issuecomment-2812436548

danboid commented at 2025-04-17 11:03:

To be clear, I need EXCLUDE_COMPONENTS to stop rear trying to backup my ZFS disks which rear can't backup and restore properly. I use other tools to backup ZFS.

I think this function is too important to have it only documented in /usr/share/rear/conf/default.conf but thats just my opinion as a big fan and user of ZFS.

gdha commented at 2025-04-19 04:54:

@danboid Are you an ZFS expert as it would be nice to have this covered by ReaR as well?

danboid commented at 2025-04-19 08:55:

I wouldn't call myself an expert, I'm not a ZFS developer. I've been using it for about a decade so I know it quite well.

jsmeix commented at 2025-04-23 13:33:

Only as a side note FYI regarding ZFS:
https://github.com/rear/rear/issues/2959
https://github.com/rear/rear/issues/2773
https://github.com/rear/rear/issues/2563
https://github.com/rear/rear/issues/1932


[Export of Github issue for rear/rear.]