Skip to contentSkip to conversation

btrfs-progs: add fsck.btrfs stub and manpage

PATCH Superseded David Sterba 1 participant 2 messages Dec 9, 2013 – Dec 10, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: add fsck.btrfs stub and manpage

---
 fsck.btrfs          | 40 ++++++++++++++++++++++++++++++++++++++++
 man/Makefile        |  3 ++-
 man/fsck.btrfs.8.in | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 1 deletion(-)
 create mode 100755 fsck.btrfs
 create mode 100644 man/fsck.btrfs.8.in
fsck.btrfs new file +40 -0
new file mode 100755
index 000000000000..e90043a5cd45
@@ -0,0 +1,40 @@
+#!/bin/sh -f
+#
+# Copyright (c) 2013 SUSE
+#
+# copied from fsck.xfs
+# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+# fsck.btrfs is a type of utility that should exist for any filesystem and is
+# called during system setup when the corresponding /etc/fstab entries contain
+# non-zero value for fs_passno. (See fstab(5) for more.)
+#
+# Traditional filesystems need to run their respective fsck utility in case the
+# filesystem was not unmounted cleanly and the log needs to be replayed before
+# mount. This is not needed for BTRFS. You should set fs_passno to 0.
+#
+# If you wish to check the consistency of a BTRFS filesystem or repair a
+# damaged filesystem, see btrfs(8) subcommand 'check'. By default the
+# filesystem consistency is checked, the repair mode is enabled via --repair
+# option (use with care!).
+
+AUTO=false
+while getopts ":aApy" c
+do
+	case $c in
+	a|A|p|y)	AUTO=true;;
+	esac
+done
+eval DEV=\${$#}
+if [ ! -e $DEV ]; then
+	echo "$0: $DEV does not exist"
+	exit 8
+fi
+if $AUTO; then
+	echo "$0: BTRFS file system."
+else
+	echo "If you wish to check the consistency of a BTRFS filesystem or"
+	echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
+fi
+exit 0
man/Makefile +2 -1
index eb91e0c536a4..552c9f767075 100644
@@ -13,7 +13,8 @@ man8dir = $(mandir)/man8
 
 MANPAGES = mkfs.btrfs.8.gz btrfsck.8.gz btrfs-image.8.gz btrfs.8.gz \
 	   btrfs-debug-tree.8.gz btrfs-show-super.8.gz btrfs-find-root.8.gz \
-	   btrfs-convert.8.gz btrfstune.8.gz btrfs-zero-log.8.gz btrfs-map-logical.8.gz
+	   btrfs-convert.8.gz btrfstune.8.gz btrfs-zero-log.8.gz btrfs-map-logical.8.gz \
+	   fsck.btrfs.8.gz
 INFILES = ${MANPAGES:.in=.gz}
 
 all: $(MANPAGES)
man/fsck.btrfs.8.in new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
1.8.5
#1 lore raw

PATCH v2 1/1 btrfs-progs: add fsck.btrfs stub and manpage

---
v2:
* install the new file

 Makefile            |  1 +
 fsck.btrfs          | 40 ++++++++++++++++++++++++++++++++++++++++
 man/Makefile        |  3 ++-
 man/fsck.btrfs.8.in | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100755 fsck.btrfs
 create mode 100644 man/fsck.btrfs.8.in
Makefile +1 -0
index 0874a412ebb8..278ef4c13ad0 100644
@@ -236,6 +236,7 @@ $(CLEANDIRS):
 install: $(libs) $(progs) $(INSTALLDIRS)
 	$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
 	$(INSTALL) $(progs) $(DESTDIR)$(bindir)
+	$(INSTALL) fsck.btrfs $(DESTDIR)$(bindir)
 	# btrfsck is a link to btrfs in the src tree, make it so for installed file as well
 	$(LN) -f $(DESTDIR)$(bindir)/btrfs $(DESTDIR)$(bindir)/btrfsck
 	$(INSTALL) -m755 -d $(DESTDIR)$(libdir)
fsck.btrfs new file +40 -0
new file mode 100755
index 000000000000..e90043a5cd45
@@ -0,0 +1,40 @@
+#!/bin/sh -f
+#
+# Copyright (c) 2013 SUSE
+#
+# copied from fsck.xfs
+# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+# fsck.btrfs is a type of utility that should exist for any filesystem and is
+# called during system setup when the corresponding /etc/fstab entries contain
+# non-zero value for fs_passno. (See fstab(5) for more.)
+#
+# Traditional filesystems need to run their respective fsck utility in case the
+# filesystem was not unmounted cleanly and the log needs to be replayed before
+# mount. This is not needed for BTRFS. You should set fs_passno to 0.
+#
+# If you wish to check the consistency of a BTRFS filesystem or repair a
+# damaged filesystem, see btrfs(8) subcommand 'check'. By default the
+# filesystem consistency is checked, the repair mode is enabled via --repair
+# option (use with care!).
+
+AUTO=false
+while getopts ":aApy" c
+do
+	case $c in
+	a|A|p|y)	AUTO=true;;
+	esac
+done
+eval DEV=\${$#}
+if [ ! -e $DEV ]; then
+	echo "$0: $DEV does not exist"
+	exit 8
+fi
+if $AUTO; then
+	echo "$0: BTRFS file system."
+else
+	echo "If you wish to check the consistency of a BTRFS filesystem or"
+	echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
+fi
+exit 0
man/Makefile +2 -1
index eb91e0c536a4..552c9f767075 100644
@@ -13,7 +13,8 @@ man8dir = $(mandir)/man8
 
 MANPAGES = mkfs.btrfs.8.gz btrfsck.8.gz btrfs-image.8.gz btrfs.8.gz \
 	   btrfs-debug-tree.8.gz btrfs-show-super.8.gz btrfs-find-root.8.gz \
-	   btrfs-convert.8.gz btrfstune.8.gz btrfs-zero-log.8.gz btrfs-map-logical.8.gz
+	   btrfs-convert.8.gz btrfstune.8.gz btrfs-zero-log.8.gz btrfs-map-logical.8.gz \
+	   fsck.btrfs.8.gz
 INFILES = ${MANPAGES:.in=.gz}
 
 all: $(MANPAGES)
man/fsck.btrfs.8.in new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
1.8.5