Commit Graph

24 Commits

Author SHA1 Message Date
Theodore Ts'o
cf62b892eb e2scrub_all: fix missing getopts argument which broke e2scrub_all -C
Addresses-Debian-Bug: #929287

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-20 20:34:59 -04:00
Theodore Ts'o
6cf9a7f03f e2scrub: fix grammar nit: "a LVM" -> "an LVM"
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-20 10:56:51 -04:00
Theodore Ts'o
fbb9bfa4a5 e2scrub_all: avoid scrubbing all devices when there is nothing to scrub
Running lsblk when there are no valid block devicse results in
generating all block devices as the list of devices to scrub; this
results in a lot of e2scrub_all failures.

Addresses-Debian-Bug: #929186

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-18 23:43:55 -04:00
Theodore Ts'o
9d41a057d9 e2scrub: stop cron spam if lvm2 is not installed.
Addresses-Debian-Bug: #928977

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-18 21:43:57 -04:00
Michael Haubenwallner
e212d95fbb Fix parallel install issue in scrub subdir
In scrub/Makefile the various 'install-*' targets do not explicitly
depend on their corresponding 'installdirs-*' target, so they get run
in parallel.

Addresses-Gentoo-Bug: #680030

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-10 18:36:51 -04:00
Theodore Ts'o
06014d726d e2scrub: make the e2scrub service files require CAP_SYS_ADMIN and CAP_SYS_RAWIO
Addresses-Debian-Bug: #926138

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-06 10:15:41 -04:00
Theodore Ts'o
66300c5701 e2scrub: tag the *.e2scrub LV's with UDISK_IGNORE in udev
Force the *.e2scrub LV's to be ignored by udisk.

Addresses-Debian-Bug: #926112

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-05-06 10:15:41 -04:00
Theodore Ts'o
e97d4c46a4 e2scrub,e2scrub_all: print a (more understandable) error if not run as root
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-21 18:11:37 -04:00
Darrick J. Wong
c7d6525eca e2scrub_all: refactor device probe loop
Paul Menzel reported that the e2scrub_all reaper service that runs at
startup takes a long time to run, and Ted Ts'o pointed out that we could
do a lot less work by using lvs as the outer loop in the ext4 filesystem
probe function so that we only have to lsblk the lvm devices containing
ext4 filesystems.

Therefore, refactor the loops to put lvs first, which should boost speed
a bit.

[ Made some of the further optimizations suggested by Lukas Czerner.  -- TYT ]

Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-21 18:10:50 -04:00
Theodore Ts'o
c120312253 e2scrub_all: make sure there's enough free space for a snapshot
If there isn't, skip the volume so we don't spam the system
administrator with error messages.  It's quite commkon that there is
is zero free space in the volume group.

Addresses-Debian-Bug: #924301

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-21 11:30:09 -04:00
Theodore Ts'o
fbd0c83877 e2scrub_all: add the -n option which shows what e2scrub_all would do
Also fix the copyright symbol so it is properly formatted when
processed into postscript or pdf.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-21 11:29:40 -04:00
Theodore Ts'o
02bfc2d3ff e2scrub: add the -n option which shows what commands e2scrub would execute
Also fix the copyright symbol so it is properly formatted when
processed into postscript or pdf.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-21 11:26:58 -04:00
Theodore Ts'o
e9fa167b8e e2scrub: fix up "make install-strip" support
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-17 18:50:37 -04:00
Theodore Ts'o
04738f2ff3 e2scrub: check to make sure lvm2 is installed
Not all systems will have the lvm2 package installed, so check for
that.  Pretty much all systems should have util-linux installed, but
check for that as well.

Of course, if lvm2 is installed we shouldn't find any LVM devices ---
but eventually the Demon Murphy will find a way to make it happen. :-)

Also, set the PATH so we don't have to worry about the script failing
due to /sbin not being in the path.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-10 19:52:25 -04:00
Theodore Ts'o
e8c6459ceb e2scrub: install the crontab file in /etc/cron.d w/o the .cron extension
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-07 00:40:14 -05:00
Theodore Ts'o
48cc00797c e2scrub: make e2scrub_fail's e-mail addresses be configurable
Allow the sender and recipient e-mail addresses be configurable from
/etc/e2scrub.conf.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-07 00:12:49 -05:00
Theodore Ts'o
198cbd4595 e2scrub: add missing Documentation links to systemd unit files
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-06 22:20:35 -05:00
Theodore Ts'o
366aa03ff0 scrub/Makefile.in: install the udev rule and crontab file as data files
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-06 22:17:57 -05:00
Theodore Ts'o
f0fbca14e1 Fix "make clean" so it removes all generated files in the scrub directory
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-03-06 13:18:57 -05:00
Darrick J. Wong
e6a3faa237 e2scrub: fix systemd escaping again
Apparently newer versions of systemd than the one on this author's
laptop <cough> now complain about lack of (path) escaping in unit
instance variable contents:

 # e2scrub_all
 Scrubbing /home...
 Invalid unit name "e2scrub@/home" was escaped as "e2scrub@-home"
 (maybe you should use systemd-escape?)
 Starting Online ext4 Metadata Check for /home...

So change the escape_path_for_systemd function to escape paths
unconditionally to make the warning go away.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-11-15 14:20:35 -05:00
Darrick J. Wong
76d5590a4f e2scrub: fix makefile MKINSTALLDIRS -> MKDIR_P
Fix the MKINSTALLDIRS -> MKDIR_P transition in the scrub/ dir.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-09-06 11:57:01 -04:00
Darrick J. Wong
a2df58945c e2scrub: add service (cron, systemd) support
Add the ability to run the e2scrub utilities as a periodically scheduled
system service.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-08-05 14:59:40 -04:00
Darrick J. Wong
a089aec341 e2scrub: create a script to scrub all ext* filesystems
Create an e2scrub_all command to find all ext* filesystems
and run an online scrub against them all.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-08-05 14:43:12 -04:00
Darrick J. Wong
5ce368f07c e2scrub: create online fsck tool of sorts
Implement online fsck for ext* filesystems which live on LVM-managed
logical volumes.  The basic strategy mirrors that of e2croncheck --
create a snapshot, fsck the snapshot, report whatever errors appear,
remove snapshot.  Unlike e2croncheck, this utility accepts any LVM
device path, knows about snapshots running out of space, and can call
fstrim having validated that the fs metadata is ok.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-08-05 14:43:12 -04:00