After attaching a data disk to your Simple Application Server, you must partition and format it before use.
Background information
You must partition and format an attached data disk before using it. The procedure varies depending on the operating system. Select the guide for your server's operating system:
-
For instructions on how to partition and format a data disk on a Linux server, see Partition and format a data disk on a Linux server.
-
For instructions on how to partition and format a data disk on a Windows server, see Partition and format a data disk on a Windows server.
Partitioning and formatting a data disk is a high-risk operation that erases all existing data. However, data disks attached during the creation of a Simple Application Server are new and empty. Therefore, you can format them without the risk of data loss.
Partition and format a Linux data disk
This guide demonstrates how to partition and format a data disk on a Linux server using the Parted and e2fsprogs utilities. The example uses a CentOS 7.6 64-bit operating system.
For data disks on Linux servers, we recommend using the GPT partition format and either the xfs or ext4 file system.
-
Connect to your Linux server and install the Parted and e2fsprogs utilities.
-
Remotely connect to the server.
For instructions, see Remote connection to a Linux server.
-
Run the following commands to switch to the
rootuser and navigate to the root directory.sudo su root cd -
Run the following commands to install the Parted and e2fsprogs utilities.
-
Install the Parted utility:
yum install -y parted -
Install the e2fsprogs utility:
yum install -y e2fsprogs
-
-
-
Run the following command to view information about the data disk.
fdisk -lThe command output displays the data disk information.
NoteA Simple Application Server can have only one data disk attached. By default, the device name of the disk is
/dev/vdb.
-
Use the Parted utility to partition the data disk.
-
Run the following command to start partitioning.
parted /dev/vdb -
Run the following command to set the partition table type to GPT.
mklabel gptThe system warns that this action erases all disk data. Since this is a new data disk, type Yes and press Enter.
-
Run the following command to create a primary partition that uses the entire disk space.
mkpart primary 1 100% -
Run the following command to check whether the partition is aligned.
align-check optimal 1The following output indicates that the partition is aligned.

-
Run the following command to view the partition table.
printThe partition table information is displayed as follows:

-
Run the following command to exit the Parted utility.
quit
-
-
Run the following command to reread the partition table.
partprobe -
Run the following command to create a file system on the /dev/vdb1 partition.
Run one of the following commands to create a file system based on your needs.
-
Create an ext4 file system.
mkfs -t ext4 /dev/vdb1 -
Create an xfs file system.
mkfs -t xfs /dev/vdb1
In this example, an ext4 file system is created.
-
-
Add the new partition to the /etc/fstab file to automatically mount it on system startup.
-
Run the following command to create a mount point named /test.
mkdir /test -
Run the following command to back up /etc/fstab.
cp /etc/fstab /etc/fstab.bak -
Run the following command to write the new partition information to /etc/fstab.
echo `blkid /dev/vdb1 | awk '{print $2}' | sed 's/\"//g'` /test ext4 defaults 0 0 >> /etc/fstabNoteIn this command, replace /dev/vdb1, /test, and ext4 with your partition device name, mount point, and file system type, respectively.
-
Run the following command to view the information in /etc/fstab.
cat /etc/fstabIf the new partition information appears in the output, the entry was added successfully.

-
Run the following command to mount the partitions specified in /etc/fstab.
mount -a
-
-
Run the following command to check the current disk space and usage.
df -hIf the new file system appears in the output, the mount is successful.

Partition and format a Windows data disk
The user interface may vary slightly depending on your Windows version. This example shows how to partition and format a data disk on a Windows Server 2012 R2 64-bit system.
-
Remotely connect to the Windows server.
For instructions, see Remote connection to a Windows server.
-
On the taskbar, right-click the
icon and then click Disk Management.
-
In the Disk Management window, locate the data disk that you want to partition and format (in this example, Disk 1). The disk status is offline.
-
Right-click Disk 1 and then click Online.

After you bring the disk online, the status of Disk 1 changes to not initialized.
-
Right-click Disk 1 and click Initialize Disk from the context menu.
-
In the Initialize Disk dialog box, select Disk 1, select GPT, and then click OK.
This example uses the GPT partition style. GPT and MBR are two partition styles:
-
GPT is a newer partition style that some earlier Windows versions cannot recognize. The maximum disk size that GPT supports depends on the operating system and file system. In Windows, a GPT disk can have up to 128 primary partitions.
-
MBR is the most commonly used partition style. MBR supports data disks up to 2 TiB and a maximum of four primary partitions. If you want to create more partitions, you must configure one primary partition as an extended partition and then create logical partitions within it.

-
-
In the Disk Management window, right-click the Unallocated area of Disk 1 and click New Simple Volume.

-
In the New Simple Volume Wizard, complete the following steps.
-
Click Next.
-
Specify the simple volume size.
If you want to create only one primary partition, keep the default value and click Next. You can also divide Disk 1 into multiple partitions.
-
Assign a drive letter or path.
Select a drive letter (for example, G in this example) and click Next.
-
Format the partition.
Configure the format settings, such as file system, allocation unit size, and volume label. You can also choose to Perform a quick format and Enable file and folder compression. In this example, keep the default settings and click Next.
-
Click Finish to complete the wizard.
Wait for the formatting process to complete. In Disk Management, the status of Disk 1 changes to healthy, indicating the partition was formatted successfully.

-
icon and then click Disk Management.



