summaryrefslogtreecommitdiff
path: root/misc
AgeCommit message (Collapse)AuthorFilesLines
2011-09-15mke2fs: use "extent" consistently as a feature name in the man pageTheodore Ts'o1-1/+1
Addresses-Debian-Bug: #639411 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-14e2image: fix invalid lseek error detectionLukas Czerner1-1/+2
In flush_l2_cache() we are using ext2fs_llseek() however we do not properly detect the error code returned from the function, because we are assigning it into ULL variable, hence we will not see negative values. Fix this by changing the type of the variable to ext2_loff_t which is signed and hence will store negative values. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-13mke2fs.static: change library ordering to avoid a link errorTheodore Ts'o1-2/+2
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-13mke2fs: Use ext2fs_flush() only onceLukas Czerner4-12/+13
We are doing ext2fs_flush() twice right now at the end of the mke2fs. First by directly calling ext2fs_flush() which is intended to write superblock and fs accounting information. And then it is invoked again when we are calling ext2fs_close(), only this time, because the fs is not dirty, we are writing out only superblock. I think it is bad to call it twice because even when writing only super block it takes some time on bigger file systems and moreover ext2fs_close() can fail without any reasonable explanation for the user. Also ext2fs_flush() is printing out progress and it is confusing for the users. Fix all this by removing the ext2fs_flush() and leaving it all to ext2fs_close(). However we need to introduce new variables to store check interval and max mount count, because fs structure is freed on ext2fs_close() and we really want to print those information as the last info for the user. [ Fixed type mismatch in a printf format statement -tytso] Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-08-31tune2fs: Add support for turning on quota featureAditya Kali3-10/+167
This patch adds support for setting the quota feature in superblock and allows selectively creating quota inodes (user or group or both) in the superblock. Currently, modifying the quota feature is only supported when the filesystem is unmounted. Also, when setting the quota feature, tune2fs will use aquota.user or aquota.group file inode number in superblock if these files exist. Otherwise it will initialize empty quota inodes #3 and #4 and use them. Here is how it works: # Set quota feature and initialize both (user and group) quota inodes $ tune2fs -O quota /dev/ram1 # Enable only one type of quota $ tune2fs -Q usrquota /dev/ram1 # Enable grpquota, disable usrquota $ tune2fs -Q ^usrquota,grpquota /dev/ram1 # Clear quota feature and remove quota inodes $ tune2fs -O ^quota /dev/ram1 Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-08-31mke2fs: support creation of filesystem with quota featureAditya Kali3-7/+33
mke2fs also creates quota inodes (userquota: inode# 3 and groupquota: inode #4) inodes while creating a filesystem when 'quota' feature is set. # To set quota feature and initialize quota inodes during mke2fs: $mke2fs -t ext4 -O quota /dev/ram1 Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-07-17mke2fs: document stripe_width, not stripe-widthAndreas Dilger1-1/+1
For consistency with other multi-word options, document the extended option stripe_width instead of stripe-width. This also avoids the complexity of parsing options that have an embedded '-'. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-07-04Merge branch 'maint' into nextTheodore Ts'o2-8/+18
Conflicts: misc/tune2fs.c
2011-07-04mke2fs: allow setting the stride and stripe width to zeroTheodore Ts'o1-2/+2
Mke2fs previously would give an error if the user tried setting the stride and stripe-width parameters to zero; but this is necessary to override the stride and stripe-width settings which get automatically set from the block device's geometry information in sysfs. So allow setting these parameters to zero. Addresses-Google-Bug: #4988555 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-04tune2fs: Fix mount_opts handlingTheodore Ts'o1-4/+14
The extended options parsing for mount_opts was horribly buggy. Invalid mount options that had an argument would get interpreted as an extended mount options. Fix this. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-04tune2fs: allow setting the stride and stripe width to zeroTheodore Ts'o1-2/+2
Tune2fs previously would give an error if the user tried setting the stride and stripe-width parameters to zero; but this is necessary to disable the stride and stripe-width settings. So allow setting these superblock fields to zero. Addresses-Google-Bug: #4988557 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-19libext2fs: fix makefile dependency problemTheodore Ts'o1-3/+4
lib/ext2fs/Makefile.in had a buggy entry for blkmap64_ba.c in $(SRCS), which caused this source file to not have a valid Makefile dependency entry, so blkmap64_ba.o would not get rebuilt when it needed to be. Also updated the Makefile dependency for the misc directory while we're at it. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-16mke2fs: change bigalloc default cluster size to 16*blocksizeTheodore Ts'o1-1/+1
This was the original default, but it accidentally got changed to 4*blocksize in commit 4c2b28ab67. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-16Fix superblock field s_blocks_count for bigalloc file systemsTheodore Ts'o2-2/+3
Treat the s_blocks_count field in the superblock as a free block count (instead of the number of free clusters) for bigalloc file systems. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-15misc: quiet "unused variable" compiler warningsAndreas Dilger2-11/+4
Some of the newly-merged patches added "unused variable" compiler warnings. Delete unused variables. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-14mke2fs: add support for cluster size in mke2fs.confTheodore Ts'o2-9/+17
Add support for specifying the cluster size in mke2fs.conf Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-14mke2fs: Add support for [devices] stanza in mke2fs.confTheodore Ts'o2-5/+29
Add the [devices] stanza which allows device-specific defaults to be specified in the mke2fs.conf file. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-11mke2fs: skip zeroing journal blocksAndreas Dilger2-2/+25
Add the ability to skip zeroing journal blocks on disk. This can significantly speed up mke2fs with large journals. At worst the uninitialized journal is only a very short-term risk (if at all), because the journal will be overwritten on any new filesystem as soon as any significant amount of data is written to disk, and the new journal TID would need to match the offset/TID of an old commit block still left on disk. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11tune2fs: add dir_index feature to tune2fs man pageAndreas Dilger1-0/+3
Add description of missing dir_index feature to tune2fs(8) man page. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-11misc: clean up compiler warningsAndreas Dilger4-10/+10
Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-10mke2fs: support creating bigalloc file systemsTheodore Ts'o1-13/+58
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-07Merge branch 'maint' into nextTheodore Ts'o1-1/+1
Conflicts: misc/mke2fs.c
2011-06-07mke2fs: Don't erase flash device if "-n" is givenAndreas Dilger1-1/+1
If "mke2fs -n" is used, there should be no changes to the underlying device. Unfortunately, when the "discard" option was added in commit c7cd908be59f48c66b4f3ac9a631ffe3dde4f1ab, it did not check for the "-n" flag, and will discard all data on a flash device even if "-n" is given. Check for the "noaction" flag before discarding any filesystem data. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-06-04Merge branch 'maint' into nextTheodore Ts'o2-17/+20
Conflicts: lib/ext2fs/bitmaps.c lib/ext2fs/rw_bitmaps.c misc/dumpe2fs.c
2011-06-04dumpe2fs: teach dumpe2fs to be cluster awareTheodore Ts'o1-15/+17
Add support to dumpe2fs so it can display the block bitmaps correctly for bigalloc file systems. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-06-04libext2fs: change fs->clustersize to fs->cluster_ratio_bitsTheodore Ts'o1-2/+3
The log2 of the ratio of cluster size to block size is far more useful than just storing the cluster size. So make this change, and then define basic utility macros: EXT2FS_CLUSTER_RATIO(), EXT2FS_CLUSTER_MASK(), EXT2FS_B2C(), EXT2FS_C2B(), and EXT2FS_NUM_B2C(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-05-31Merge branch 'maint' into nextTheodore Ts'o2-3/+12
Conflicts: misc/tune2fs.c
2011-05-31tune2fs: Fix overflow of interval checkKazuya Mio1-0/+6
Add the check of maximum check interval. s_checkinterval is 32bit variable, so it cannot be set more than 2^32. Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-31e2fsprogs: Unify the upper limit of reserved blocks countKazuya Mio1-1/+1
In e2fsprogs, the upper limit of reserved blocks count is a half of filesystem's blocks count. This patch fixes the incorrect checks of reserved blocks count. Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-18mke2fs: don't set stripe/stride to 1 blockEric Sandeen1-2/+5
Block devices may set minimum or optimal IO hints equal to blocksize; in this case there is really nothing for ext4 to do with this information (i.e. search for a block-aligned allocation?) so don't set fs geometry with single-block values. Zeev also reported that with a block-sized stripe, the ext4 allocator spends time spinning in ext4_mb_scan_aligned(), oddly enough. Reported-by: Zeev Tarantov <zeev.tarantov@gmail.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-18e2image: Support for conversion QCOW2 image into rawLukas Czerner2-1/+54
This commit adds support for converting QCOW2 image created previously with e2image into raw image. The QCOW2 image is detected automatically, so there is not new option. Just use following command: e2image -r image.qcow image.raw No that this tool is aimed to quickly convert qcow2 image created with e2image into raw image. In order to improve speed we are doing some assumption I believe might not be true for regular qcow2 images. So it was not tested with regular QCOW2 images and it might not work with them. The intention of this tool is only convert images previously created by e2image. Note that there is nothing special with QCOW2 images created by e2images and it can be used with tools like qemu-img, or qemu-nbd without any problems. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-18e2image: Add support for qcow2 formatLukas Czerner2-89/+729
This commit adds support for exporting filesystem into QCOW2 image format. Like sparse format this saves space, by writing only necessary (metadata blocks) into image. Unlike sparse image, QCOW2 image is NOT sparse, hence does not change its size by copying with not-sparse-aware tools. New options '-Q' has been added to tell the e2image to use QCOW2 as an output image format. QCOW2 supports encryption and compression, however e2image so far does no support such features, however you can still scramble filenames with '-s' option. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-14mke2fs: Allow specifying reserved_ratio via mke2fs.confAditya Kali2-1/+37
This patch adds support for specifying 'reserved_ratio' (percent blocks reserved for super user, same as '-m' command line option) in mke2fs.conf. It adds profile_get_double function in profile.c that allows reading floating point values from profile files. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-07Merge branch 'maint' into nextTheodore Ts'o2-1/+13
2011-05-07logsave: Update usage message so it is correctCarsten Hey1-1/+1
Addresses-Debian-Bug: #619788 Signed-off-by: Carsten Hey <carsten@debian.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-05-07filefrag: count 0 extents properly when verboseEric Sandeen1-0/+12
/boot/a: 0 extents found works properly, but Filesystem type is: ef53 Filesystem cylinder groups is approximately 61 File size of a is 0 (0 blocks, blocksize 1024) ext logical physical expected length flags a: 1 extent found yields 1 extent when it should be 0. Fix this up by special-casing no extents returned in verbose mode; skip printing the header for the columns too, since there are no columns to print. Also, in nonverbose mode we can set fm_extent_count to 0 so that FIEMAP will just query the extent count without gathering details; clarify this with a comment. Addresses-RedHat-Bugzilla: 653234 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-03-18Merge branch 'maint' into nextTheodore Ts'o1-2/+2
Conflicts: lib/e2p/ls.c
2011-03-18e2fsprogs: man page typo fixesEric Sandeen1-2/+2
Fix a few typos in manpages. Reported-by: Branislav Náter <bnater@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-27mke2fs: If the device supports discard, don't print an error messageTheodore Ts'o1-1/+5
Check to see if the device supports discard before starting the progress bar, and then printing an error about inappropriate ioctl for device (when creating a file system image to a file, for example). Also, add a function signature in the ext2_io.h header file for io_channel_discard() and fix an extra, uneeded argument in mke2fs's call to that function. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-02-27Merge branch 'maint' into nextTheodore Ts'o1-8/+16
Conflicts: lib/ext2fs/initialize.c
2011-02-25Add basic BIGALLOC support for cluster-based allocationTheodore Ts'o1-8/+16
This adds the superblock fields needed so that dumpe2fs works and the code points and renames the superblock fields from describing fragments to clusters. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-02-20mke2fs: Display progress report during the device discardLukas Czerner1-13/+41
For some time now we are doing initial discard of the device prior to filesystem creation. However, there is no feedback for the user and hence on some devices with slow TRIM implementation it may appear that mke2fs is stuck. This commit introduce new function mke2fs_discard_device(), which is a wrapper for io_channel_discard(). The discard is done in chunks of 2GB, which seems reasonably well for both slow and fast devices, and discard progress is reported back to the user. I gave up on doing fancy things like align discard according to discard_alignment, checking for discard granularity and computing estimate time. First of all, because it would require either new ioctl to retrieve those information or use of libudev library, none of it seems to be worth it. Regarding discard_granularity, I doubt there is any sane device with discard granularity that big it would affect this. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20Merge branch 'maint' into nextTheodore Ts'o5-39/+100
Conflicts: misc/mke2fs.conf.5.in
2011-02-20mke2fs: Simple man page nodiscard option correctionLukas Czerner1-1/+1
It is not true that 'nodiscard' is set as default, so remove this sentence. The default is 'discard' and it is properly documented in man page. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20e2fsprogs: enable user namespace xattrs by defaultEric Sandeen3-0/+27
User namespace xattrs are generally useful, and I think extN is the only filesystem requiring a special mount option to enable them, when xattrs are otherwise available. So this change sets that mount option into the defaults, via a mke2fs.conf option. Note that if xattrs are config'd off, this will lead to a mostly-harmless: EXT4-fs (sdc1): (no)user_xattr options not supported message at mount time... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20e2fsprogs: turn off enforced fsck intervals by defaultEric Sandeen3-6/+36
The forced fsck often comes at unexpected and inopportune moments, and even enterprise customers are often caught by surprise when this happens. Because a filesystem with an error condition will be marked as requiring fsck anyway, I submit that the time-based and mount-based checks are not particularly useful, and that administrators can schedule fscks on their own time, or tune2fs the enforced intervals if they so choose. This patch disables the intervals by default, and I've added a new mkfs.conf option to turn on the old behavior of random, unexpected, time-consuming fscks at boot time. ;) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-02-20badblocks: Add accounting for different types of errorsTheodore Ts'o1-14/+31
When using the -v option, report a breakdown of the number of read, write, and comparison errors that were found by badblocks. Thanks to Ragnar Kjørstad for providing this patch. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-02-20badblocks: Fix up recover_block handling in badblocksTheodore Ts'o1-18/+5
If there was a bad block for block #0, badblocks would never switch back testing blocks more efficiently. In addition, we were double-incrementing the blocks to be tested in the read/write test due to failure to remove code. Thanks to Ragnar Kjørstad for pointing these problems out. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-02-18Merge branch 'maint' into nextTheodore Ts'o2-45/+96
2011-02-18badblocks: Only report errors when reading/writing one block at a timeTheodore Ts'o1-38/+71
With Direct I/O, the kernel can report 0 bytes read even though the first block has no errors. So there are any errors, we need try to read/write blocks one at a time and to get an accurate report. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>