Resizing a Linode Volume Disk on Debian 12: A Step-by-Step Tutorial
If you’re using Linode Volume Disk, the name is “/mnt/disk-rdbms-slave-x51n61-data”,config as “/dev/sdc” and need to resize it from 20GB to 30GB without transferring data to another disk, this guide will walk you through the entire process.
It covers resizing the volume, checking and repairing the filesystem, and ensuring everything works seamlessly after the operation.
Step 1: Resize the Volume in Linode Cloud Manager
- Log in to the Linode Cloud Manager.
- Navigate to the Volumes section.
- Select the volume you wish to resize.
- Use the Resize Volume option to increase its size from 20GB to 30GB.
- Wait for the resizing operation to complete. This step increases the allocated space for the volume but does not automatically resize the filesystem on the server.
Step 2: Verify the New Size
After resizing the volume, check the updated size on your server:
1 2 |
lsblk |
The output should reflect the updated size of 30GB. For example:
1 2 3 |
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sdc 8:32 0 30G 0 disk /mnt/disk-rdbms-slave-x51n61-data |
Step 3: Unmount the Volume
Before resizing the filesystem, unmount the volume:
1 2 |
sudo umount /mnt/disk-rdbms-slave-x51n61-data |
This ensures no processes are accessing the volume during the operation.
Step 4: Check and Repair the Filesystem
Run a filesystem check to ensure its integrity and repair any issues:
1 2 |
sudo e2fsck -f /dev/sdc |
Example output:
1 2 3 4 5 6 7 8 9 10 11 12 |
Pass 1: Checking inodes, blocks, and sizes Inode 786759 extent tree (at level 1) could be narrower. Optimize<y>? yes Inode 786777 extent tree (at level 1) could be narrower. Optimize<y>? yes Pass 1E: Optimizing extent trees Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdc: ***** FILE SYSTEM WAS MODIFIED ***** /dev/sdc: 433/1310720 files (21.9% non-contiguous), 519490/5242880 blocks |
If any issues are found, they will be repaired automatically when you confirm.
Step 5: Resize the Filesystem
Resize the filesystem to utilize the full 30GB of space:
1 2 |
sudo resize2fs /dev/sdc |
Example output:
1 2 3 4 |
resize2fs 1.47.0 (5-Feb-2023) Resizing the filesystem on /dev/sdc to 7864320 (4k) blocks. The filesystem on /dev/sdc is now 7864320 (4k) blocks long. |
This extends the filesystem to match the new size of the volume.
Step 6: Remount the Volume
After resizing, remount the volume:
1 2 |
sudo mount /mnt/disk-rdbms-slave-x51n61-data |
Step 7: Verify the Resizing
To confirm the volume now uses the full 30GB, check its size:
1 2 |
df -h /mnt/disk-rdbms-slave-x51n61-data |
Example output:
1 2 3 |
Filesystem Size Used Avail Use% Mounted on /dev/sdc 30G 5.0G 25G 17% /mnt/disk-rdbms-slave-x51n61-data |
Step 8: Test Data Integrity
Finally, verify that all your files and data are intact:
1 2 |
ls /mnt/disk-rdbms-slave-x51n61-data |
Conclusion
Resizing a Linode Volume Disk on Debian 12 is straightforward when following these steps. By ensuring the volume is properly resized and the filesystem is extended, you can expand storage without losing any data. Always remember to back up critical data before making changes to disk volumes or filesystems.
Let us know in the comments if this guide was helpful or if you encountered any issues!