summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-04-29 21:26:48 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-04-29 21:26:48 +0000
commita29f4d30f24d68f1f1c75548e020689ede532c05 (patch)
treef74e57c6188bc586c912a79da833236ad28f7233 /misc
parentae85148246952016865e2792b49d6b68649b6063 (diff)
downloade2fsprogs-a29f4d30f24d68f1f1c75548e020689ede532c05.tar.gz
Many files:
Checkin of e2fsprogs 1.10
Diffstat (limited to 'misc')
-rw-r--r--misc/ChangeLog25
-rw-r--r--misc/Makefile.in10
-rw-r--r--misc/mke2fs.8.in23
-rw-r--r--misc/mke2fs.c70
-rw-r--r--misc/tune2fs.8.in4
5 files changed, 121 insertions, 11 deletions
diff --git a/misc/ChangeLog b/misc/ChangeLog
index 66ab5a4a..7ad397a8 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,3 +1,28 @@
+Thu Apr 24 12:16:42 1997 Theodre Ts'o <tytso@localhost.mit.edu>
+
+ * Release of E2fsprogs version 1.10
+
+Thu Apr 24 09:52:47 1997 Theodre Ts'o <tytso@localhost.mit.edu>
+
+ * mke2fs.c: Added new option -R, which specifies RAID options.
+ Currently the only supported RAID option is "stride" which
+ specifies the stripe width in RAID filesystem. This is
+ used to aid in the placement of the inode and block
+ bitmaps.
+
+ * mke2fs.8.in, tune2fs.8.in: Added warnings that the sparse
+ superblock option isn't yet supported by most kernels.
+
+Wed Apr 23 22:42:51 1997 Theodre Ts'o <tytso@localhost.mit.edu>
+
+ * mke2fs.c (PRS): Make the default filesystem revision be 0, not
+ 1. (Since some people are still worried about 1.2.13
+ compatibility).
+
+Thu Apr 17 12:23:38 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * Release of E2fsprogs version 1.09
+
Fri Apr 11 18:57:24 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* chattr.1.in: Updated man page so that the 'A' attribute is
diff --git a/misc/Makefile.in b/misc/Makefile.in
index 768ff560..b0d06a20 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -161,11 +161,11 @@ distclean: clean
# Makefile dependencies follow. This must be the last section in
# the Makefile.in file
#
-tune2fs.o: $(srcdir)/tune2fs.c \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
- $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/uuid/uuid.h \
- $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/../version.h
+tune2fs.o: $(srcdir)/tune2fs.c $(top_srcdir)/lib/ext2fs/ext2fs.h \
+ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/io.h \
+ $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(top_srcdir)/lib/uuid/uuid.h $(top_srcdir)/lib/e2p/e2p.h \
+ $(srcdir)/../version.h
mklost+found.o: $(srcdir)/mklost+found.c $(srcdir)/../version.h
mke2fs.o: $(srcdir)/mke2fs.c $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/uuid/uuid.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in
index ab139a4c..de08f440 100644
--- a/misc/mke2fs.8.in
+++ b/misc/mke2fs.8.in
@@ -40,6 +40,12 @@ mke2fs \- create a Linux second extended file system
.B \-q
]
[
+.B \-r fs-revision-level
+]
+[
+.B -R raid_options
+]
+[
.B -s sparse-super-flag
]
[
@@ -120,7 +126,11 @@ Quiet execution. Useful if mke2fs is run in a script.
.I -s sparse-super-flag
If sparse-super-flag is 1, then turn on the sparse superblock flag.
If 0, then turn off the sparse superblock flag. (Currently, the sparse
-superblock flag defaults to off.)
+superblock flag defaults to off.)
+.B Warning:
+The Linux 2.0 kernel does not properly support this feature. Neither do
+all Linux 2.1 kernels; please don't use this unless you know what you're
+doing!
.TP
.I -v
Verbose execution.
@@ -137,6 +147,17 @@ Set the last mounted directory for the filesystem. This might be useful
for the sake of utilities that key off of the last mounted directory to
determine where the filesytem should be mounted.
.TP
+.I -r revision
+Set the filesystem revision for the new filesystem. Note that 1.2
+kernels only support revision 0 filesystems.
+.TP
+.I -R raid_options
+Set raid-related options for the filesystem. Raid options are common
+separated, and may take an argument using the equals ('=') sign.
+Currently the only supported argument is
+.I stride
+which takes as its argument the number of blocks in a RAID stripe.
+.TP
.I -S
Write superblock and group descriptors only. This is useful if all of
the superblock and backup superblocks are corrupted, and a last-ditch
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 475397d9..55412466 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -74,6 +74,7 @@ int quiet = 0;
int super_only = 0;
int force = 0;
char *bad_blocks_filename = 0;
+__u32 fs_stride = 0;
struct ext2_super_block param;
char *creator_os = NULL;
@@ -86,7 +87,8 @@ static void usage(NOARGS)
"[-f fragment-size]\n\t[-i bytes-per-inode] "
"[-m reserved-blocks-percentage] [-qvS]\n\t"
"[-o creator-os] [-g blocks-per-group] [-L volume-label]\n\t"
- "[-M last-mounted-directory] device [blocks-count]\n",
+ "[-M last-mounted-directory] [-r fs-revision] [-R raid_opts]\n\t"
+ "device [blocks-count]\n",
program_name);
exit(1);
}
@@ -536,6 +538,59 @@ static int set_os(struct ext2_super_block *sb, char *os)
#define PATH_SET "PATH=/sbin"
+static parse_raid_opts(const char *opts)
+{
+ char *buf, *token, *next, *p, *arg;
+ int len;
+ int raid_usage = 0;
+
+ len = strlen(opts);
+ buf = malloc(len+1);
+ if (!buf) {
+ fprintf(stderr, "Couldn't allocate memory to parse "
+ "raid options!\n");
+ exit(1);
+ }
+ strcpy(buf, opts);
+ for (token = buf; token && *token; token = next) {
+ p = strchr(token, ',');
+ next = 0;
+ if (p) {
+ *p = 0;
+ next = p+1;
+ }
+ arg = strchr(token, '=');
+ if (arg) {
+ *arg = 0;
+ arg++;
+ }
+ if (strcmp(token, "stride") == 0) {
+ if (!arg) {
+ raid_usage++;
+ continue;
+ }
+ fs_stride = strtoul(arg, &p, 0);
+ if (*p || (fs_stride == 0)) {
+ fprintf(stderr, "Invalid stride parameter.\n");
+ raid_usage++;
+ continue;
+ }
+ } else
+ raid_usage++;
+ }
+ if (raid_usage) {
+ fprintf(stderr, "\nBad raid options specified.\n\n"
+ "Raid options are separated by commas, "
+ "and may take an argument which\n"
+ "\tis set off by an equals ('=') sign.\n\n"
+ "Valid raid options are:\n"
+ "\tstride=<stride length in blocks>\n\n");
+ exit(1);
+ }
+}
+
+
+
static void PRS(int argc, char *argv[])
{
char c;
@@ -548,6 +603,7 @@ static void PRS(int argc, char *argv[])
int sparse_option = -1;
char *oldpath = getenv("PATH");
struct ext2fs_sb *param_ext2 = (struct ext2fs_sb *) &param;
+ char *raid_opts = 0;
/* Update our PATH to include /sbin */
if (oldpath) {
@@ -565,9 +621,6 @@ static void PRS(int argc, char *argv[])
setbuf(stderr, NULL);
initialize_ext2_error_table();
memset(&param, 0, sizeof(struct ext2_super_block));
-#ifdef EXT2_DYNAMIC_REV
- param.s_rev_level = EXT2_DYNAMIC_REV;
-#endif
fprintf (stderr, "mke2fs %s, %s for EXT2 FS %s, %s\n",
E2FSPROGS_VERSION, E2FSPROGS_DATE,
@@ -575,7 +628,7 @@ static void PRS(int argc, char *argv[])
if (argc && *argv)
program_name = *argv;
while ((c = getopt (argc, argv,
- "b:cf:g:i:l:m:o:qr:s:tvI:SFL:M:")) != EOF)
+ "b:cf:g:i:l:m:o:qr:R:s:tvI:SFL:M:")) != EOF)
switch (c) {
case 'b':
size = strtoul(optarg, &tmp, 0);
@@ -673,6 +726,9 @@ static void PRS(int argc, char *argv[])
case 'M':
mount_dir = optarg;
break;
+ case 'R':
+ raid_opts = optarg;
+ break;
case 'S':
super_only = 1;
break;
@@ -694,6 +750,9 @@ static void PRS(int argc, char *argv[])
if (optind < argc)
usage();
+ if (raid_opts)
+ parse_raid_opts(raid_opts);
+
if (!force)
check_plausibility();
check_mount();
@@ -807,6 +866,7 @@ int main (int argc, char *argv[])
test_disk(fs, &bb_list);
handle_bad_blocks(fs, bb_list);
+ fs->stride = fs_stride;
retval = ext2fs_allocate_tables(fs);
if (retval) {
com_err(program_name, retval,
diff --git a/misc/tune2fs.8.in b/misc/tune2fs.8.in
index 0e34085e..e65f3b53 100644
--- a/misc/tune2fs.8.in
+++ b/misc/tune2fs.8.in
@@ -103,6 +103,10 @@ adjust the reserved blocks count on the given device.
.I -s sparse_super_flag
sets and resets the sparse_superblock flag. The sparse_superblock feature
saves space on really big filesystems.
+.B Warning:
+The Linux 2.0 kernel does not properly support this feature. Neither do
+all Linux 2.1 kernels; please don't use this unless you know what you're
+doing!
.TP
.I -u user
set the user who can benefit from the reserved blocks.