Skip to content

Instantly share code, notes, and snippets.

@jim0409
Forked from troyfontaine/readme.md
Created May 2, 2021 06:11
Show Gist options
  • Save jim0409/a14982741b7246f6dca8777ea18cd34b to your computer and use it in GitHub Desktop.
Save jim0409/a14982741b7246f6dca8777ea18cd34b to your computer and use it in GitHub Desktop.

Revisions

  1. @troyfontaine troyfontaine revised this gist Mar 28, 2017. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -58,4 +58,10 @@ rm -rf /temp
    ```

    ## Step 9 - Remove the entry from /etc/fstab
    Using your preferred text editor, ensure you open `/etc/fstab` and remove the line for /dev/mapper/cl-home.
    Using your preferred text editor, ensure you open `/etc/fstab` and remove the line for /dev/mapper/cl-home.

    ## Step 10 - Don't miss this!
    Run the following command to sync systemd up with the changes.
    ```bash
    dracut --regenerate-all --force
    ```
  2. @troyfontaine troyfontaine revised this gist Mar 28, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -55,4 +55,7 @@ cp -a /temp/home /
    ## Step 8 - Remove the temporary location
    ```bash
    rm -rf /temp
    ```
    ```

    ## Step 9 - Remove the entry from /etc/fstab
    Using your preferred text editor, ensure you open `/etc/fstab` and remove the line for /dev/mapper/cl-home.
  3. @troyfontaine troyfontaine revised this gist Mar 26, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Remove /home partition on CentOS 7 Online
    This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home.
    # Resize root partition (or how to remove the default /home partition) on CentOS 7 online
    This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home on the target machine.

    The examples are from a default installation with no customation-you NEED to know what you're working with for partitions to not mess this up.
    The examples are from a default installation with no customation-you NEED to know what you're working with for volumes/partitions to not horribly break things.

    By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: `/`,`/home` and

  4. @troyfontaine troyfontaine revised this gist Mar 26, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -45,4 +45,14 @@ lvextend -L+406G /dev/cl/root
    ## Step 6 - Resize the root partition
    ```bash
    xfs_growfs /dev/mapper/cl-root
    ```

    ## Step 7 - Copy the /home contents back into the /home directory
    ```bash
    cp -a /temp/home /
    ```

    ## Step 8 - Remove the temporary location
    ```bash
    rm -rf /temp
    ```
  5. @troyfontaine troyfontaine revised this gist Mar 26, 2017. 1 changed file with 21 additions and 2 deletions.
    23 changes: 21 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -18,12 +18,31 @@ Once that is finished at your back at the prompt, you can proceed to step 2.
    umount -fl /home
    ```

    ## Step 3 - Remove the logical volume
    ## Step 3 - Note the size of the home LVM volume
    We run the `lvs` command to display the attributes of the LVM volumes
    ```bash
    lvs
    ```
    Sample output:
    ```bash
    LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    home cl -wi-a----- 406.94g
    root cl -wi-ao---- 50.00g
    swap cl -wi-ao---- 7.81g
    ```

    ## Step 4 - Remove the home LVM volume
    ```bash
    lvremove /dev/cl/home
    ```

    ## Step 4 - Resize the root partition
    ## Step 5 - Resize the root LVM volume
    Based on the output of `lvs` above, I can safely extend the root LVM by 406GiB.
    ```bash
    lvextend -L+406G /dev/cl/root
    ```

    ## Step 6 - Resize the root partition
    ```bash
    xfs_growfs /dev/mapper/cl-root
    ```
  6. @troyfontaine troyfontaine created this gist Mar 26, 2017.
    29 changes: 29 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Remove /home partition on CentOS 7 Online
    This requires you to be able to ssh into the instance using the root user account and that no services be running as users out of /home.

    The examples are from a default installation with no customation-you NEED to know what you're working with for partitions to not mess this up.

    By default, CentOS 7 uses XFS for the file system and Logical Volume Manager (LVM), creating 3 partitions: `/`,`/home` and

    ## Step 1 - Copy /home Contents
    To backup the contents of /home, do the following:
    ```bash
    mkdir /temp
    cp -a /home /temp/
    ```
    Once that is finished at your back at the prompt, you can proceed to step 2.

    ## Step 2 - Unmount the /home directory
    ```bash
    umount -fl /home
    ```

    ## Step 3 - Remove the logical volume
    ```bash
    lvremove /dev/cl/home
    ```

    ## Step 4 - Resize the root partition
    ```bash
    xfs_growfs /dev/mapper/cl-root
    ```