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
This commit is contained in:
Brian Feldman 2004-04-12 20:19:32 +00:00
parent 57d9d1d762
commit f7c7b87fbd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128166
2 changed files with 11 additions and 3 deletions

View file

@ -211,6 +211,7 @@ takes a snapshot of the file system in the
directory in the root of the filesystem being dumped and directory in the root of the filesystem being dumped and
then does a dump of the snapshot. then does a dump of the snapshot.
The snapshot is removed when the dump is complete. The snapshot is removed when the dump is complete.
This option is ignored for unmounted or read-only filesystems.
If the If the
.Pa .snap .Pa .snap
directory does not exist in the root of the filesystem being dumped, directory does not exist in the root of the filesystem being dumped,

View file

@ -309,9 +309,16 @@ main(int argc, char *argv[])
spcl.c_filesys[NAMELEN-1]='\0'; spcl.c_filesys[NAMELEN-1]='\0';
if ((mntpt = getmntpt(disk, &mntflags)) != 0) { if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
if (snapdump == 0) { if (mntflags & MNT_RDONLY) {
if (snapdump != 0) {
msg("WARNING: %s\n", msg("WARNING: %s\n",
"should use -L when dumping live filesystems!"); "-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 { } else {
char snapname[BUFSIZ], snapcmd[BUFSIZ]; char snapname[BUFSIZ], snapcmd[BUFSIZ];