Whamcloud - gitweb
mke2fs.c, ChangeLog, mke2fs.8.in:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 29 Jun 1999 14:37:35 +0000 (14:37 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 29 Jun 1999 14:37:35 +0000 (14:37 +0000)
  mke2fs.c (check_mount): Allow a filesystem to be made even if it
   appears mounted if the force option is given.

misc/ChangeLog
misc/mke2fs.8.in
misc/mke2fs.c

index 6a94aeb..668b4c5 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-29    <tytso@valinux.com>
+
+       * mke2fs.c (check_mount): Allow a filesystem to be made even if it
+               appears mounted if the force option is given.
+
 1999-06-24    <tytso@valinux.com>
 
        * mke2fs.8.in: Fix typo in man page which caused the badblocks
index 94cb969..57423d2 100644 (file)
@@ -156,7 +156,7 @@ Verbose execution.
 Force 
 .B mke2fs
 to run, even if the specified device is not a 
-block special device.
+block special device, or appears to be mounted.
 .TP
 .I -L
 Set the volume label for the filesystem.
index 9469d16..1eb7a6e 100644 (file)
@@ -175,10 +175,15 @@ static void check_mount(NOARGS)
        }
        if (!(mount_flags & EXT2_MF_MOUNTED))
                return;
-       
-       fprintf(stderr, "%s is mounted; will not make a filesystem here!\n",
-               device_name);
-       exit(1);
+
+       fprintf(stderr, "%s is mounted; ", device_name);
+       if (force) {
+               fprintf(stderr, "mke2fs forced anyway.  "
+                       "Hope /etc/mtab is incorrect.\n");
+       } else {
+               fprintf(stderr, "will not make a filesystem here!\n");
+               exit(1);
+       }
 }
 
 /*