+2000-10-24 <tytso@snap.thunk.org>
+
+ * mke2fs.c (PRS, main), mke2fs.8.in: Add support for the -j
+ option, which builds an ext2/3 filesystem with an ext3
+ journal.
+
2000-10-24 <tytso@valinux.com>
* mke2fs.c (zap_sector): Fix really stupid typo which gcc 2.95
.I bytes-per-inode
]
[
+.B \-j
+.I megabytes-for-journal
+]
+[
.B \-N
.I number-of-inodes
]
filesystem after it is created, so be careful decided the correct
value for this parameter.
.TP
+.BI \-j " megabytes-for-journal"
+Build the ext2 filesystem with the ext3 journaling feature enabled.
+Megabyts-for-journal specifies the size of the journal in MB
+(1024*1024 bytes). Any size between 4MB and 100MB may be used.
+Of course, the journal must be small enough to fit into the filesystem.
+.TP
.B \-n
causes mke2fs to not actually create a filesystem, but display what it
would do if it were to create a filesystem.
int super_only = 0;
int force = 0;
int noaction = 0;
+int journal_size = 0;
char *bad_blocks_filename = 0;
__u32 fs_stride = 0;
if (argc && *argv)
program_name = *argv;
while ((c = getopt (argc, argv,
- "b:cf:g:i:l:m:no:qr:R:s:tvI:ST:FL:M:N:O:V")) != EOF)
+ "b:cf:g:i:j:l:m:no:qr:R:s:tvI:ST:FL:M:N:O:V")) != EOF)
switch (c) {
case 'b':
blocksize = strtoul(optarg, &tmp, 0);
exit(1);
}
break;
+ case 'j':
+ journal_size = strtoul(optarg, &tmp, 0);
+ if (journal_size < 4 || journal_size > 100 || *tmp) {
+ com_err(program_name, 0,
+ _("bad journal size - %s"), optarg);
+ exit(1);
+ }
+ break;
case 'l':
bad_blocks_filename = malloc(strlen(optarg)+1);
if (!bad_blocks_filename) {
errcode_t retval = 0;
ext2_filsys fs;
badblocks_list bb_list = 0;
+ int journal_blocks;
struct ext2fs_sb *s;
#ifdef ENABLE_NLS
zap_sector(fs, 0);
#endif
}
+ if (journal_size) {
+ if (!quiet)
+ printf(_("Creating journal: "));
+ journal_blocks = journal_size * 1024 /
+ (fs->blocksize / 1024);
+ retval = ext2fs_add_journal_fs(fs, journal_blocks);
+ if (retval) {
+ com_err (program_name, retval,
+ _("while trying to create journal"));
+ exit(1);
+ }
+ if (!quiet)
+ printf(_("done\n"));
+ }
if (!quiet)
printf(_("Writing superblocks and "