summaryrefslogtreecommitdiff
path: root/misc
Commit message (Collapse)AuthorAgeFilesLines
* dumpe2fs: complain if extra arguments are given on the command lineTheodore Ts'o2014-08-241-1/+3
| | | | | | Addresses-Debian-Bug: #758074 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* filefrag: fix extent count calculation when using FIBMAPTheodore Ts'o2014-08-131-2/+3
| | | | | | | | | | | The extent count calculation works correctly with the FIBMAP ioctl in verbose (-v) mode, but without the verbose option, the calculation was broken because we weren't properly updating the fm_ext data structures in non-verbose mode. Addresses-Launchpad-Bug: #1356496 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* debugfs: fix argument parsing in do_freefrag()Artemiy Volkov2014-08-021-0/+1
| | | | | | | | When do_freefrag() is called from debugfs, the value of optind is not reset. Rectify that by calling reset_getopt(). Signed-off-by: Artemiy Volkov <artemiyv@acm.org> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: fix Makefile for profiled buildTheodore Ts'o2014-08-021-1/+2
| | | | Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* filefrag: minor code fixes and cleanupsAndreas Dilger2014-08-011-11/+15
| | | | | | | | | | | | | | Print filefrag_fiemap() error message to stderr instead of stdout. Only call ioctl(EXT3_IOC_GETFLAGS) for ext{2,3,4} filesystems to decide if the ext2 indirect block allocation heuristic shold be used. Properly handle the the force_bmap (-B) option. Exit with a positive error number instead of a negative one. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: quiet signed/unsigned charactr compiler warningsAndreas Dilger2014-08-011-12/+16
| | | | | | | | | Quiet warnings about signed vs. unsigned character mismatch. Use __u8 for storing UUIDs instead of char to match the superblock s_uuid field. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* tune2fs: fix uninitialized variable in remove_journal_deviceTheodore Ts'o2014-07-311-3/+3
| | | | | | | | | | This bug was introduced by commit 7dfefaf413bbd ("tune2fs: update journal super block when changing UUID for fs"). Fixes-Coverity-Bug: 1229243 Reported-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* tune2fs: update journal users while updating fs UUID (with external journal)Azat Khuzhin2014-07-282-7/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have fs with external journal device, and updating it's UUID, we should update UUID in users list for that external journal device. Before: $ tune2fs -U clear /tmp/dev tune2fs 1.42.10 (18-May-2014) $ dumpe2fs /tmp/dev | fgrep UUID dumpe2fs 1.42.10 (18-May-2014) Filesystem UUID: <none> Journal UUID: da1f2ed0-60f6-aaaa-92fd-738701418523 $ dumpe2fs /tmp/journal | fgrep users -A10 dumpe2fs 1.42.10 (18-May-2014) Journal number of users: 2 Journal users: 0707762d-638e-4bc6-944e-ae8ee7a3359e 0ad849df-1041-4f0a-b1c1-2f949d6a1e37 After: $ sudo tune2fs -U clear /tmp/dev tune2fs 1.43-WIP (18-May-2014) $ dumpe2fs /tmp/dev | fgrep UUID dumpe2fs 1.42.10 (18-May-2014) Filesystem UUID: <none> Journal UUID: da1f2ed0-60f6-aaaa-92fd-738701418523 $ dumpe2fs /tmp/journal | fgrep users -A10 dumpe2fs 1.42.10 (18-May-2014) Journal number of users: 2 Journal users: 0707762d-638e-4bc6-944e-ae8ee7a3359e 00000000-0000-0000-0000-000000000000 Also add some consts to avoid *magic numbers*: - UUID_STR_SIZE - UUID_SIZE - JFS_USERS_MAX - JFS_USERS_SIZE Proposed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* tune2fs: update journal super block when changing UUID for fs.Azat Khuzhin2014-07-281-18/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using -U option you can change the UUID for fs, however it will not work for journal device, since it have a copy of this UUID inside jsb (i.e. journal super block). So copy UUID on change into that block. Here is the initial thread: http://comments.gmane.org/gmane.comp.file-systems.ext4/44532 You can reproduce this by executing following commands: $ fallocate -l100M /tmp/dev $ fallocate -l100M /tmp/journal $ sudo /sbin/losetup /dev/loop1 /tmp/dev $ sudo /sbin/losetup /dev/loop0 /tmp/journal $ mke2fs -O journal_dev /tmp/journal $ tune2fs -U da1f2ed0-60f6-aaaa-92fd-738701418523 /tmp/journal $ sudo mke2fs -t ext4 -J device=/dev/loop0 /dev/loop1 $ dumpe2fs -h /tmp/dev | fgrep UUID dumpe2fs 1.43-WIP (18-May-2014) Filesystem UUID: 8a776be9-12eb-411f-8e88-b873575ecfb6 Journal UUID: e3d02151-e776-4865-af25-aecb7291e8e5 $ sudo e2fsck /dev/vdc e2fsck 1.43-WIP (18-May-2014) External journal does not support this filesystem /dev/loop1: ********** WARNING: Filesystem still has errors ********** Reported-by: Chin Tzung Cheng <chintzung@gmail.com> Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* tune2fs: remove_journal_device(): use the correct block to find jsbAzat Khuzhin2014-07-281-2/+6
| | | | | | Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* journal: use consts instead of 1024 and add helper for journal with 1k blocksizeAzat Khuzhin2014-07-281-3/+3
| | | | | | | | | | | Use EXT2_MIN_BLOCK_SIZE, JFS_MIN_JOURNAL_BLOCKS, SUPERBLOCK_SIZE, and SUPERBLOCK_OFFSET instead of hardcoded 1024 when it is okay, and also add a helper ext2fs_journal_sb_start() that will return start of journal sb with special case for fs with 1k block size. Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com> Reviewed-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* filefrag: fix block size valueRakesh Pandit2014-07-271-10/+11
| | | | | | | | | | | | | | | | | | ioctl(FIGETBSZ) was used to get block size earlier but 2508eaa7 (filefrag: improvements to filefrag FIEMAP handling) moved to fstatfs f_bsize which doesn't work well for many files systems. Block size returned using fstatfs isn't block size but "optimal transfer block size" as per man page. Even stat st_blksize is "preferred I/O block size" and in may file systems it may even vary from file to file (POSIX). This patch changes filefrag to use FIGETBSZ preferentially over f_bsize. [ Modified by tytso to add the fallback to f_bsize if FIGETBSZ fails for some reason ] Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* filefrag: fix -B option and extents calculation for FIBMAPRakesh Pandit2014-07-271-4/+5
| | | | | | | | | 29758d2 broke -B option which is useful for filesystems not supporting FIEMAP. Also, fix extents calculation for -B which is broken since 2508eaa7. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* libext2fs: provide a function to set inode sizeDarrick J. Wong2014-07-261-2/+3
| | | | | | | | | | | | | | Provide an API to set i_size in an inode and take care of all required feature flag modifications. Refactor the code to use this new function. [ Moved the function to lib/ext2fs/blk_num.c, which is the rest of these sorts of functions live, and renamed it to be ext2fs_inode_size_set() instead of ext2fs_inode_set_size() to be consistent with the other functions in in blk_num.c -- tytso ] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Fix 32/64-bit overflow when multiplying by blocks/clusters per groupTheodore Ts'o2014-07-261-1/+1
| | | | | | | | | | | | | | | | | There are a number of places where we need convert groups to blocks or clusters by multiply the groups by blocks/clusters per group. Unfortunately, both quantities are 32-bit, but the result needs to be 64-bit, and very often the cast to 64-bit gets lost. Fix this by adding new macros, EXT2_GROUPS_TO_BLOCKS() and EXT2_GROUPS_TO_CLUSTERS(). This should fix a bug where resizing a 64bit file system can result in calculate_minimum_resize_size() looping forever. Addresses-Launchpad-Bug: #1321958 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* build: fix unused/uninitialized variable warningsAndreas Dilger2014-07-251-1/+1
| | | | | | | | | | Fix a few warnings about unused and uninitialized variables. Also fix util/subst.c to include <sys/time.h> to avoid using undeclared functions gettimeofday() and futimes(). Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: fix problems with strncatDarrick J. Wong2014-07-251-1/+3
| | | | | | | | | | | | | | The third argument to strncat is the maximum number of characters to copy out of the second argument; it is not the maximum length of the first argument. Therefore, code in a check just in case we ever find a /sys/block/X path long enough to hit the end of the buffer. FWIW the longest path I could find on my machine was 133 bytes. Fixes-Coverity-Bug: 1252003 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e4defrag: backwards-allocated files should be defragmented tooDarrick J. Wong2014-07-221-1/+3
| | | | | | | | | | | | | | | | | | | | Currently, e4defrag avoids increasing file fragmentation by comparing the number of runs of physical extents of both the original and the donor files. Unfortunately, there is a bug in the routine that counts physical extents, since it doesn't look at the logical block offsets of the extents. Therefore, a file whose blocks were allocated in reverse order will be seen as only having one big physical extent, and therefore will not be defragmented. Fix the counting routine to consider logical extent offset so that we defragment backwards-allocated files. This could be problematic if we ever gain the ability to lay out logically sparse extents in a physically contiguous manner, but presumably one wouldn't call defrag on such a file. Reported-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: fix fencepost error when calling strncatTheodore Ts'o2014-07-101-1/+1
| | | | | | | | There were other protections which would prevent a buffer overflow from happening, but we should fix this nevertheless. Addresses-Coverity-Bug: #1225003 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* Fix nroff macro issue in chattr man pageTheodore Ts'o2014-07-101-2/+2
| | | | | | | The single quote character must not be in the first character in a line, or else it can get mistaken as a macro call. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: add support to align hugefiles relative to beginning of the diskTheodore Ts'o2014-07-094-8/+157
| | | | | | | | | Add the mke2fs.conf configuration option which causes the hugefiles to be aligned to the beginning of the disk. This is important if the the reason for aligning the hugefiles is to support hard-drive specific features such as Shingled Magnetic Recording (SMR). Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: add get_uint_from_profile to mke2fs.cAkira Fujita2014-07-051-2/+14
| | | | | | | | | | We can set flex_bg count only up to 2^30 with profile because get_int_from_profile can handle it to 2^31-1. Add get_uint_from_profile to read unsigned int value so that mke2fs with profile can handle up to 2^31 flex_bg same as -G option. Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: set upper limit to flex_bg countAkira Fujita2014-07-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mke2fs -G option allows root user to set flex_bg count (power of 2). However ext4 has bad metadata layout if we specify more than or equal to 2^32 to mke2fs -G, because of the 32bit shift operation in ext2fs_allocate_group_table(). And the maximum block group count of ext4 is 2^32 -1 (ext4_group_t s_groups_count), so diallow more than 2^32 flex_bg count. Steps to reproduce: # mke2fs -t ext4 -G 4294967296 DEV # dumpe2fs DEV ... Flex block group size: 1 <----- flex_bg is 1! ... Group 0: (Blocks 0-32767) Checksum 0x4afd, unused inodes 7541 Primary superblock at 0, Group descriptors at 1-1 Reserved GDT blocks at 2-59 Block bitmap at 60 (+60), Inode bitmap at 61 (+61) Inode table at 62-533 (+62) 32228 free blocks, 7541 free inodes, 2 directories, 7541 unused inodes Free blocks: 540-32767 Free inodes: 12-7552 Group 1: (Blocks 32768-65535) [INODE_UNINIT] Checksum 0xc890, unused inodes 7552 Backup superblock at 32768, Group descriptors at 32769-32769 Reserved GDT blocks at 32770-32827 Block bitmap at 32828 (+60), Inode bitmap at 32829 (+61) Inode table at 32830-33301 (+62) 32234 free blocks, 7552 free inodes, 0 directories, 7552 unused inodes Free blocks: 33302-65535 Free inodes: 7553-15104 ... Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: "Darrick J. Wong" <darrick.wong@oracle.com>
* mke2fs: enable lazy_itable_init on newer kernel by defaultLukas Czerner2014-07-051-1/+9
| | | | | | | | | | | | | | | | Currently is used did not specified lazy_itable_init option we rely on information from ext4 module exported via sysfs interface. However if the ext4 module is not loaded it will not be enabled even though kernel might support it. With this commit we set the default according to the kernel version, however we still allow it to be set manually via extended option or be enabled in case that ext4 module advertise that it supports this feature. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
* mke2fs: add revision to the is_before_linux_ver()Lukas Czerner2014-07-051-5/+7
| | | | | Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsprogs: introduce ext2fs_close_free() helperLukas Czerner2014-07-057-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Currently there are many uses of ext2fs_close() which might be wrong. First of all ext2fs_close() does not set the ext2_filsys pointer to NULL so the caller is responsible for clearing it, however there are some cases there we do not do it. Second of all very small number of users of ext2fs_close() actually check the return value. If there is a problem in ext2fs_close() it will not even free the ext2_filsys structure, but majority of users expect it to do so. To fix both problems this commit introduces a new helper ext2fs_close_free() which will not only check for the return value and free the ext2_filsys structure if the call to ext2fs_close2() failed, but it will also set the ext2_filsys pointer to NULL. Replace every use of ext2fs_close() in e2fsprogs tools with ext2fs_close_free() - there is no real reason to keep using ext2fs_close(). Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
* e2fsprogs: add mount options to ext4.5Eric Sandeen2014-07-041-1/+359
| | | | | | | | | | | | | | | | This is a straight cut and paste from the util-linux mount manpage to ext4.5 (with commented-out lines removed). It's pretty much impossible for util-linux to keep up with every filesystem out there, and Karel has more than once expressed a wish that mount options move into fs-specific manpages. So, here we go. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* e2fsprogs: revise and extend chattr(1) and chattr usage()Eric Sandeen2014-07-042-21/+39
| | | | | | | | | | | | | | | | | | | | The chattr(1) manpage and chattr usage() output were missing some flags. Add those, and make some other minor cosmetic fixes. (I've left out the 'B' (EXT2_COMPRBLK_FL) flag, because it's not actually used anywhere, and I can't figure out how it differs from 'c' (EXT2_COMPR_FL)) Also, because the matrix of filesystems & flags is quite large, refer to filesystem-specific manpages for detailed discussion of flags supported by those filesystems, rather than trying to cover it all in this manpage. I'll send those manpage updates to the appropriate lists a bit later. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
* e2fsprogs: reorder flags in chattr(1)Eric Sandeen2014-07-042-34/+46
| | | | | | | | | | | | | | | | | The flags described in chattr usage() and the chattr(1) manpage were in semi-random order, which makes it hard to ascertain which flags might be missing or undocumented, and to locate flags within the manpage. Re-order the list of flags in alphanumeric order, and do the same for the flag descriptions in the body of the manpage. There should be no content changes here, just reordering for consistency. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
* mke2fs: prevent creation of filesystem with unsupported revisionFrank Sorenson2014-07-041-0/+5
| | | | | | | | | | | | | | | | | It's a bit strange to accept revision levels higher than the code creating the filesystem can understand, so don't allow it. At least the kernel will mount the fs readonly if it's too high, but no other utility will touch it, so you can't fix the error. Just reject anything > EXT2_MAX_SUPP_REV at mkfs time. Signed-off-by: Frank Sorenson <fsorenso@redhat.com> [sandeen@redhat.com: Add more verbose commit log] Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: quiet minor build warnings, ignore generated filesAndreas Dilger2014-07-041-1/+4
| | | | | | | | | | Quiet a couple of build warnings in tst_libext2fs.c Add missing unistd.h header for misc/util.c. Ignore generated files for lib/ext2fs/tst_libext2fs and intl/ files. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* filefrag: fix issues with 29758d2Eric Sandeen2014-06-011-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 29758d2 filefrag: exit with error code if an error is hit introduced a couple errors; in one case it missed returning a value, and possibly picked up errno from (unchecked) close(), and in the other used a test where it needed an assignment. So capture the error, move perror() directly after the failed call in both cases, and fix the assignment. Also fix a precedence problem with: if (fe_flags & mask == 0) which is equivalent to: if (fe_flags & (mask == 0)) but we need: if ((fe_flags & mask) == 0) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
* mke2fs: fix a typo in an error messageBenno Schulenberg2014-06-011-1/+1
| | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* filefrag: exit with error code if an error is hitAndreas Dilger2014-05-271-46/+83
| | | | | | | | | | | | | If an error is hit during filefrag operation, it will continue to run (if multiple files are specified on the command-line), but will exit with a non-zero value, so that callers can determine that some error was hit. Clean up the printing of FIEMAP flags and print some newer flags that were missing. Also print unknown flags as hex values. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* misc: use unsigned long long for file block count in filefragVitaliy Filippov2014-05-271-2/+2
| | | | | | This patch fixes incorrect reporting of file block count on 32-bit platforms. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: use ext2fs_open_file() in check_plausibility()Eric Sandeen2014-05-221-2/+2
| | | | | | | | | | | | | | | | The commit: 802146c mke2fs: create a regular file if necessary caused a regression on 32-bit machines; the open() fails if the file size is > 4G. Using ext2fs_open_file() fixes it. Addresses-Red-Hat-Bugzilla: #1099892 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* mke2fs: set gdt csum when creating packed fsDarrick J. Wong2014-05-131-0/+1
| | | | | | | | | | When we're creating a fs with metadata blocks packed at the beginning (packed_meta_blocks=1 in mke2fs.conf), set the group descriptor checksum or else we create DOA filesystems with checksum errors. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Lukas Czerner <lczerner@redhat.com>
* quota: remove mke2fs's and tune2fs's warning messages regarding quotaTheodore Ts'o2014-05-133-18/+0
| | | | | | | | | | | We no longer need to reference https://ext4.wiki.kernel.org/index.php/Quota since we've fixed the nasty bugs associated with e2fsck and the quota feature. The wiki page will be updated once we've done a release that includes these fixes indicated the verison which these problems have been fixed. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Aditya Kali <adityakali@google.com>
* quota: integrate mkquota.h into quotaio.hTheodore Ts'o2014-05-133-10/+8
| | | | | | | | | | | | | | | | | | There are interfaces that are used by mke2fs.c and tune2fs.c which are in quotaio.h, and some future changes will be much simpler if we can combine the two header files together. Also the guard #ifdef for mkquota.h was incorrect, which caused problems when both header files needed to be included. Also remove quota.pc and installation rules for libquota, since this library is never going to be something that we can export externally anyway. Eventually we'll want to clean up the interfaces and move the external publishable interfaces to the libext2fs library, and then rename what's left from libquota.a to libsupport.a for internal use only. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Aditya Kali <adityakali@google.com>
* mke2fs: check for a partition table and warn if presentTheodore Ts'o2014-05-071-7/+54
| | | | | | | | This supercedes the "whole disk" check, since it does a better job and there are times when it is quite legitimate to want to use the whole disk. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: print extra information about existing ext2/3/4 file systemsTheodore Ts'o2014-05-071-0/+38
| | | | | | | | | | | | | | | | | | | The basic idea is to provide a bit more context in this situation: % ./misc/mke2fs -t ext4 /dev/sdc3 mke2fs 1.42.9 (4-Feb-2014) /dev/sdc3 contains a ext4 file system Proceed anyway? (y,n) ... by adding this bit of context: % ./misc/mke2fs -t ext4 /dev/sdc3 mke2fs 1.42.9 (4-Feb-2014) /dev/sdc3 contains a ext4 file system last mounted on /SOX-backups on Mon May 5 08:59:53 2014 Proceed anyway? (y,n) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: print a message when creating a regular fileTheodore Ts'o2014-05-053-6/+12
| | | | | | | | | | We've added the ability to automatically recreate a file if it doesn't exist prior to creating the file system, since this is often used (for example) when managing file system images for use in virtual machines. We should at least notify the user that this is going on to avoid surprises in the case of misspelled device/file names. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* e2fsprogs/filefrag: print shared extent flagMark Fasheh2014-05-041-0/+2
| | | | | | | | Filefrag doesn't catch and print the shared extent flag. Add this for users of filefrag on file systems with shared extents (such as btrfs). Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: only print the low-level file system stats in verbose modeTheodore Ts'o2014-05-041-0/+11
| | | | | | Also print the file system UUID if it is non-NULL. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: check for pre-existing file systemTheodore Ts'o2014-05-043-3/+36
| | | | | | | | Warn the system administrator if there is an existing file system on the block device, and give the administrator an opportunity to abort the mkfs operation. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: add an option in mke2fs.conf to proceed after a delayTheodore Ts'o2014-05-045-10/+52
| | | | | | | | | | If mke2fs needs to ask the user for permission, and the user doesn't type anything the specified delay in the /etc/mke2fs.conf file, proceed as if the user had said yes. The default is to do what we currently do, which is to wait until the user answers the question one way or the other. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: create a regular file if necessaryTheodore Ts'o2014-04-263-5/+19
| | | | | | | This is useful when creating a filesystem for use with a VM, for example. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: don't complain if the regular file is too smallTheodore Ts'o2014-04-261-3/+3
| | | | | | | | | | Don't ask the user if it's OK that a regular file is smaller than the requested size. This test only makes sense if we are creating the file system on a block device. This allow users to not need to manually answer the "proceed?" question when creating a file system backed by a simple file. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs, tune2fs: call proceed_question() from check_plausibility()'s callerTheodore Ts'o2014-04-264-12/+18
| | | | | | | | Move the call to proceed_question() from check_plausibility() to its caller. This allows more fine grained control by mke2fs about when it might want to call check_plausibility(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
* mke2fs: don't ask the proceed question using a regular fileTheodore Ts'o2014-04-264-10/+21
| | | | | | | | | | | | Very often people are creating file systems using regular files, so we shouldn't ask the user to confirm using the proceed question. Otherwise it encourages users to use the -F flag, which is a bad thing. We do need to continue to check if the external journal device is a block device. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>