From 2c10cb58ca90fa52828dd287eca8b34f195740ae Mon Sep 17 00:00:00 2001 From: Shuo Wu Date: Thu, 2 Jan 2020 13:06:49 -0800 Subject: [PATCH] doc: Update expansion.doc for revert case Signed-off-by: Shuo Wu --- docs/expansion.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/expansion.md b/docs/expansion.md index 3e62481..d27cee5 100644 --- a/docs/expansion.md +++ b/docs/expansion.md @@ -70,11 +70,35 @@ Modify `spec.resources.requests.storage` of this PVC. ## Filesystem expansion -Longhorn will try to expand the file system only if: +#### Longhorn will try to expand the file system only if: 1. The expanded size should be greater than the current size. 2. There is a Linux filesystem in the Longhorn volume. 3. The filesystem used in the Longhorn volume is one of the followings: - 3.1 ext4 - 3.2 XFS + 1. ext4 + 2. XFS 4. The Longhorn volume is not in maintanence mode 5. The Longhorn volume is using block device frontend. + +#### Handling volume revert: +If users revert a volume to a snapshot with smaller size, the frontend of the volume is still holding the expanded size. But the filesystem size will be the same as that of the reverted snapshot. In this case, users need to handle the filesystem manually: + 1. Attach the volume to a random nodes. + 2. Log into the corresponding node, expand the filesystem: + - If the filesystem is `ext4`, the volume might need to be mounted and umounted once before resizing the filesystem manually. Otherwise, executing `resize2fs` might result in an error: + ``` + resize2fs: Superblock checksum does not match superblock while trying to open ...... + Couldn't find valid filesystem superblock. + ``` + Follow the steps below to resize the filesystem: + ``` + mount /dev/longhorn/ + umount /dev/longhorn/ + mount /dev/longhorn/ + resize2fs /dev/longhorn/ + umount /dev/longhorn/ + ``` + - If the filesystem is `xfs`, users can directly mount then expand the filesystem. + ``` + mount /dev/longhorn/ + xfs_growfs + umount /dev/longhorn/ + ```