public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW man/fsadm.8.in scripts/fsadm.sh
@ 2011-09-19 19:36 zkabelac
0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2011-09-19 19:36 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-09-19 19:36:53
Modified files:
. : WHATS_NEW
man : fsadm.8.in
scripts : fsadm.sh
Log message:
Add support for DM_DEV_DIR
Follow other commands support this directory setting.
Useful for test suite.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2123&r2=1.2124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/fsadm.8.in.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/fsadm.sh.diff?cvsroot=lvm2&r1=1.28&r2=1.29
--- LVM2/WHATS_NEW 2011/09/19 18:38:43 1.2123
+++ LVM2/WHATS_NEW 2011/09/19 19:36:52 1.2124
@@ -1,6 +1,6 @@
Version 2.02.89 -
==================================
- Add support for non /dev device paths into fsadm script.
+ Add support for DM_DEV_DIR device path into fsadm script.
Support different PATH setting for fsadm script testing.
Surround all executed commands with quotes in fsadm script.
Fix missing '$' in test for content of "$LVM" in fsadm script.
--- LVM2/man/fsadm.8.in 2011/09/07 08:50:35 1.5
+++ LVM2/man/fsadm.8.in 2011/09/19 19:36:53 1.6
@@ -63,6 +63,10 @@
.TP
.B TMPDIR
The temporary directory name for mount points. Defaults to "/tmp".
+.TP
+.B DM_DEV_DIR
+The device directory name.
+Defaults to "/dev" and must be an absolute path.
.SH SEE ALSO
.BR lvm (8),
--- LVM2/scripts/fsadm.sh 2011/09/19 14:52:33 1.28
+++ LVM2/scripts/fsadm.sh 2011/09/19 19:36:53 1.29
@@ -67,12 +67,14 @@
FSTYPE=unknown
VOLUME=unknown
TEMPDIR="${TMPDIR:-/tmp}/${TOOL}_${RANDOM}$$/m"
+DM_DEV_DIR="${DM_DEV_DIR:-/dev}"
BLOCKSIZE=
BLOCKCOUNT=
MOUNTPOINT=
MOUNTED=
REMOUNT=
PROCMOUNTS="/proc/mounts"
+NULL="$DM_DEV_DIR/null"
IFS_OLD=$IFS
# without bash $'\n'
@@ -176,17 +178,18 @@
# dereference device name if it is symbolic link
detect_fs() {
VOLUME_ORIG=$1
- VOLUME=${1#/dev/}
- VOLUME=$("$READLINK" $READLINK_E "/dev/$VOLUME") || VOLUME=$("$READLINK" $READLINK_E "$VOLUME_ORIG") || error "Cannot get readlink \"$1\""
+ VOLUME=${1/#"${DM_DEV_DIR}/"/}
+ VOLUME=$("$READLINK" $READLINK_E "$DM_DEV_DIR/$VOLUME") || error "Cannot get readlink \"$1\""
RVOLUME=$VOLUME
case "$RVOLUME" in
+ # hardcoded /dev since udev does not create these entries elsewhere
/dev/dm-[0-9]*)
- read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="/dev/mapper/$SYSVOLUME"
+ read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
;;
esac
- # use /dev/null as cache file to be sure about the result
+ # use null device as cache file to be sure about the result
# not using option '-o value' to be compatible with older version of blkid
- FSTYPE=$("$BLKID" -c /dev/null -s TYPE "$VOLUME") || error "Cannot get FSTYPE of \"$VOLUME\""
+ FSTYPE=$("$BLKID" -c "$NULL" -s TYPE "$VOLUME") || error "Cannot get FSTYPE of \"$VOLUME\""
FSTYPE=${FSTYPE##*TYPE=\"} # cut quotation marks
FSTYPE=${FSTYPE%%\"*}
verbose "\"$FSTYPE\" filesystem found on \"$VOLUME\""
@@ -221,7 +224,7 @@
# get the full size of device in bytes
detect_device_size() {
# check if blockdev supports getsize64
- "$BLOCKDEV" 2>&1 | "$GREP" getsize64 >/dev/null
+ "$BLOCKDEV" 2>&1 | "$GREP" getsize64 >"$NULL"
if test $? -eq 0; then
DEVSIZE=$("$BLOCKDEV" --getsize64 "$VOLUME") || error "Cannot read size of device \"$VOLUME\""
else
@@ -389,7 +392,7 @@
# only one supported
####################################
diff_dates() {
- echo $(( $("$DATE" -u -d"$1" +%s 2>/dev/null) - $("$DATE" -u -d"$2" +%s 2>/dev/null) ))
+ echo $(( $("$DATE" -u -d"$1" +%s 2>"$NULL") - $("$DATE" -u -d"$2" +%s 2>"$NULL") ))
}
###################
@@ -451,11 +454,11 @@
-a -n "$DATE" -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "$LVM" \
|| error "Required command definitions in the script are missing!"
-"$LVM" version >/dev/null 2>&1 || error "Could not run lvm binary \"$LVM\""
-$("$READLINK" -e / >/dev/null 2>&1) || READLINK_E="-f"
+"$LVM" version >"$NULL" 2>&1 || error "Could not run lvm binary \"$LVM\""
+$("$READLINK" -e / >"$NULL" 2>&1) || READLINK_E="-f"
TEST64BIT=$(( 1000 * 1000000000000 ))
test "$TEST64BIT" -eq 1000000000000000 || error "Shell does not handle 64bit arithmetic"
-$(echo Y | "$GREP" Y >/dev/null) || error "Grep does not work properly"
+$(echo Y | "$GREP" Y >"$NULL") || error "Grep does not work properly"
test $("$DATE" -u -d"Jan 01 00:00:01 1970" +%s) -eq 1 || error "Date translation does not work"
^ permalink raw reply [flat|nested] 2+ messages in thread
* LVM2 ./WHATS_NEW man/fsadm.8.in scripts/fsadm.sh
@ 2009-02-04 12:47 zkabelac
0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2009-02-04 12:47 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2009-02-04 12:47:05
Modified files:
. : WHATS_NEW
man : fsadm.8.in
scripts : fsadm.sh
Log message:
add support for ext4 resize in fsadm
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1034&r2=1.1035
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/fsadm.8.in.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/fsadm.sh.diff?cvsroot=lvm2&r1=1.7&r2=1.8
--- LVM2/WHATS_NEW 2009/02/03 16:23:19 1.1034
+++ LVM2/WHATS_NEW 2009/02/04 12:47:05 1.1035
@@ -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.
--- LVM2/man/fsadm.8.in 2008/10/08 12:50:13 1.1
+++ LVM2/man/fsadm.8.in 2009/02/04 12:47:05 1.2
@@ -9,42 +9,48 @@
.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 @@
.BR xfs_info (8),
.BR xfs_growfs (8),
.BR xfs_check (8)
-
--- LVM2/scripts/fsadm.sh 2008/04/29 15:58:24 1.7
+++ LVM2/scripts/fsadm.sh 2009/02/04 12:47:05 1.8
@@ -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 @@
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 @@
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 @@
#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" ;;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-19 19:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-19 19:36 LVM2 ./WHATS_NEW man/fsadm.8.in scripts/fsadm.sh zkabelac
-- strict thread matches above, loose matches on Subject: below --
2009-02-04 12:47 zkabelac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).