This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2048462 - Disk is not excluded from recreation even if all data in it is excluded
Summary: Disk is not excluded from recreation even if all data in it is excluded
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rear
Version: 8.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: CS System Management SST QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-31 10:05 UTC by Welterlen Benoit
Modified: 2023-09-21 23:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-21 23:39:57 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-6964 0 None Migrated None 2023-09-21 23:39:50 UTC
Red Hat Issue Tracker RHELPLAN-110371 0 None None None 2022-01-31 10:17:18 UTC

Description Welterlen Benoit 2022-01-31 10:05:00 UTC
Description of problem:
From the doc:
---
# You cannot exclude a device (e.g. /dev/sdg) directly. Instead you have to exclude everything 
# ON that device and then the dependency tracker will automatically exclude the device from the
# recovery (because there won't be any recovery information for that "unnecessary" device).
---
=> I understand that a device should be excluded if all the content of it is excluded, right ?


Version-Release number of selected component (if applicable):
rear-2.6-3.el8

How reproducible:
always

Steps to Reproduce:
1. mount a device on /mnt: 
/dev/vdb on /mnt type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
2. exclude the content of this mount point in local.conf:
BACKUP_PROG_EXCLUDE=('/tmp/*' '/dev/shm/*' '/mnt/*' )
3. run rear -dD mkbackup

Actual results:

/mnt is in include and also exclude list:
---
2022-01-31 03:55:21.607004724 Include list:
2022-01-31 03:55:21.608574187   /
2022-01-31 03:55:21.610103973   /boot/efi
2022-01-31 03:55:21.611596090   /boot
2022-01-31 03:55:21.613123105   /mnt
2022-01-31 03:55:21.614607219 Exclude list:
2022-01-31 03:55:21.616118655  /tmp/*
2022-01-31 03:55:21.617591045  /dev/shm/*
2022-01-31 03:55:21.619125130  /mnt/*
2022-01-31 03:55:21.620635750  /usr/*
2022-01-31 03:55:21.622085199  /var/*
2022-01-31 03:55:21.623513501  /tmp/rear.FOC2JRt0rV15jr9
---
And vdb is in disk layout:
---
disk /dev/vdb 536870912 loop
fs /dev/vdb /mnt xfs uuid=6f06686e-dda0-4578-99e3-9eb1297a04da label=  options=rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota
---

todo:
---
todo /dev/vdb disk
todo fs:/mnt fs
---

Expected results:
disk vdb not touched

Additional info:
I did't dig to find the dependency tracker to understand why the device is not excluded. 
Please let me know if help is needed.
Thank you !

Comment 1 Pavel Cahyna 2022-01-31 10:29:59 UTC
Hi Benoit,

the include and exclude rules are quite complicated and I can not yet call myself an expert on this area of the code. That said, I am afraid that BACKUP_PROG_EXCLUDE won't do what you intend as it only excludes paths from the backup generation (tar archive, rsync copy, ...) and not from the layout generation. I would use EXCLUDE_MOUNTPOINTS to achieve what you want. Note that the doc that you have quoted is directly above the EXCLUDE_* rules in /usr/share/rear/conf/default.conf, not above the BACKUP_PROG_EXCLUDE rules, so it must refer to the EXCLUDE rules. Also I suspect that '/mnt/*'  would not do what you want anyway, because it excludes everything under /mnt and not /mnt itself. Home that helps, if not, I can investigate further.

Comment 2 Pavel Cahyna 2022-01-31 10:41:43 UTC
Concerning "a device should be excluded if all the content of it is excluded, right?", according to the comment in default.conf, it is the contrary. The mountpoints specified under EXCLUDE_MOUNTPOINTS "[w]ill be automatically added to the $BACKUP_PROG_EXCLUDE array during backup to prevent the excluded filesystems' data to be backed up", but there is nothing that says that it will be added in the opposite direction. So a device being excluded means that all its content is excluded, but not vice-versa, if I understand the doc correctly.

(Yes, the comments in default.conf are actually the documentation of the various settings, usually the best and often the only documentation that exists. It is maybe not ideal that comments in the config file serve as documentation, but on the other hand I have found these comments quite detailed and complete.)

Comment 3 Welterlen Benoit 2022-01-31 11:13:20 UTC
Hi Pavel,

Thanks for the comment.
I agree with EXCLUDE_MOUTPOINTS: it will exclude everything form the backup. 
But you are saying "So a device being excluded means that all its content is excluded, but not vice-versa, if I understand the doc correctly."
The issue is that a device CAN'T be explicitly excluded:
---
# You cannot exclude a device (e.g. /dev/sdg) directly. Instead you have to exclude everything 
# ON that device and then the dependency tracker will automatically exclude the device from the
# recovery (because there won't be any recovery information for that "unnecessary" device)."
---

My point is why if I exclude everything from a PATH (which is a mount path), the corresponding device is not excluded (as it should be from the point above).

I tried with /mnt2 to exclude some specifics with /mnt but with the same result.

I'm still trying to understand how the tracker is working ...

Benoit

Comment 4 Pavel Cahyna 2022-01-31 18:53:15 UTC
I think that the comment "you have to exclude everything ON that device" is ambiguous and confusing and the source of your problems, because it can be read to mean two different things: files on that device (you exclude them using BACKUP_PROG_EXCLUDE) and storage objects on that device, like filesystems and LVM stuff (you exclude them using the EXCLUDE_* variables). In reality it means the latter, but you have understood it as meaning the former. The problem is, "everything on that device" could refer either to files inside a filesystem, or to the filesystem itself and the underlying storage stuff, and is not clear which one is meant. Try adding
EXCLUDE_MOUNTPOINTS+=( '/mnt' )
and I think it will be fine. If so, I would call it a documentation issue.

Here's the difference in disklayout before and after I do that (vdb1 is mounted on /mnt):

diff -ur inclayout/disklayout.conf exclayout/disklayout.conf
--- inclayout/disklayout.conf   2022-01-31 13:50:31.141253489 -0500
+++ exclayout/disklayout.conf   2022-01-31 13:50:54.375253489 -0500
@@ -1,4 +1,4 @@
-# Disk layout dated 20220131135030 (YYYYmmddHHMMSS)
+# Disk layout dated 20220131135053 (YYYYmmddHHMMSS)
 # NAME        KNAME     PKNAME   TRAN TYPE FSTYPE SIZE MOUNTPOINT
 # /dev/vda    /dev/vda                disk         20G 
 # `-/dev/vda1 /dev/vda1 /dev/vda      part xfs     20G /
@@ -12,13 +12,13 @@
 part /dev/vda 21473771008 1048576 primary boot /dev/vda1
 # Disk /dev/vdb
 # Format: disk <devname> <size(bytes)> <partition label type>
-disk /dev/vdb 10737418240 msdos
+#disk /dev/vdb 10737418240 msdos
 # Partitions on /dev/vdb
 # Format: part <device> <partition size(bytes)> <partition start(bytes)> <partition type|name> <flags> /dev/<partition>
-part /dev/vdb 10736369664 1048576 primary none /dev/vdb1
+#part /dev/vdb 10736369664 1048576 primary none /dev/vdb1
 # Filesystems (only ext2,ext3,ext4,vfat,xfs,reiserfs,btrfs are supported).
 # Format: fs <device> <mountpoint> <fstype> [uuid=<uuid>] [label=<label>] [<attributes>]
 fs /dev/vda1 / xfs uuid=507725cd-1cf2-496e-ac97-dd0d9324ae53 label=  options=rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota
-fs /dev/vdb1 /mnt ext2 uuid=9dcb0185-98b0-46a1-8be1-ce0dea426a2e label= blocksize=4096 reserved_blocks=4% max_mounts=-1 check_interval=0d bytes_per_inode=16382 default_mount_options=user_xattr,acl options=rw,relatime,seclabel
+#fs /dev/vdb1 /mnt ext2 uuid=9dcb0185-98b0-46a1-8be1-ce0dea426a2e label= blocksize=4096 reserved_blocks=4% max_mounts=-1 check_interval=0d bytes_per_inode=16382 default_mount_options=user_xattr,acl options=rw,relatime,seclabel
 # Swap partitions or swap files
 # Format: swap <filename> uuid=<uuid> label=<label>

Comment 5 Pavel Cahyna 2022-01-31 20:24:30 UTC
by the way by "So a device being excluded means that all its content is excluded" I meant a storage object (in this case, filesystem) being excluded, not exactly a device. While you can't exclude block devices (at least not disks), you can exclude filesystems on them (referred to by their mountpoints).

Comment 6 Welterlen Benoit 2022-02-02 10:00:30 UTC
Thanks Pavel,

With EXCLUDE_MOUNTPOINTS, it effectively works.

But what is more confusing, is that cust has ONLY_INCLUDE_VG=(rootvg) and:
----
# Only include LVM2 volume groups - the opposite of EXCLUDE_VG (handy if you only want vg00 to be included)
# EXCLUDE_VG and EXCLUDE_MOUNTPOINTS will get populated automatically, if needed
# syntax : e.g. ONLY_INCLUDE_VG=( "vg00" "vg01" )
ONLY_INCLUDE_VG=()
---

=> EXCLUDE_MOUNTPOINTS will get populated automatically
But I think only mount points of other VG...

Will inform cust to use explicitly EXCLUDE_MOUNTPOINTS

Thanks again !

Benoit

Comment 7 Pavel Cahyna 2022-02-02 10:11:03 UTC
Regarding ONLY_INCLUDE_VG and mountpoint exclusion, beware, it seems that it does not work properly in all cases, see bz1848927 - does it really populate EXCLUDE_MOUNTPOINTS of the excluded VG for the customer in their case (I don't really understand what was confusing, the documentation, or the actual behavior)? We can reopen that bug if needed.

Comment 8 Welterlen Benoit 2022-02-02 10:36:19 UTC
Hello, 

My issue is different I think:

with:
ONLY_INCLUDE_VG=('rhel')

and vdb not in a VG:
---
sr0            11:0    1 1024M  0 rom  
vda           252:0    0   20G  0 disk 
|-vda1        252:1    0  600M  0 part /boot/efi
|-vda2        252:2    0    1G  0 part /boot
`-vda3        252:3    0 18.4G  0 part 
  |-rhel-root 253:0    0 16.4G  0 lvm  /
  `-rhel-swap 253:1    0    2G  0 lvm  [SWAP]
vdb           252:16   0  512M  0 disk /mnt2
---

=> vdb is not in a VG, and then is not excluded (disk /dev/vdb 536870912 loop) (not in opposite EXCLUDE_VG ...)

What is weird: I made a mistake with the name of the VG in my first attempt, and everything was excluded ... including vdb ...

Comment 9 Pavel Cahyna 2022-02-02 15:52:42 UTC
(In reply to Welterlen Benoit from comment #8)
> Hello, 
> 
> My issue is different I think:
> 
> with:
> ONLY_INCLUDE_VG=('rhel')
> 
> and vdb not in a VG:
> ---
> sr0            11:0    1 1024M  0 rom  
> vda           252:0    0   20G  0 disk 
> |-vda1        252:1    0  600M  0 part /boot/efi
> |-vda2        252:2    0    1G  0 part /boot
> `-vda3        252:3    0 18.4G  0 part 
>   |-rhel-root 253:0    0 16.4G  0 lvm  /
>   `-rhel-swap 253:1    0    2G  0 lvm  [SWAP]
> vdb           252:16   0  512M  0 disk /mnt2
> ---
> 
> => vdb is not in a VG, and then is not excluded (disk /dev/vdb 536870912
> loop) (not in opposite EXCLUDE_VG ...)

I believe that ONLY_INCLUDE_VG means "exclude all VGs except this", not "exclude everything except this". May seem weird, but actually it is a good thing. Otherwise it would have excluded even your /boot and EFI System Partition.

> What is weird: I made a mistake with the name of the VG in my first attempt,
> and everything was excluded ... including vdb ...

Maybe because the mountpoint for vdb is in one of the VG's filesystems, and if this gets excluded, all mounts with mountpoints there get excluded as well? (There is a dependency solver in the layout code.)

Comment 10 Welterlen Benoit 2022-02-02 15:59:17 UTC
Thanks Pavel for the details.
We really have to face issues with rear to understand the options :D

I think the BZ can be closed.

Thanks for your work !

Best regards

Benoit

Comment 11 Pavel Cahyna 2022-02-02 16:16:30 UTC
(In reply to Welterlen Benoit from comment #10)
> Thanks Pavel for the details.
> We really have to face issues with rear to understand the options :D

the include / exclude rules are especially complicated. That's why I would hate to add even more such options, like https://github.com/rear/rear/pull/2597 / bz1946911.

> I think the BZ can be closed.

Don't you want to turn it into a doc issue? (Not sure how exactly this works.)

> Thanks for your work !

you are very welcome! I am glad to have had an opportunity to become more familiar with the include / exclude rules.

Regards, Pavel

Comment 12 RHEL Program Management 2023-09-21 23:36:05 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 13 RHEL Program Management 2023-09-21 23:39:57 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


Note You need to log in before you can comment on or make changes to this bug.