summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-04-12 20:19:32 +0000
committergreen <green@FreeBSD.org>2004-04-12 20:19:32 +0000
commit92223ccc320972e0072034695fa655271a5d1d3c (patch)
tree5639bc4043d3ebcd492765f05220f14ef3bc4705 /sbin/dump
parent01487d9cea3d5d83bec7ada358dd14c5bae93e4f (diff)
downloadFreeBSD-src-92223ccc320972e0072034695fa655271a5d1d3c.zip
FreeBSD-src-92223ccc320972e0072034695fa655271a5d1d3c.tar.gz
Improve the warnings for dump -L and do not bother doing the snapshot if
it is specified for read-only filesystems. Submitted by: Jason Young <jyoung8607@hotmail.com> PR: 46672
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/dump.81
-rw-r--r--sbin/dump/main.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/sbin/dump/dump.8 b/sbin/dump/dump.8
index 2abb594..0e86ebe 100644
--- a/sbin/dump/dump.8
+++ b/sbin/dump/dump.8
@@ -211,6 +211,7 @@ takes a snapshot of the file system in the
directory in the root of the filesystem being dumped and
then does a dump of the snapshot.
The snapshot is removed when the dump is complete.
+This option is ignored for unmounted or read-only filesystems.
If the
.Pa .snap
directory does not exist in the root of the filesystem being dumped,
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index c6beb2a..baf8a25 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -309,9 +309,16 @@ main(int argc, char *argv[])
spcl.c_filesys[NAMELEN-1]='\0';
if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
- if (snapdump == 0) {
- msg("WARNING: %s\n",
- "should use -L when dumping live filesystems!");
+ if (mntflags & MNT_RDONLY) {
+ if (snapdump != 0) {
+ msg("WARNING: %s\n",
+ "-L ignored for read-only filesystem.");
+ snapdump = 0;
+ }
+ } else if (snapdump == 0) {
+ msg("WARNING: %s%s\n",
+ "should use -L when dumping live read-write ",
+ "filesystems!");
} else {
char snapname[BUFSIZ], snapcmd[BUFSIZ];
OpenPOWER on IntegriCloud