]> sourceware.org Git - lvm2.git/commit
lvresize: add new options and defaults for fs handling
authorDavid Teigland <teigland@redhat.com>
Tue, 14 Jun 2022 20:20:21 +0000 (15:20 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 13 Sep 2022 20:15:05 +0000 (15:15 -0500)
commit264827cb98458f7100456eeebf7fdde8dcbc0ad4
tree301eb6cceaad99a2886ed526324756eee43bf2e8
parent18722dfdf4d3e6f172d0b2af8bbdc4a154ea1dc0
lvresize: add new options and defaults for fs handling

The new option "--fs String" for lvresize/lvreduce/lvextend
controls the handling of file systems before/after resizing
the LV.  --resizefs is the same as --fs resize.

The new option "--fsmode String" can be used to control
mounting and unmounting of the fs during resizing.

Possible --fs values:

checksize
  Only applies to reducing size; does nothing for extend.
  Check the fs size and reduce the LV if the fs is not using
  the affected space, i.e. the fs does not need to be shrunk.
  Fail the command without reducing the fs or LV if the fs is
  using the affected space.

resize
  Resize the fs using the fs-specific resize command.
  This may include mounting, unmounting, or running fsck.
  See --fsmode to control mounting behavior, and --nofsck to
  disable fsck.

resize_fsadm
  Use the old method of calling fsadm to handle the fs
  (deprecated.) Warning: this option does not prevent lvreduce
  from destroying file systems that are unmounted (or mounted
  if prompts are skipped.)

ignore
  Resize the LV without checking for or handling a file system.
  Warning: using ignore when reducing the LV size may destroy the
  file system.

Possible --fsmode values:

manage
  Mount or unmount the fs as needed to resize the fs,
  and attempt to restore the original mount state at the end.

nochange
  Do not mount or unmount the fs. If mounting or unmounting
  is required to resize the fs, then do not resize the fs or
  the LV and fail the command.

offline
  Unmount the fs if it is mounted, and resize the fs while it
  is unmounted. If mounting is required to resize the fs,
  then do not resize the fs or the LV and fail the command.

Notes on lvreduce:

When no --fs or --resizefs option is specified:
. lvextend default behavior is fs ignore.
. lvreduce default behavior is fs checksize
  (includes activating the LV.)

With the exception of --fs resize_fsadm|ignore, lvreduce requires
the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE.
FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV,
which determines if reducing the fs is necessary.
30 files changed:
configure.ac
include/configure.h.in
lib/Makefile.in
lib/activate/dev_manager.c
lib/activate/dev_manager.h
lib/device/dev-type.c
lib/device/dev-type.h
lib/device/filesystem.c [new file with mode: 0644]
lib/device/filesystem.h [new file with mode: 0644]
lib/metadata/lv_manip.c
lib/metadata/metadata-exported.h
lib/metadata/metadata.c
lib/metadata/metadata.h
scripts/Makefile.in
scripts/fsadm.sh
scripts/lvresize_fs_helper.sh [new file with mode: 0755]
spec/packages.inc
test/shell/fsadm-crypt-fsresize.sh [new file with mode: 0644]
test/shell/fsadm-crypt.sh
test/shell/fsadm.sh
test/shell/hints.sh
test/shell/lvresize-fs-crypt.sh [new file with mode: 0644]
test/shell/lvresize-fs.sh [new file with mode: 0644]
test/shell/lvresize-full.sh
test/shell/lvresize-mirror.sh
test/shell/lvresize-rounding.sh
test/shell/relative-sign-options.sh
tools/args.h
tools/command-lines.in
tools/lvresize.c
This page took 0.056017 seconds and 5 git commands to generate.