From cd96532e78ec02dc4ad98fb4069e16c33f1656c4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 4 Feb 2009 12:47:05 +0000 Subject: [PATCH] add support for ext4 resize in fsadm --- WHATS_NEW | 1 + man/fsadm.8.in | 43 ++++++++++++++++++++++++------------------- scripts/fsadm.sh | 8 ++++---- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 6187e05ac..5dcc46209 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.45 - =================================== + Add support for ext4 resize in fsadm Move locking_type reading inside init_locking(). Rename get_vgs() to get_vgnames() and clarify related error messages. Allow clvmd to be built with all cluster managers & select one on cmdline. diff --git a/man/fsadm.8.in b/man/fsadm.8.in index 56791bf72..0574767c1 100644 --- a/man/fsadm.8.in +++ b/man/fsadm.8.in @@ -9,42 +9,48 @@ fsadm \- utility to resize or check filesystem on a device .RI [options]\ resize\ device\ [new_size[BKMGTEP]] .SH "DESCRIPTION" -\fBfsadm\fR utility resizes or checks the filesystem on a device. It tries to use the same API for \fBExt2/3\fR, \fBReiserFS\fR and \fBXFS\fR filesystem and simply resize and filesystem check operation. +\fBfsadm\fR utility resizes or checks the filesystem on a device. +It tries to use the same API for \fBext2/ext3/ext4\fR, +\fBReiserFS\fR and \fBXFS\fR filesystem. .SH "OPTIONS" -.TP +.TP \fB\-h \-\-help\fR \(em print help message -.TP +.TP \fB\-v \-\-verbose\fR \(em be more verbose -.TP +.TP \fB\-e \-\-ext\-offline\fR -\(em unmount Ext2/3 filesystem before doing resize -.TP +\(em unmount ext2/ext3/ext4 filesystem before doing resize +.TP \fB\-f \-\-force\fR \(em bypass some sanity checks -.TP +.TP \fB\-n \-\-dry\-run\fR \(em print commands without running them -.TP +.TP \fB\-y \-\-yes\fR \(em answer "yes" at any prompts -.TP +.TP \fBnew_size\fR -\(em Absolute number of filesystem blocks to be in the filesystem, or an absolute size using a suffix (in powers of 1024). If new_size is not supplied, the whole device is used. - +\(em Absolute number of filesystem blocks to be in the filesystem, +or an absolute size using a suffix (in powers of 1024). +If new_size is not supplied, the whole device is used. .SH "EXAMPLES" -"fsadm \-e \-y resize /dev/vg/test 1000M" tries to resize the size of the filesystem on logical volume /dev/vg/test. If /dev/vg/test contains Ext2/3 filesystem it will be unmounted prior the resize. All [y|n] questions will be answered 'y'. +"fsadm \-e \-y resize /dev/vg/test 1000M" tries to resize the filesystem +on logical volume /dev/vg/test. If /dev/vg/test contains ext2/ext3/ext4 +filesystem it will be unmounted prior the resize. +All [y|n] questions will be answered 'y'. .SH "ENVIRONMENT VARIABLES" -.TP -\fBTMPDIR\fP +.TP +\fBTMPDIR\fP Where the temporary directory should be created. -.TP -.BR +.TP +.BR .SH "SEE ALSO" -.BR lvm (8), -.BR lvresize (8), +.BR lvm (8), +.BR lvresize (8), .BR lvm.conf (5), .BR tune2fs (8), .BR resize2fs (8), @@ -53,4 +59,3 @@ Where the temporary directory should be created. .BR xfs_info (8), .BR xfs_growfs (8), .BR xfs_check (8) - diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh index 436fb812e..3c01b1d66 100644 --- a/scripts/fsadm.sh +++ b/scripts/fsadm.sh @@ -19,7 +19,7 @@ # Needed utilities: # mount, umount, grep, readlink, blockdev, blkid, fsck, xfs_check # -# ext2/ext3: resize2fs, tune2fs +# ext2/ext3/ext4: resize2fs, tune2fs # reiserfs: resize_reiserfs, reiserfstune # xfs: xfs_growfs, xfs_info # @@ -80,7 +80,7 @@ tool_usage() { echo " Options:" echo " -h | --help Show this help message" echo " -v | --verbose Be verbose" - echo " -e | --ext-offline unmount filesystem before Ext2/3 resize" + echo " -e | --ext-offline unmount filesystem before ext2/ext3/ext4 resize" echo " -f | --force Bypass sanity checks" echo " -n | --dry-run Print commands without running them" echo " -l | --lvresize Resize given device (if it is LVM device)" @@ -226,7 +226,7 @@ validate_parsing() { test -n "$BLOCKSIZE" -a -n "$BLOCKCOUNT" || error "Cannot parse $1 output" } #################################### -# Resize ext2/ext3 filesystem +# Resize ext2/ext3/ext4 filesystem # - unmounted or mounted for upsize # - unmounted for downsize #################################### @@ -329,7 +329,7 @@ resize() { #IFS=$'\n' # don't use bash-ism ?? IFS="$(printf \"\\n\")" # needed for parsing output case "$FSTYPE" in - "ext3"|"ext2") resize_ext $NEWSIZE ;; + "ext3"|"ext2"|"ext4") resize_ext $NEWSIZE ;; "reiserfs") resize_reiser $NEWSIZE ;; "xfs") resize_xfs $NEWSIZE ;; *) error "Filesystem \"$FSTYPE\" on device \"$VOLUME\" is not supported by this tool" ;;