summaryrefslogtreecommitdiff
path: root/misc
AgeCommit message (Collapse)AuthorFilesLines
2008-07-06mke2fs: Print a better error msg when ext2fs_get_device_size() returns EFBIGTheodore Ts'o1-0/+8
Print a message when mke2fs uses a default blocksize from an external journal device, and print a more self-explanatory message so that if that blocksize is used and ext2fs_get_device_size() returns EFBIG, the user has a better chance of understanding why mke2fs issued that error message. Addresses-Debian-Bug: #488663 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06mke2fs: Use a fs_type of 'journal' when creating an external journalTheodore Ts'o1-19/+10
If creating a an external journal via "mke2fs -O journal_dev", override the fs_type list (i.e., "ext2", "small"), and replace it with an fs_type list of "journal". This will prevent external journals smaller than 512MB from being created with a block size of 1k, which is not very useful and leads to much confusion. Addresses-Debian-Bug: #488663 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06badblocks: Fix crash when lots of -t patterns givenTheodore Ts'o1-1/+2
With more than 8 -t patterns given, badblocks will overwrite the t_patts array boundary due to realloc not taking into account the size of an int. Oops. Addresses-Debian-Bug: 487298 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-06Clean up some trivial build warningsEric Sandeen3-6/+5
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-28blkid: use list_for_each_safe in garbage collectionEric Sandeen1-1/+2
We need to use list_for_each_safe in case a device gets removed from the list during garbage collection. Also make the manpage slightly more informative about what the -g garbage collection option does. Addresses-Debian-Bug: #487758, #487783 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-21badblocks: fix a bug in the read throttlingIustin Pop1-2/+3
The previous patch was missing an #include and thus the compiler didn't catch the (now obvious) error. Signed-off-by: Iustin Pop <iustin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17Merge branch 'maint'Theodore Ts'o2-4/+4
Conflicts: README resize/online.c version.h
2008-06-17mke2fs, tune2fs, resize2fs: Use floating point to calculate percentagesTheodore Ts'o2-4/+4
When calculating the number reserved blocks, use floating point for better accuracy, since for big filesystems it really makes a difference. In addition, mke2fs and tune2fs accepts a floating point number from the user, so they should provide that level of accuracy. Addresses-Debian-Bug: #452639 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-17badblocks: implement read throttlingIustin Pop2-2/+43
Currently, badblocks will read as fast as it can from the drive. While this is what one wants usually, if badblocks is run in read-only mode on a drive that is in use, it will greatly degrade the other users of this disk. This patch adds a throttling mode for reads where each read will be delayed by a percentage of the time the previous read took; i.e., an invocation of '-d 100' will cause the sleep to be the same as the read took, a value of 200 will cause the sleep to be twice as high, and a value of 50 will cause it to be half. This will not be done if the previous read had errors, since then the hardware will possibly have timeouts and that would decrease the speed too much. This algorithm helps when the disk is used by other processes as then, due to the increased load, the time spent doing the reads will be higher, and correspondingly badblocks will sleep even more and thus it will use less of the drive's bandwidth. This is different from using ionice, as it is a voluntary (and partial) throttling. Signed-off-by: Iustin Pop <iustin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17badblocks: fix a possible bug in parse_uintIustin Pop1-0/+1
Currently, the parse_uint() function checks errno after the strtoul() call. But, according to the man page of strtoul(): Since strtoul() can legitimately return 0 or LONG_MAX (LLONG_MAX for strtoull()) on both success and failure, the calling program should set errno to 0 before the call, and then determine if an error occurred by checking whether errno has a nonzero value after the call. When using locales, it can happen that looking for the locale files is not successful, and therefore errno will have a nonzero value from this. And since the argument parsing is one of the first things done after startup, parse_uint() will wrongly report errors. The fix is to simply reset errno to zero before calling strtoul(). Signed-off-by: Iustin Pop <iustin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-17badblocks: add a max bad blocks count optionIustin Pop2-2/+46
Currently, badblocks will continue scanning the device until it reaches last_block, even though it might be that the drive is not responding at all anymore. This patch introduces a new parameter ('-e') that allows one to specify the maximum bad block count; if badblocks sees more than this number, it will abort the test. While this is not useful for testing a device that will need to be used as a filesystem (because we don't get an exhaustive list of bad blocks), it is useful for testing if a device has bad blocks at all: for example, with a count of 1, it will finish after the first error thus not needing to test the whole device if the only purpose of the test is to check for any bad blocks. Signed-off-by: Iustin Pop <iustin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-06-07e2undo: Enable missing pieces to enable I18N for this applicationTheodore Ts'o2-1/+8
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07Add "#include <limits.h>" to get PATH_MAX for mke2fs and tune2fsTheodore Ts'o2-0/+2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07Merge branch 'maint'Theodore Ts'o1-0/+4
2008-06-07fsck: Fix build problem on MacOS XTheodore Ts'o1-0/+4
Addresses-Sourceforge-Bug: #1972473 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07Fix gcc -Wall warnings in tune2fsTheodore Ts'o1-26/+28
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-14Install {mkfs,fsck}.{ext4,ext4dev} binary and man pagesTheodore Ts'o1-5/+18
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-14Add ext4dev stanza to mke2fs.confTheodore Ts'o1-0/+5
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-05-14mke2fs: Add the ability to configure default extended options in mke2fs.confTheodore Ts'o2-3/+21
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27Merge branch 'next' into tt/flex-bgTheodore Ts'o7-94/+961
2008-04-27tune2fs: Support for large inode migration.Aneesh Kumar K.V1-2/+524
Add new option -I <inode_size> to tune2fs. This is used to change the inode size. The size need to be multiple of 2 and we don't allow to decrease the inode size. As a part of increasing the inode size we increase the inode table size. We also move the used data blocks around and update the respective inodes to point to the new block tune2fs uses the undo I/O manager when migrating to large inode. This helps in reverting the changes if end results are not correct. The environment variable TUNE2FS_UNDO_DIR is used to indicate the directory within which the tdb file need to be created. The file will be named tune2fs-<device-name> If TUNE2FS_UNDO_DIR is not set /var/lib/e2fsprogs is used Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27mke2fs: Add support for the undo I/O manager.Aneesh Kumar K.V2-77/+149
When running mke2fs, if a file system is detected on the device, we use Undo I/O manager as the io manager. This helps in reverting the changes made to the filesystem in case we wrongly selected the device. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27Add e2undo commandAneesh Kumar K.V3-3/+271
The e2undo command can be used to replay the transaction saved in the transaction file using undo I/O Manager. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27mke2fs: Make argument to the extended option lazy_itable_init optionalTheodore Ts'o2-11/+7
Also remove some debugging printf's left over from a previous patch. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-27Merge branch 'maint'Theodore Ts'o1-1/+10
Conflicts: tests/m_raid_opt/expect.1
2008-04-27mke2fs: Don't allow the combination of the meta_bg and resize_inode featuresTheodore Ts'o1-1/+10
The combination of meta_bg and resize_inode leads to a corrupt filesystem, and it's not really clear it makes any logical sense. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-22mke2fs: New bitmap and inode table allocation for FLEX_BGTheodore Ts'o3-3/+56
Change the way we allocate bitmaps and inode tables if the FLEX_BG feature is used at mke2fs time. It places calculates a new offset for bitmaps and inode table base on the number of groups that the user wishes to pack together using the new "-G" option. Creating a filesystem with 64 block groups in a flex group can be done by: mke2fs -j -I 256 -O flex_bg -G 32 /dev/sdX Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Valerie Clement <valerie.clement@bull.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-04-22mke2fs/libext2fs: Fix lazy inode table initializationTheodore Ts'o1-10/+19
This fixes some bugs which I introduced recently while revamping the uninit_bg code. Since mke2fs is no longer calling ext2fs_set_gdt_csum(), it's important that ext2fs_initialize() correctly initialize bg_itable_unused for all block group descriptors. In addition, mke2fs needs to zero out the the reserved inodes based on the values of bg_itable_unused set by ext2fs_initialize(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-21Transfer responsibility of setting the *_UNINIT flags to libext2fsTheodore Ts'o1-49/+5
Mke2fs used to have special case, ugly code in setup_lazy_bg/setup_uninit_bg flag which set the flags based on all sorts of special cases. Change it so that it is done in libext2fs, and fix mke2fs to use alloc_stats functions which will take care of clearing the *_UNINIT flags automatically as needed. This is preparatory work to make the flex_bg allocation patch much cleaner. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-20Remove LAZY_BG featureTheodore Ts'o2-58/+25
This simplifies the code, and using the uninit_bg with the inode table lazily initialized is just as good. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-18mke2fs: Disentangle lazy_bg from uninit_bg's lazy inode table initializationTheodore Ts'o3-10/+72
Instead of using -O lazy_bg,uninit_bg as the way of requesting that the inode table be lazy unitialized, use the parameter lazy_itable_init, which can either be set via mke2fs's -E option, or via /etc/mke2fs.conf. Also fix some random problems in mke2fs's man page, including documenting the extent feature, which had been missing. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17Rename the feature uninit_groups to uninit_bgTheodore Ts'o2-4/+4
Allow the old name of uninit_groups when converting feature names for backwards compatibility for scripts running mke2fs and tune2fs. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17Add support for the HUGE_FILE featureTheodore Ts'o1-1/+6
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-06New mke2fs filesystem and usage types supportTheodore Ts'o4-74/+388
Provide mke2fs with a much more sophisticated system for controlling configuration parameters of a newly created filesystem based on a split filesystem and usage type system. The -t option to mke2fs was a deprecated alias to -c; it now specifies a filesystem type (ext2, ext3, ext4, etc.), while the -T option can now be a comma separated usage list. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-01dumpe2fs: Print the group checksum and the block options in a nicer wayTheodore Ts'o1-2/+8
Also add support for printing the ITABLE_ZERO flag Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-31ext2fs_set_gdt_csum(): Return an error code on errors instead of voidAndreas Dilger1-2/+8
Change the function signature so that ext2fs_set_gdt_csum() returns an error code. If the inode bitmap hasn't been loaded return EXT2_ET_NO_INODE_BITMAP. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-30Improve ext4 feature descriptions in mke2fs and tune2fs man pagesAndreas Dilger2-8/+16
Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-30Merge branch 'maint'Theodore Ts'o5-7/+47
2008-03-30Use -E instead of the deprecated -R option in the mke2fs man pageAndreas Dilger1-1/+1
Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-27logsave: Pass any SIGTERM or SIGINT signals to child processTheodore Ts'o1-0/+25
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-26fsck: Treat "ext4" and "ext4dev" as ext* filesystemsTheodore Ts'o1-2/+8
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-26fsck: Make -Cn work correctly where n != 0Theodore Ts'o1-4/+10
Previously, fsck was only passing in -Cn to the first e2fsck process to start up, and enabling the progress information by sending a SIGUSR1 signal. This didn't work if the progress information was intended to go to file descriptor, since the information was never passed to e2fsck. So we now pass the progress fd in as a negative number if the progress information is intended to be initially suppressed. Addresses-Launchpad-Bug: #203323 Addresses-Sourceforge-Bug: #1926023 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-26fsck: Fix -C handling so that subsequent progress bars are enabledTheodore Ts'o1-0/+1
The exiting fsck instance wasn't marked as DONE, so the safety checks thought a progress bar was still in progress, and so we didn't enable another filesystem's checking. Addresses-Debian-Bug: #432865 Addresses-Launchpad-Bug: #203323 Addresses-Sourceforge-Bug: #1926023 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-21mke2fs: Clarify man page that -T is interpreted using the current timezoneTheodore Ts'o1-0/+1
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-21debugfs, tune2fs: Handle daylight savings time when parsing a time stringTheodore Ts'o1-0/+1
We need to set tm_isdst to -1 so that mktime will automatically determine whether or not daylight savings time (DST) is in effect. Previously tm_isdst was set to 0, which caused mktime to interpret the time as if it was always not using DST. Addresses-Debian-Bug: #471882 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20Make dumpe2fs uninit block group awareJose R. Santos1-4/+9
Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20Make tune2fs uninit block group awareJose R. Santos2-1/+13
Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-20Add support for creating filesystems using uninit block groupJose R. Santos2-12/+39
Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-17Fix miscellaneous gcc -Wall warningsTheodore Ts'o8-27/+32
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-03-15Merge branch 'maint'Theodore Ts'o1-15/+29