From patchwork Thu Mar 21 02:02:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 1059718 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mit.edu Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44Pqmm1bgGz9sRG for ; Thu, 21 Mar 2019 13:02:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727751AbfCUCC3 (ORCPT ); Wed, 20 Mar 2019 22:02:29 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57809 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727614AbfCUCC3 (ORCPT ); Wed, 20 Mar 2019 22:02:29 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-99.corp.google.com [104.133.0.99] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x2L22NSf029526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Mar 2019 22:02:24 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id E2FD6420AAC; Wed, 20 Mar 2019 22:02:22 -0400 (EDT) From: "Theodore Ts'o" To: Ext4 Developers List Cc: darrick.wong@oracle.com, "Theodore Ts'o" Subject: [PATCH 5/9] e2fscrub: add the -n option which shows what commands e2scrub would execute Date: Wed, 20 Mar 2019 22:02:14 -0400 Message-Id: <20190321020218.5154-5-tytso@mit.edu> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190321020218.5154-1-tytso@mit.edu> References: <20190321020218.5154-1-tytso@mit.edu> MIME-Version: 1.0 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Theodore Ts'o Reviewed-by: Darrick J. Wong --- scrub/e2scrub.8.in | 5 +++++ scrub/e2scrub.in | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scrub/e2scrub.8.in b/scrub/e2scrub.8.in index ff03523e3..7342876a3 100644 --- a/scrub/e2scrub.8.in +++ b/scrub/e2scrub.8.in @@ -38,6 +38,11 @@ If the filesystem is not repaired, will be run before the next mount. .SH OPTIONS .TP +\fB-n\fR +Print what commands +.B e2scrub +would execute (but don't actually execute them). +.TP \fB-r\fR Remove the e2scrub snapshot and exit without checking anything. .TP diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in index 51a909373..301574968 100644 --- a/scrub/e2scrub.in +++ b/scrub/e2scrub.in @@ -37,6 +37,7 @@ print_help() { echo "Usage: $0 [OPTIONS] mountpoint | device" echo echo "mountpoint must be on a LVM-managed block device" + echo "-n: Show what commands e2scrub would execute." echo "-r: Remove e2scrub snapshot and exit, do not check anything." echo "-t: Run fstrim if successful." echo "-V: Print version information and exit." @@ -68,8 +69,9 @@ exitcode() { exit "${ret}" } -while getopts "rtV" opt; do - case "${opt}" in +while getopts "nrtV" opt; do + case "${opt}" in + "n") DBG="echo Would execute: " ;; "r") reap=1;; "t") fstrim=1;; "V") print_version; exitcode 0;;