From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: [RFC 2/3] scripts to find eligible lv ext4 filesystems
Date: Fri, 21 Jul 2017 17:30:18 -0700 [thread overview]
Message-ID: <20170722003018.GF4211@magnolia> (raw)
In-Reply-To: <20170722002643.GD4211@magnolia>
/sbin/online-fsck-all:
#!/bin/bash
types="ext2,ext3,ext4"
# Scrub any fs on lvm by creating a snapshot and fscking that.
lvs --noheadings 2> /dev/null | while read lv vg junk; do
dev="/dev/${vg}/${lv}"
blkid -p -n "${types}" "${dev}" > /dev/null 2>&1 || continue
${DBG} systemctl start "online-fsck@${dev}" 2> /dev/null
res=$?
if [ "${res}" -eq 0 ] || [ "${res}" -eq 1 ]; then
if [ "${res}" -gt 150 ]; then
res="$((res - 150))"
fi
echo "Scrubbing ${dev} done, (err=${res})"
else
${DBG} /sbin/online-fsck "${dev}"
fi
done
# Stupid journald bug where the process still has to exist for
# the last few messages to get tagged to the service...
test -n "${SERVICE_MODE}" && sleep 2
exit 0
next prev parent reply other threads:[~2017-07-22 0:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-22 0:26 [RFC] online scrub for ext4 Darrick J. Wong
2017-07-22 0:29 ` [RFC 1/3] scripts to create and fsck a snapshot Darrick J. Wong
2017-07-22 0:30 ` Darrick J. Wong [this message]
2017-07-22 0:33 ` [RFC 3/3] systemd integration scripts Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170722003018.GF4211@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).