← Back to list

How I Expanded MongoDB Storage on a Linux VM Without Reconfiguring MongoDB

One of our production MongoDB servers started approaching storage limits. Instead of creating a new disk and migrating data, we decided to…

Durgesh Mishra · 2026-06-25 02:47 · 0 claps · 1.7 min read
#linux #mongodb #storage #upgrade #expand
Open on Medium ↗
Wiki topics: RAG · RAG & Retrieval 🔓 · Open Source

How I Expanded MongoDB Storage on a Linux VM Without Reconfiguring MongoDB

One of our production MongoDB servers started approaching storage limits. Instead of creating a new disk and migrating data, we decided to expand the existing data disk and keep MongoDB using the same mount point.

The entire process took only a few minutes and required no MongoDB configuration changes.

Environment

  • MongoDB running on Linux VM
  • Database files stored under /mnt/data
  • Existing data disk attached to VM
  • Goal: Increase storage capacity with minimal disruption

Step 1: Verify the Existing Mount Configuration

Before resizing the disk, verify the mount point configuration in /etc/fstab.

In our case, MongoDB data was stored on a dedicated disk mounted at /mnt/data.

Example entry:

UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /mnt/data auto defaults,nofail 0 1

If the entry is missing, add it:

echo "UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e /mnt/data auto defaults,nofail 0 1" >> /etc/fstab

Step 2: Stop the Virtual Machine

To safely resize the disk, shut down the VM.

This ensures the disk is not actively being written to during the resize operation.

Step 3: Increase the Disk Size

Expand the data disk from the cloud platform or virtualization layer.

Examples:

  • Azure Managed Disk
  • AWS EBS Volume
  • VMware Virtual Disk

After resizing, start the VM.

Step 4: Create the Mount Directory

If the mount point does not already exist:

mkdir -p /mnt/data

Step 5: Mount the Disk

Reload mounts using:

mount -a

This reads /etc/fstab and mounts any configured file systems.

Step 6: Verify Storage Expansion

Confirm the mount and available space:

df -h

Example output:

Filesystem      Size Used Avail Use% Mounted on
/dev/sdc1       500G 220G 280G 45% /mnt/data

Verify that the increased disk capacity is visible.

Step 7: Start MongoDB

Start the MongoDB service:

systemctl start mongod

Verify status:

systemctl status mongod

Validation

After MongoDB starts:

  • Confirm databases are accessible.
  • Check MongoDB logs.
  • Validate application connectivity.
  • Verify new data can be written successfully.

Lessons Learned

A storage expansion does not always require database migration or MongoDB reconfiguration. By maintaining the same mount point and expanding the underlying disk, MongoDB can continue operating normally while gaining additional storage capacity.

This approach minimized downtime and avoided the complexity of moving database files between disks.

If you’re running MongoDB on Azure, AWS, VMware, or any Linux-based virtual machine, expanding the existing data disk is often the simplest and safest way to increase database storage.


메타데이터
post_id
0b26b11a4bc4
slug
how-i-expanded-mongodb-storage-on-a-linux-vm-without-reconfiguring-mongodb-0b26b11a4bc4
url
https://medium.com/@durgeshmishrablog/how-i-expanded-mongodb-storage-on-a-linux-vm-without-reconfiguring-mongodb-0b26b11a4bc4
canonical_url
https://medium.com/@durgeshmishrablog/how-i-expanded-mongodb-storage-on-a-linux-vm-without-reconfiguring-mongodb-0b26b11a4bc4
author_url
https://medium.com/@durgeshmishrablog
status
ok
fetched_at
2026-07-15 01:28:29