No results found. Please try re-entering the product name
Compute
Database
Office Automation
Middleware
Partners
Intelligent Management
Backup
Big Data
Management & Monitoring
Customer service
Network&CDN
Communication
IT Management
General Reference
Initialize an EBS Disk (Linux)
When an EBS disk is mounted to the ECS as a data disk, it is offline by default. You need to initialize the data disk to format and partition the data disk, and create a file system so as to use it normally.
In this example, the capacity of the newly mounted data disk is 20 GB and the disk name is /dev/vdb. Create a single partition data disk and format it into an ext3 file system. Optimized instance I/O is used, and the operating system is CentOS 7.6.
1s /dev/vd*
In the information displayed, /dev/vda is the system disk, and /dev/vdb is the data disk mounted this time.
fdisk -1 /dev/vdb
fdisk /dev/vdb
Type in n
and press Enter to create a new partition.
In the information displayed, p
represents a primary partition, and e
represents an extended partition. In this example, a primary partition will be created.
Type in p
and press Enter to create a primary partition.
In the information displayed, Partition number
represents the serial number of the primary partition. The value range is from 1 to 4. The default value is 1.
Type in the number and press Enter. Or press Enter directly and the system will use the default value 1.
In the information displayed, First sector
represents the serial number of the first sector. The value range is from 2048 to 20971519, and the default value is 2048.
Type in the number and press Enter. Or press Enter directly and the system will use the default value 2048.
In the information displayed, Last sector
represents the serial number of the last sector. The value range is from 2048 to 41943039, and the default value is 41943039.
Type in the number and press Enter. Or press Enter directly and the system will use the default value 41943039.
A primary partition has been created for a data disk of 20 GB.
Type in p
and press Enter to view details of the partition.
In the information displayed, /dev/vdb1 is the newly created partition.
Type in w
and press Enter to write the result to the partition table.
The above information indicates that the partition is successfully created.
q
, and the partition created before will be discarded. Run the command fdisk -l
to view the new partition.
mkfs.ext3 /dev/vdb1
etc/fstab
.
cp /etc/fstab /etc/fstab.bak
/etc/fstab
.
Information of the manually mounted disk must be written to the file /etc/fstab. Otherwise, if the server is restarted, you need to remount the disk.
There are two ways for mounting:
Mount the disk using the partition number.
echo /dev/vdb1 /mnt ext3 defaults 0 0 >> /etc/fstab
Mount the disk using UUID.
Run the command blkid /dev/vdb1
to view the information of UUID.
echo UUID=b7fc63da-be58-4aa5-bf6e-3651e3bb59bd /mnt ext3 defaults 0 0 >> /etc/fstab
etc/fstab
.
cat etc/fstab
mount /dev/vdb1 /mnt
df -h
Call us
400-151-8800
Email us
cloud@pingan.com