From 2a2d8e1962e8b6cda7b0a7584f6d2fb95d442cb6 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 14 Feb 2013 12:30:03 -0600 Subject: btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table The core of this is shamelessly stolen from xfsprogs. Use blkid to detect an existing filesystem or partition table on any of the target devices. If something is found, require the '-f' option to overwrite it, hopefully avoiding disaster due to mistyped devicenames, etc. # mkfs.btrfs /dev/sda1 WARNING! - Btrfs v0.20-rc1-59-gd00279c-dirty IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using /dev/sda1 appears to contain an existing filesystem (xfs). Use the -f option to force overwrite. # This does introduce a requirement on libblkid. Signed-off-by: Eric Sandeen --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 456dd4f2..bea8ae96 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@ INSTALL = install prefix ?= /usr/local bindir = $(prefix)/bin -LIBS=-luuid -lm -lz +LIBS=-luuid -lblkid -lm -lz ifeq ("$(origin V)", "command line") BUILD_VERBOSE = $(V) -- cgit v1.2.3