Expand Lv-root Space Steps in CentOS

Source: Internet
Author: User

View server Discovery vg_host01-The space occupied by Lv_root is more and need to be enlarged. The following two options are available:1Expand the size of the lv_root using spare disks (recommended)2Move the lv_home space out of the way to Lv_root (which is eventually used due to limited hardware conditions) to move lv_home space out part of the process to Lv_root1, view partition copy code code example: Filesystem 1K-blocks used Available use%mounted on/dev/mapper/vg_host01-Lv_root51606140    755572  48229128   2% /Tmpfs8164776         0   8164776   0%/dev/SHM/dev/sda1495844     31571    438673   7% /Boot/dev/mapper/vg_host01-Lv_home217446348    191700 206208968   1% /Home2UninstallHome Copy Code code example: Umount/Home3, check the copy code code example for a logical volume: E2fsck-f/dev/mapper/vg_host01-Lv_home4, adjust the/dev/mapper/vg_host01-the parameter after the Lv_home size is the copy code code example of the Lv_home modified size: RESIZE2FS-p/dev/mapper/vg_host01-lv_home 50G5, adjust the/dev/mapper/vg_host01-in LVMlv_home Size Copy Code code example: Lvreduce-L 50g/dev/mapper/vg_host01-Lv_home and re-mount the home under Mount/dev/mapper/vg_host01-lv_home/Home6, view free space Copy code example: Vgdisplay|grep"Free PE"7, use the Lvextend directive to extend the logical volume space to/dev/mapper/vg_host01-Example of copy code code in Lv_root directory: Lvextend-L +150g/dev/mapper/vg_host01-Lv_root8, Reassign/dev/mapper/vg_host01-lv_root Space Size Copy Code code example: RESIZE2FS-p/dev/mapper/vg_host01-Lv_root9, see structure Copy code code example: Dffilesystem 1K-blocks used Available use%mounted on/dev/mapper/vg_host01-Lv_root206424760    767888 195173032   1% /Tmpfs8164776         0   8164776   0%/dev/SHM/dev/sda1495844     31571    438673   7% /Boot/dev/mapper/vg_host01-Lv_home51606140    184144  48800560   1% /Home notes: Uninstalled during the operation/home, inadvertently be someone else reboot, restart the process can not normally enter the CentOS reason:/etc/fstab before the home/home has been hung to the/dev/mapper/vg_host01-lv_home, reboot will be the content of/etc/fstab to detect each, not detected/Home Workaround:/etc/fstab about/dev/mapper/vg_host01-lv_home in this line, the save will find a read-only file, the system is not allowed to save, at this time using Mount-o remount, RW/can read/write the files in the directory to modify, After you save the restart, you can continue to expand the space.

Expand Lv-root Space Steps in CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.