Introduction

When additional storage is attached to a Linux server or VPS, the operating system typically detects the new disk but does not automatically partition, format, or mount it. Before the storage can be used, it must be properly initialized by creating a partition table, defining one or more partitions, formatting them with a supported filesystem, and mounting them to a directory within the server’s filesystem hierarchy.

This guide walks through the process of identifying a newly attached disk, creating a partition using parted, formatting it with an ext3 filesystem, configuring automatic mounting through /etc/fstab, and mounting the partition for immediate use. Following these steps ensures that the new storage is available after system reboots and can be used for backups, application data, or general file storage.


Prerequisites

Before proceeding, ensure the following requirements are met:

System Access

  • Root or sudo access to the server.
  • SSH access to the Linux server or VPS.

Storage Requirements

  • A new disk has been attached to the server by the hosting provider or cloud platform.
  • The disk is visible to the operating system but has not yet been partitioned or formatted.

Verification

  • Confirm the device name of the new disk (for example, /dev/xvdb, /dev/sdb, or /dev/vdb).
  • Verify that the disk does not contain any existing data that must be preserved.

Recommended Precautions

  • Take backups of any important data before modifying disk partitions.
  • Verify the target device carefully to avoid accidentally formatting an existing production disk.
  • Ensure sufficient permissions to modify /etc/fstab.

Required Utilities

The following utilities should be available on the server:

  • fdisk
  • parted
  • mkfs
  • mount
  • vi or another text editor

Most Linux distributions include these tools by default.


Conclusion

By completing this procedure, the newly attached disk is successfully partitioned, formatted, and mounted for use on the server. Adding the mount configuration to /etc/fstab ensures that the filesystem is automatically mounted after every reboot, providing persistent access to the storage.

After mounting the disk, it is recommended to verify available space using commands such as df -h and confirm that the filesystem is functioning correctly. Regular monitoring of disk usage and filesystem health can help prevent storage-related issues and ensure reliable operation of applications and backups that depend on the new storage volume.

Leave a Reply