Format an iSCSI volume as a file system and flush the cache to the iSCSI volume. This procedure is supported on both Windows and Linux operating systems.
Prerequisites
Ensure the following requirements are met:
-
You have connected the host to the iSCSI volume on the block gateway.
-
You have administrator or sudo permissions on the host.
Windows
This section describes how to format an iSCSI volume as a file system and flush the cache to synchronize data with the volume.
-
Connect to the iSCSI volume.
For details, see Use volumes on Windows.
-
Format the iSCSI volume as a file system.
-
Open Windows Disk Management. If the iSCSI volume shows as Unallocated or a new disk, right-click the disk, select , and select a suitable partition style.
-
Right-click the unallocated space, select New Simple Volume, and follow the wizard to create the volume.
-
Right-click the new volume and select Format. Set the file system to NTFS, keep the default allocation unit size, select Quick Format, and click Start.
-
-
Flush the cache to synchronize data with the iSCSI volume.
-
Download and install Sync from Sync v2.2.
-
Open a command prompt as an administrator.
-
Run the sync command to flush the cache to the iSCSI volume.
For 32-bit operating systems:
# Replace f: with the drive letter for your file system. sync.exe -r f:For 64-bit operating systems:
# Replace f: with the drive letter for your file system. sync64.exe -r f:
-
Linux
This section describes how to connect to the iSCSI volume, format and mount it as a file system, and flush the cache to synchronize data with the volume.
-
Connect to the iSCSI volume. For details, see Use volumes on a Linux ECS instance.
-
Format the iSCSI volume as a file system.
# Find the iSCSI device. This example uses /dev/vdb. lsblk # Create a disk partition. sudo fdisk /dev/vdb # Create a file system. Linux supports various file systems. This example uses ext4. sudo mkfs.ext4 /dev/vdb1 -
Mount the file system.
# Create a mount point. sudo mkdir /mnt/iscsi # Mount the file system. sudo mount /dev/vdb1 /mnt/iscsi -
Flush the cache to synchronize data with the iSCSI volume.
sudo sync
Unmounting the file system also flushes the cache to the iSCSI volume.
-