Skip to content

NoneAvobeAll/backupPlan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Server Disk Expansion Plan – Expanding / (Root Filesystem)

Objective

Expand the root (/) filesystem by adding a new disk while ensuring system stability and minimal downtime.


Pre-Expansion Activities

1. Backup Strategy (Critical Step)

Ensure data safety before making changes.

Application Backup (Handled by our team)
Database Backup (Handled by our team)
OS Backup (Handled by the client)

2. Verify Current Disk Space & Layout

Run the following commands to analyze disk usage and partitioning:

df -h
lsblk
fdisk -l
mount | grep "on / "
  • Confirm the current root filesystem type (ext4, XFS, etc.).
  • Identify whether / is on LVM or a standard partition.

3. Check Active Services & Dependencies

  • Identify critical services running on /:
    systemctl list-units --type=service --state=running
  • Inform stakeholders of any potential downtime.

Disk Expansion Execution

Step 1: Add & Verify the New Disk

  1. After attaching the new disk, confirm its detection:
    lsblk
    dmesg | tail
    fdisk -l
    Assume the new disk is /dev/sdb (adjust based on your system).

Step 2: Expanding / Based on Current Setup

A. If Root (/) is on LVM (Recommended Method)

  1. Create a Physical Volume (PV) on the New Disk
    pvcreate /dev/sdb
  2. Extend the Volume Group (VG)
    vgextend vg_root /dev/sdb
  3. Extend the Logical Volume (LV)
    lvextend -l +100%FREE /dev/vg_root/lv_root
  4. Resize the Root Filesystem
    • For ext4:
      resize2fs /dev/vg_root/lv_root
    • For XFS:
      xfs_growfs /
  5. Verify Expansion
    df -h /

B. If Root (/) is on a Standard Partition (Non-LVM)

This method may require a reboot and booting into a live environment.

  1. Check Current Partitioning Scheme
    fdisk -l
  2. Expand the Root Partition
    • Use fdisk, parted, or growpart:
      growpart /dev/sda 1  # Adjust partition number as needed
  3. Resize the Filesystem
    • For ext4:
      resize2fs /dev/sda1
    • For XFS:
      xfs_growfs /
  4. Reboot (If Required)
    reboot

Post-Expansion Verification

1. Validate Expansion

df -h /
lsblk

2. Check Application & Database Functionality

Restart necessary services and validate operations:

systemctl restart <service>

3. Monitor Logs for Errors

dmesg | tail -50
journalctl -xe

Rollback Plan (In Case of Failure)

  • If issues arise, boot into a live environment and restore from backup.
  • For LVM errors, revert changes using:
    vgcfgrestore vg_root
  • Run fsck if filesystem corruption occurs.

Final Steps

✅ Update documentation on disk changes.
✅ Notify stakeholders that expansion is complete.
✅ Monitor disk performance over the next few days.


Expected Outcome

  • / (root) successfully expanded with additional disk space.
  • No service disruptions or data loss.

About

Server Disk Expansion Plan – Expanding / (Root Filesystem)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors