Commit Graph

74 Commits (cfc19311947dc4bd1731f641a8c52135a02e5559)

Author SHA1 Message Date
Theodore Ts'o 6cb27404f5 Add support for the test_fs flag
The test_fs flag is an "ok to be used with test kernel code" flag.  It
makes it easier for us to determine whether a filesystem should be
mounted using ext4 or not.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-26 21:47:40 -05:00
Theodore Ts'o 058ad1c70c Don't write changes to the backup superblocks by default
This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default.  This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups.  In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched.  So let's change the defaults to avoid
potential problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-18 18:26:50 -04:00
Theodore Ts'o a6d8302b48 Use the newer add/remove_error_table com_err interfaces
Change all of the e2fsprogs programs to use the newer add_error_table()
and remove_error_table() interfaces instead of the much older
initialize_*_error_table() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-12-26 03:38:07 -05:00
Theodore Ts'o a8862d9e90 Fix potential 2**32-1 overflow by using e2p_percent()
Add a new functiom, e2p_percent(), which correct calculates the percentage
of a number based on a given percentage, without worrying about overflow
issues.  This is used where we calculate the number of reserved blocks using
a percentage of the total number of blocks in a filesystem.

Based on patches from Eric Sandeen, but generalized to use this new function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
2006-08-30 03:08:13 -04:00
Theodore Ts'o f51d0eff90 Remove needless sanity check in tune2fs's -i option.
We were complaining with a confusing error message if the user tried to specify
a check interval larger than a 365 days.  It's probably a bad idea if the user wants to
do this, but it's not worth it to complain.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-05-14 17:30:51 -04:00
Andreas Dilger ce911145ed Allow fractional percentages to the -m option in mke2fs and tune2fs
Allow the reserved blocks ratio to be specified in fractional
percentages.  

Addresses-Debian-Bug: #80205
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2005-07-06 11:50:08 -05:00
Theodore Ts'o bb145b01cf Fix e2fsprogs messages for grammar and consistency, based on suggestions
from Benno Schulenberg.

Add missing _() so all strings can be internationalized.
2005-06-20 08:35:27 -04:00
Theodore Ts'o f35fd3d5ee Fix some minor typo's and grammar's strings, and remove debugging strings
from needing to be translated.  Patch is from Benno Schulenberg.
2005-05-09 16:22:17 -04:00
Theodore Ts'o 07f031fd1d Define _XOPEN_SOURCE to be 500 to fix compilation problems on Solaris. 2005-02-03 20:38:52 -05:00
Theodore Ts'o 32237014a1 Various portability fixes for Solaris systems. 2005-01-17 19:13:39 -05:00
Theodore Ts'o 22ba4c1ded Make tune2fs and e2fsck consistent about allowing at most 50% of the blocks
in a filesystem to be reserved for allocation by the root user.
2005-01-06 14:05:17 -05:00
Theodore Ts'o 690e693caf tune2fs.c (parse_time): Fix minor buglet; the parse_time routine
should use the passed-in argument, not optarg, even though
	the two are the same in the case of the current caller of
	said function.  (i.e., no user-visible problems were caused
	by this, even though the code was wrong).
2004-12-21 20:40:08 -05:00
Theodore Ts'o 2e8ca9a26b Add support for passing options to the io layer using the URL syntax. For
example, /tmp/test.img?offset=1024.  Multiple options can separated using
the & character, although at the moment the only option implemented is
the offset option in the unix_io layer.
2004-11-30 14:07:11 -05:00
Theodore Ts'o d06863f0e5 Remove TUNE2FS_SKIP_MOUNT_CHECK environment variable support; it is
not needed in the initrd script, and wasn't completely supported 
anyway.
2004-04-12 12:37:55 -04:00
Theodore Ts'o 2eb3b20e80 tune2fs.c (main): If the environment variable
TUNE2FS_SKIP_MOUNT_CHECK is set, do not try 
	to check if the filesystem is mounted.
(update_feature_set): If the compatibility bitmasks were
	not modified, don't set the superblock dirty bit.
2004-04-07 09:27:36 -04:00
Matthias Andree b969b1b8a5 Fix more compiler warnings. 2003-12-28 13:04:35 +01:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 817e49e3ce Check the returned name from blkid_get_devname in tune2fs and
e2fsck, and print an error if the requested LABEL/UUID does 
not exist (previously, we core dumped!)
2003-11-21 09:10:29 -05:00
Theodore Ts'o 2a29f1354f Add --enable-test-io-debug configure option which causes e2fsck and
tune2fs to use the test I/O manager.

The test I/O manager has been changed to not do anything extra by 
default, unless the TEST_IO_FLAGS and/or TEST_IO_BLOCK environment
variables are set, which controls what I/O operations are logged and
a block number to watch, respectively.  The log messages are sent to
stderr by default, unless a filename is specified via the 
TEST_IO_LOGFILE environment variable.
2003-05-05 12:08:47 -04:00
Theodore Ts'o bc7c14e040 tune2fs.c (parse_time): Add portability code to work around lack
of strptime().
2003-05-03 16:40:09 -04:00
Theodore Ts'o 332f2c2382 tune2fs.c (parse_tune2fs_options, parse_e2label_options): Allow
the device name to be specified using LABEL=xxx or
	UUID=xxx, since we're including the blkid library anyway.
	(Addresses Debian bugs #166048, #179671)
2003-03-06 12:58:33 -05:00
Theodore Ts'o ed1b33e8fb Minor bug fixes in the blkid library.
Convert mke2fs, fsck, and tune2fs to use the blkid library.
2003-03-01 19:29:01 -05:00
Theodore Ts'o a0c3fd5e4c Add support for new feature in ext2/3 filesystems; a default mount options field
in the superblock.  Added the tune2fs '-o' option to set this field.
2002-10-15 17:43:43 -04:00
Theodore Ts'o 3e69906495 Fix gcc -Wall nits.
Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
2002-10-13 23:56:28 -04:00
Theodore Ts'o 843049c4db mke2fs.c (main): Enable directory indexing by default.
tune2fs.c (update_feature_set): Allow directory indexing flag to
	be set.  If so, set the default hash to be TEA, and
	initialize the hash seed to a random value.
2002-09-22 15:37:40 -04:00
Theodore Ts'o 118d7dacc5 Add support for searching /proc/evms/volumes when interpreting
LABEL=xxx or UUID=xxx.  

Add new utility program /sbin/findfs, which interprets LABEL=xxx or
UUID=xxx, and returns the device name.  (Part of tune2fs).
2002-08-17 23:01:22 -04:00
Theodore Ts'o 14308a5398 Newer libintl needs LC_CTYPE to be set in addition to LC_MESSAGES. 2002-03-05 03:26:52 -05:00
Andreas Dilger 0072f8de52 Add check for mkfs.ext3 and create a journal in this case. 2002-02-25 23:11:26 -07:00
Andreas Dilger c007bc06d9 Return a non-zero exit code on error. 2001-12-25 23:10:40 -07:00
Theodore Ts'o d4de4aa938 tune2fs.8.in, tune2fs.c (parse_tune2fs_options, main): Add
support for new option, -T, which allows the user to set
	the last checked time on the filesystem.
2001-12-26 08:58:01 -05:00
Theodore Ts'o 4ea7bd0439 Fix various gcc -Wall nits. Fixed a bug in mke2fs where a bogus
error message could be printed on an malloc() failure, and e2image
was optimized to avoid needless system calls by using the stashed
inode functions.
2001-12-16 23:23:37 -05:00
Theodore Ts'o f6a6afcef4 Remove dead code that wasn't in use from tune2fs. 2001-09-19 18:27:39 -04:00
Theodore Ts'o 0f8973fb09 Remove EXT2FS_VERSION from the version display, since it
only confuses people.

Make fsck's version display be consistent with the other e2fsprogs
programs.
2001-08-27 12:44:23 -04:00
Theodore Ts'o e843c76016 Minor fixups to Andreas' changeset. Removed unused variable
from tune2fs and added missing function prototype.
2001-08-18 14:22:25 -04:00
Andreas Dilger 2d15576dfe get_device_by_label.[ch], fsck.c, util.c: New interpret_spec()
function in get_device_by_label.c to allow the use of
        UUID= or LABEL= when creating filesystems which use external
        journal dev (e.g.  mke2fs -J device=LABEL=<journal_label>).

tune2fs.c: Use superblock s_journal_uuid to locate an external
        journal device instead of s_journal_dev when removing it.
        Allow opening journal devices to set the label and UUID
        in the ext2 superblock.

mke2fs.c, tune2fs.c: Free journal_device after use, as it is
        malloc'd in interpret spec.
2001-08-17 03:48:11 -06:00
Theodore Ts'o 7141b54b1a * tune2fs.c: Make sure that error messages are sent to stderr, and
normal messages are sent to stdout.  (Addresses Debian bug
	#108555.)
2001-08-15 19:17:37 -04:00
Theodore Ts'o d258668d58 Give an error if -O is specified more than once to tune2fs. 2001-08-15 11:03:58 -04:00
Theodore Ts'o 194686bbae tune2fs.c (update_feature_set, remove_journal_inode): If
removing an in-filesystem journal, clear out the journal
	inode and update the filesystem accounting structures so
	we don't have to run e2fsck to clean up after ourselves
2001-07-31 12:03:23 -04:00
Theodore Ts'o de49f015a4 tune2fs.c (update_feature_set): Don't require a forced fsck if
we're removing an external journal from a filesystem.
2001-07-30 16:31:30 -04:00
Theodore Ts'o 66cf2f6035 ChangeLog, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:
tune2fs.c, mke2fs.c, util.c, util.h (print_check_message): Move the
  	message which displays how often the filesystem will be checked from
  	mke2fs into a utility subroutine.  Then cause tune2fs to call that
  	function to display the message after adding a journal to a
  	filesystem.
  mke2fs.8.in: Add manual page fixups and explanation for why it's good
  	to check filesystems periodically from Andreas Dilger.
2001-06-14 06:42:44 +00:00
Theodore Ts'o e549d0a6a8 ChangeLog, tune2fs.c:
tune2fs.c (update_feature_set): Fix capitalization typo.
2001-05-25 16:38:48 +00:00
Theodore Ts'o 54c637d4d2 Many files:
badblocks.c, chattr.c, dumpe2fs.c, e2image.c, findsuper.c, lsattr.c,
  	mke2fs.c, mklost+found.c, tune2fs.c, util.c: Change location of
  	ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, resize2fs.h:
  resize2fs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, debugfs.h:
  debugfs.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, e2fsck.h, scantest.c:
  e2fsck.h, scantest.c: Change location of ext2_fs.h to be
  	ext2fs/ext2_fs.h
ChangeLog, Makefile.in, tst_uuid.c, uuid_time.c:
  tst_uuid.c, uuid_time.c: Remove unneeded #include of ext2_fs.h
ChangeLog, Makefile.in, e2p.h:
  e2p.h: Change location of ext2_fs.h to be ext2fs/ext2_fs.h
ChangeLog, Makefile.in, test_icount.c, test_rel.c:
  test_icount.c, test_rel.c: Change location of ext2_fs.h to be
  	ext2fs/ext2_fs.h
2001-05-14 11:45:38 +00:00
Theodore Ts'o 8d6417498c ChangeLog:
Clarify some of the Changelog entries.
ChangeLog, fsck.8.in, mke2fs.8.in, tune2fs.8.in:
  fsck.8.in, mke2fs.8.in, tune2fs.8.in: Fix typo's and make other
  	clarifications suggested by Andreas Dilger.
ChangeLog, tune2fs.c:
  tune2fs.c (update_feature_set): Clean up some printf messages.
2001-05-14 04:12:27 +00:00
Theodore Ts'o ce57f14f40 ChangeLog, tune2fs.c:
tune2fs.c (parse_tune2fs_options): Interpret -c 0 as -c -1 (for
  	backwards compatibility with older kernels).  -c 0 makes more sense to
  	users.
tune2fs.8.in:
  Update tune2fs manual papge so that it is up to date.
2001-04-26 04:25:39 +00:00
Theodore Ts'o 4d0f22832c ChangeLog, tune2fs.c:
tune2fs.c (remove_journal_device): If the force flag is given, tune2fs
  	will remove the journal device information from the superblock even if
  	tune2fs failed to open the journal device or otherwise other failed to
  	remove the filesystem from journal device.
  	(parse_tune2fs_options): Fix -j option so that it works (it was
  	missing the open_flag being set to EXT2_FLAG_RW).
  	(main): Accept "-U clear" to set a null UID.
2001-04-23 20:58:03 +00:00
Theodore Ts'o 1d08d9bfc2 ChangeLog, mke2fs.c, tune2fs.c:
mke2fs.c, tune2fs.c: Add newlines to error messages so that they look
  	nicer.
2001-04-17 01:01:49 +00:00
Theodore Ts'o 2537b6d0c1 ChangeLog, mke2fs.8.in, mke2fs.c, tune2fs.8.in, tune2fs.c, util.c, util.h:
ke2fs.8.in, tune2fs.8.in: Change man paegs to document that the
  journal must be bewteen 1024 and 10,240 file system blocks.
  mke2fs.c, tune2fs.c: Change to use figure_journal_size()
  util.c, util.h (figure_journal_size): Change journal_default_size into
  	routine which also converts the requested journal size into filesystem
  	blocks and does bounds checking to make sure the journal is sized
  	reasonably.  Renamed function to journal_default_size.
  	parse_journal_opts): Remove bounds check for the journal size, since
  	this is now done in figure_journal_size, and based on the number of
  	filesystem blocks, as opposed to using the absolute size of the
  	journal.
2001-03-26 20:07:13 +00:00
Theodore Ts'o dc2ec525f5 ChangeLog, mke2fs.8.in, mke2fs.c, tune2fs.8.in, tune2fs.c:
tune2fs.c, mke2fs.c, tune2fs.8.in, mke2fs.8.in: Change user interface
  	so that -J is used to specify journal options, and -j is used to
  	request creation of a journal using default values.  (This is a UI
  	change, but we haven't done a formal release, and it makes things much
  	more consistent with the rest of the options out there.)
  tune2fs.c: Add support for removing a filesystem from an external
  	journal; we correctly remove the filesystem UUID from the external
  	journal's filesystem list.
2001-01-18 01:51:15 +00:00
Theodore Ts'o 16ed5b3af4 ChangeLog, Makefile.in, dumpe2fs.c, jfs_user.h, mke2fs.c, tune2fs.c:
tune2fs.c: Changed the external journal code so that it simply adds a
  	filesystem to a journal; the journal must have bene created via
  	"mke2fs -O journal_dev /dev/XXX".
  mke2fs.c: Add support for creating an external journal device by using
  	the command "mke2fs -O journal_dev /dev/XXX".  Also changed the
  	external journal code so -j device=/dev/XXX it simply adds a
  	filesystem to that journal; the journal must have been created via
  	separate step.
  dumpe2fs.c (print_journal_information): Add support for dumping
  	information about an external journal device.
2001-01-16 07:47:31 +00:00
Theodore Ts'o 08dd830ddd ChangeLog, tune2fs.8.in:
tune2fs.8.in: Add description of the -j option.
tune2fs.c:
  Minor whitespace and option ordering fixes from Andreas Dilger
2001-01-14 16:25:58 +00:00