Control: tags -1 +pending On Wed, Jul 03, 2019 at 07:59:11PM +0200, Marc Haber wrote: > > (additional issue #1) > the -C option is not mentioned in the e2scrub_all manual page,
That's been fixed (by removing the -C) upstream already. commit 6ec2060a291b873ba120aa7cda940c6604eac550 Author: Darrick J. Wong <[email protected]> Date: Mon Jun 3 21:27:12 2019 -0700 e2scrub: remove -C from e2scrub_all We already have the "SERVICE_MODE=1" feature that signals to e2scrub that we're running as a background daemon and therefore we should exit quietly if conditions aren't right. It's therefore unnecessary to have a separate -C flag to achieve the same outcome for cron jobs. Merge the two together. Signed-off-by: Darrick J. Wong <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> > (additional issue #2) > e2scub_all -n reveals that it would actually invoke systemctl start > e2scrub@- which, manually invoked, gives some feedback about its > failure: Yes, that was a bug; e2scprobe e2scrub_all should haven't issued the "systemctl start e2scrub@-" command for your system. > I don't think that having an e2 file system on a LUKS device on an LVM > logical volume is such an exotic thing to have. It's not exotic, but it's not something we had tested. So thanks for your bug report! On my system I have the LVM PV on top of the LUKS device (so that all of the LV's are encrypted), and on your system you have it the other way around. So the problem is that when we scan for LVM devices: lvs -o lv_path --noheadings -S "lv_active=active,lv_role=public,lv_role!=snapshot,vg_free>256" we get /dev/fan-c/root, but then when we then run lsblk on that device, we get something like this: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 931,5G 0 disk fan-c_root 253:0 0 417,2G 0 lvm └─root 253:28 0 417,2G 0 crypt / And so when we run lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p /dev/fan-c/root we get both the top-level and subdevice: NAME="/dev/mapper/fan-c_root" MOUNTPOINT="" FSTYPE="crypto_LUKS" NAME="/dev/mapper/root" MOUNTPOINT="/" FSTYPE="ext4" That was the root cause of the failure. Attached please find the fix that I have applied to my git repo, and which will be in the next release of e2fsprogs. Thanks again for the bug report! - Ted P.S. Sorry for the complexity; we were trying to use systemd to handle the error reporting. I do wonder if we would have been better off if we done things the more old-fashioned way, instead of trying to take advantage of all of systemd's "value add". My personal opinion is whether or not we like systemd, it's won the war, so we might as well try to take advantages of it, since we're stuck with the disadvantages. And to be fair to systemd, the problems we've been having haven't been with e2scrube_all triggering e2scrub@<mntpt> and with the service file triggering e2scrub_fail@<mntpt> if there we need to send a report to the system administrator. The fact that we have to use systemd-escape to transmogrify "/" to "-", and "/usr/projects" to "-usr-projects" is certainly confusing (which is where e2scrub@- comes from) --- but it hasn't been the actual cause of the e2scrub bugs that we've had. The bugs that we have found have been more in the complex stacking of dm-crypt, luks, etc, and our trying to use "lvs" and "lsblk" to figure out which devices should get scrubbed. And there have been a bunch hiding there --- and we currently don't scrub file systems on thin-provisioned (dm-thinkp) devices at all, because that would be even harder to get right. So the issues have been on the lvm/thinp/lsblk side, not the systemd integration aspect. commit 0207f41174ac94eb98ed29e52bc6e1c5f6a8bdd3 Author: Theodore Ts'o <[email protected]> Date: Thu Jul 4 11:39:45 2019 -0400 e2scrub_all: correctly handle the case where LUKS is stacked on an LV We handle the case where an LVM's PV is stacked on top of a dm-crypt device, but not the case where it's the other way around, where a LVM LV contains a LUKS encrypted file system. Fix this oversight. Addresses-Debian-Bug: #931387 Reported-by: Marc Haber <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in index cdc37ced..24b2c681 100644 --- a/scrub/e2scrub_all.in +++ b/scrub/e2scrub_all.in @@ -102,8 +102,9 @@ ls_scan_targets() { if [ -z "$devices" ]; then return 0; fi - lsblk -o NAME,MOUNTPOINT,FSTYPE -P -n -p $devices | \ - grep FSTYPE=\"ext\[234\]\" | while read vars ; do + lsblk -o NAME,MOUNTPOINT,FSTYPE,TYPE -P -n -p $devices | \ + grep FSTYPE=\"ext\[234\]\" | grep TYPE=\"lvm\" | \ + while read vars ; do eval "${vars}" if [ "${scrub_all}" -eq 1 ] || [ -n "${MOUNTPOINT}" ]; then

