As your business and application data grow, your data disk may run out of space. You can scale up the disk to increase its storage capacity.
Procedure
Step 1: Create a snapshot
Scaling up a data disk can cause data loss. Create a snapshot to back up your data before you proceed.
-
Go to the Servers page in the Simple Application Server console.
-
On the Servers page, find the server you want to back up and click its server ID on the server card.
-
Click the Disks tab.
-
In the Actions column for the data disk, click Create Snapshot.
-
In the Create Snapshot dialog box, confirm the disk information, name the snapshot, and then click OK.
Step 2: Scale up the data disk
-
Go to the Servers page in the Simple Application Server console.
-
Find the server you want to update, and click its server ID.
-
Click the Disks tab.
-
In the upper-left corner of the page, click Scale up a data disk.
-
In the Precautions dialog box, read the notes, and then click Data Disk Operation.
-
Confirm the current configuration and its expiration date. Then, next to Data Disk, select a new size for the data disk.
You can scale up a data disk to a maximum size of 16,380 GB.
ImportantData disks can only be scaled up, not scaled down.
-
Review and accept the terms of service, and then click Buy Now.
Follow the on-screen instructions to complete the payment.
-
Remotely connect to the Simple Application Server to extend the partition and file system within the server's operating system.
The steps vary depending on the server's operating system.
Linux
In this example, a data disk is scaled up from 40 GB to 60 GB.
NoteThe default device name for a data disk on a Simple Application Server is
/dev/vdb.-
Connect to your Linux server.
For more information, see Connect to a Linux server.
-
Run the following command to switch to the
rootuser:sudo su root -
Check the disk and partition information on the server.
-
Run the following command to view the disks on the server:
fdisk -luScaling up a data disk does not affect the system disk. Therefore, this example shows information only for the data disk (
/dev/vdb).[root@i2bp1h6se7u0xxx 3 admin]# fdisk -lu Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0008de3e Device Boot Start End Blocks Id System /dev/vda1 2048 83884031 41940992 83 Linux Disk /dev/vdb: 64.4 GB, 64424509440 bytes, 125829120 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/vdb1 1 83886079 41943039+ ee GPT [root@i2bp1h6se7xxx 3 admin]# -
Run the following command to view the partition information:
df -ThThe default file system type for the data disk partition (
/dev/vdb1) on a Simple Application Server is ext4. The command output shows that the file system is still 40 GB (the pre-scale-up size), which means you must extend both the partition and the file system.The command output shows that
/dev/vdb1is mounted to the/testdirectory with the ext4 file system type and a total size of 40 GB.[root@iZbp1h6se7u09oqdn xxx admin]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/vda1 ext4 40G 2.1G 36G 6% / devtmpfs devtmpfs 457M 0 457M 0% /dev tmpfs tmpfs 466M 0 466M 0% /dev/shm tmpfs tmpfs 466M 328K 466M 1% /run tmpfs tmpfs 466M 0 466M 0% /sys/fs/cgroup tmpfs tmpfs 94M 0 94M 0% /run/user/0 /dev/vdb1 ext4 40G 49M 38G 1% /test tmpfs tmpfs 94M 0 94M 0% /run/user/1000
-
-
Extend the partition.
-
Run the following command to install the gdisk utility.
You must perform this step if your partition uses the GPT format. If your partition uses the Master Boot Record (MBR) format, skip this step.
yum install gdisk -y -
Run the following command to install the growpart utility.
The command varies depending on the operating system version:
-
For CentOS 7 and later, run the following command:
yum install -y cloud-utils-growpart -
For Debian 9 and later or Ubuntu 14 and later, run the following commands in sequence:
Update the software sources.
apt-get updateInstall cloud-guest-utils.
apt-get install -y cloud-guest-utils
-
-
Run the following command to extend the partition:
NoteMake sure to include a space between
/dev/vdband1in the command.growpart /dev/vdb 1The output is as follows:
[root@iZbp1h6se7u09oqdmea**** admin]# growpart /dev/vdb 1 CHANGED: partition=1 start=2048 old: size=83881984 end=83884032 new: size=125827038 end=125829086If this command fails, troubleshoot the issue manually. For more information, see Step 1: Scale up the disk capacity.
-
-
Extend the file system.
The default file system of the data disk partition (
/dev/vdb1) on a Simple Application Server is ext4.-
Run the following command to extend the file system:
resize2fs /dev/vdb1 -
Run the following command to check the result:
df -ThThe command output shows that the file system size is now 60 GB, which indicates that the scale-up was successful.
The command output shows that
/dev/vdb1is mounted to/testwith a capacity of 59 GB, which indicates that the scale-up was successful.[root@iZbp1h6se7u09oxxxx admin]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/vda1 ext4 40G 2.1G 36G 6% / devtmpfs devtmpfs 457M 0 457M 0% /dev tmpfs tmpfs 466M 0 466M 0% /dev/shm tmpfs tmpfs 466M 332K 466M 1% /run tmpfs tmpfs 466M 0 466M 0% /sys/fs/cgroup tmpfs tmpfs 94M 0 94M 0% /run/user/0 /dev/vdb1 ext4 59G 52M 57G 1% /test tmpfs tmpfs 94M 0 94M 0% /run/user/1000After the scale-up is complete, verify that your data is intact and that your applications are running correctly.
-
If the scale-up is successful and your applications are running as expected, no further action is required.
-
If the scale-up fails, use the snapshot you created to roll back the disk. For more information, see Roll back a disk by using a snapshot.
-
-
Windows
In this example, the server is running Windows Server 2012 R2 64-bit. The Simple Application Server's data disk (D:) is scaled up from 40 GB to 60 GB.
-
Connect to the Windows server.
For more information, see Connect to a Windows server.
-
In the lower-left corner of the Windows desktop, right-click the Start icon
and then click Disk Management. -
In the Disk Management window, click to detect the unallocated capacity.
In this example, Disk 1 is the data disk.
-
Right-click the primary partition of Disk 1 and select Extend Volume.
-
In the Extend Volume Wizard, accept the default settings to complete the volume extension.
After the volume extension is complete, you can see in Disk Management that the D: partition on Disk 1 has been expanded to 60.00 GB NTFS with a Healthy (Primary Partition) status, which indicates that the data disk scale-up was successful.
After the scale-up, verify that your data is intact and that your applications are running correctly.
-
If the scale-up is successful and your applications are running as expected, no further action is required.
-
If the scale-up fails, use the snapshot you created to roll back the disk. For more information, see Roll back a disk by using a snapshot.
-
-