On Tue, Mar 13, 2018 at 10:49:23AM -0700, Darrick J. Wong wrote: > On Tue, Mar 13, 2018 at 11:08:11AM -0600, Andreas Dilger wrote: > > On Mar 13, 2018, at 10:36 AM, Darrick J. Wong <darrick.wong@xxxxxxxxxx> wrote: > > > > > > On Tue, Mar 13, 2018 at 07:23:44AM +0100, Lukas Czerner wrote: > > >> On Mon, Mar 12, 2018 at 09:14:53AM -0700, Darrick J. Wong wrote: > > >>> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > >>> > > >>> Create an e2scrub_all command to find all ext* filesystems > > >>> and run an online scrub against them all. > > >> > > >> Sorry for not bringing that up before, by why don't we have > > >> > > >> e2scrub -a > > >> > > >> instead of this ? Wouldn't it be better to have just one tool ? > > > > > > I'd rather have two simple tools that each do one thing ("scrub this > > > ext4 lvm volume") ("find all ext4 lvm volumes and run scrub") than > > > combine them into one less cohesive tool. There's precedence here with > > > fsck.$fstype and fsck, where the first one performs an offline check of a > > > single filesystem and the second one (if you fsck -A) finds all the > > > individual filesystems and feeds them through fsck.$fstype. In the > > > longer term it probably makes sense to set up a fsscrub wrapper to > > > invoke the fs-specific scrub tools. > > > > > > Though now that I think about that, e2scrub probably ought to take a > > > mount point and translate that into a lvm volume, which makes > > > e2scrub_all mostly a dumb iterator of /proc/mounts. > > > > Except that won't scrub offline volumes, nor will all mounted ext4 > > filesystems be LVs that can be scrubbed, so I don't think that is > > an improvement. > > Ok, I'll modify e2scrub so that you can pass it either (a) a lvm block > device or (b) a mountpoint for a filesystem on a lvm block device. > e2scrub_all will retain its ability to schedule a check even if the fs > isn't mounted. It occurred to me while making these changes that it's not necessarily safe to assume that we can check all the offline LVs -- suppose you have clustered storage being managed by LVM. If each node only e2scrubs the LVs that it has mounted, we avoid a thundering stampede at 3:30am when all the nodes all start trying to e2scrub any LV they have access to. However, I'll grant you that we could (more) easily have offline local LVs, so I think a reasonable compromise is to establish "e2scrub_all -A" to mean "check all the LVs regardless of mount state". --D > --D > > > Cheers, Andreas > > > > > > > > > > > >