Redhat shrink file system




















Accepted size units for file system block sizes are: S - byte sectors K - kilobytes M - megabytes G - gigabytes 4. Mount the file system and partition.

Log in to comment. JS Newbie 5 points. Jose Ignacio Sanchez. Active Contributor points. Before resizing file system, run the e2fsck command to perform a file system check:. The commands used in these examples specify the final size of the file system rather than the amount of space by which it should be reduced. The LVM2 commands support the alternative lvresize command which accepts relative sizes should this be more convenient. For example:. The answer is No and Yes.

The "Yes" is that we can work around it, but the approach might be a little tricky. If your file systems are formatted as any of legacy ext series, you may refer to the post below for resolutions: How to Reduce Logical Volume Size on Linux.

Since XFS does not allow to shrink its size, so we need a strategy to workaround this. Of course, we don't want to reinstall OS. Here is my plan in short:. The best tool to backup XFS file system is xfsdump. Since there's no xfsdump in CentOS 7. First of all, let's see what is xfsdump.

Install xfsdump package which also includes xfsrestore. The -l option specifies a dump level To perform a full backup, use 0. The -f option specifies the destination of target and source, the format is:. We should umount the file system before doing anything on the LV. There's a 10GB taken by the new LV. But I have a question now: Can it survive through reboots? Let's continue. This is a perfect example of how to document something.

Thank you very much. This example shows the output to the command. Specifying the - sign before the resize value indicates that the value will be subtracted from the logical volume's actual size. The following example shows the command you would use if, instead of shrinking a logical volume to an absolute size of 64 megabytes, you wanted to shrink the volume by a value 64 megabytes.



0コメント

  • 1000 / 1000