summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2005-02-20 06:33:18 +0000
committerdelphij <delphij@FreeBSD.org>2005-02-20 06:33:18 +0000
commiteba8271ca01f0817e7a286a4679d21a5291f5f00 (patch)
tree97785c61073473b9941980736d2f7526fae29734 /sbin/newfs
parentaa96e34a9c91b1e904da6b6948a04d46adb8f15d (diff)
downloadFreeBSD-src-eba8271ca01f0817e7a286a4679d21a5291f5f00.zip
FreeBSD-src-eba8271ca01f0817e7a286a4679d21a5291f5f00.tar.gz
When creating a new FFS file system, the block size will indirectly
affect the largest file size that is allowed by the file system. On the other hand, when creating a snapshot, the snapshot file will appear as it is as big as the file system itself. Hence we will not be able to create a file system on large file systems with small block sizes. Add a warning about this, and gives some hints to correct the issue. Reviewed by: mckusick MFC After: 1 week
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index b796aef..0b653d5 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -280,6 +280,16 @@ mkfs(struct partition *pp, char *fsys)
sizepb *= NINDIR(&sblock);
sblock.fs_maxfilesize += sizepb;
}
+
+ /*
+ * It's impossible to create a snapshot in case that fs_maxfilesize
+ * is smaller than the fssize.
+ */
+ if (sblock.fs_maxfilesize < (u_quad_t)fssize) {
+ warnx("WARNING: You will be unable to create snapshots on this "
+ "file system. Correct by using a larger blocksize.");
+ }
+
/*
* Calculate the number of blocks to put into each cylinder group.
*
OpenPOWER on IntegriCloud