当前位置:网站首页>Add a new cloud disk to Huawei virtual machine
Add a new cloud disk to Huawei virtual machine
2022-07-05 12:34:00 【just4you】
background
Have been borrowing a friend's Huawei virtual machine , System disk only 40G, Small as it is , But only run some simple test programs , That's enough. .
Log in to the virtual machine console today to adjust the configuration , I found another 100G My cloud disk has been empty ...... Still too young !!
Add hard disk
View disk information
Use command "fdisk -l" View disk information .
You can see 100G Cloud disk , No partition yet .
Linux Partition format description : /dev/vda,/dev/vdb, /dev/vda1
- vd: Represents the type of hard disk . This shows vd( Virtual machine , I guess it is. VirtualDisk Abbreviation ). There are other sd(SCSI Hard disk )、hd( Ordinary hard disk ) And so on .
- a,b: vd In the heel a or b, Indicates the serial number of the hard disk , The first hard disk a, The second hard disk b. Here, cloud disk is the second hard disk , So show b. If there is a hard disk , Should be c 了 .
- Numbers 1: It's the partition number . According to the picture above :/dev/vda The system disk has only one partition ,/dev/vdb There are currently no partitions , So its partition list is empty .
Yes /dev/vdb partition
Carry out orders "fdisk /dev/vdb", Ready to start partitioning .
Partition operation
explain :
- Primary partition (primary) You can create 4 individual . Because it uses a new disk , There is no primary partition , So the number of the main partition here is from 1 Start .
- Sector of partition , Because it is the first partition , So you can directly use the system default .
- Partition size , If not set , If you enter directly , Then the whole new disk will be used .
View the newly created partition
Partition formatting
Use command “mkfs.ext4 /dev/vdb1" Format the partition .
Use “mkfs -t ext4 -c /dev/vdb1” It's fine too .
-t: Specify the partition format . Just remember ext4 Than ext3 All right .
Mount new partition
Create a new directory & mount
mkdir /data/morefiles
mount /dev/vdb1 /data/morefiles
Be careful : If /data/morefiles There are documents in , After mounting , The original document is not visible ( It is equivalent to that the original folder points to the new disk location . After uninstalling , The original document is visible )
Unload command :umount /dev/vdb1
View the mounting effect
Set up auto mount after power on
perform mount After the command mounts the new disk , If the server restarts , The mount will fail , Need to mount again .
Edit the file :/etc/fstab
Add the following :
/dev/vdb1 /data/morefiles ext4 defaults 1 1
Parameter description :
- /dev/vdb1: Partition device file name or UUID
- /data/morefiles: Mount point
- ext4: file system name
- defaults: Mount parameters
- Partition is for dump Backup .0( No backup );1( Back up every day );2( Backup from time to time ). When choosing daily backup , You will find one in the directory “lost and found” Catalog , For backup .
- Whether it is fsck testing .0( Don't test ), Other numbers represent detection priority ( The smaller the number is. , The higher the priority )
problem
Sometimes the following prompt appears when saving formatted information :
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
here , Try the command “partprobe” Solve . Or restart the server :)
边栏推荐
- Array cyclic shift problem
- Redis's memory elimination mechanism, read this article is enough.
- Distributed solution - distributed session consistency problem
- Learn JVM garbage collection 05 - root node enumeration, security points, and security zones (hotspot)
- 信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
- MySQL splits strings for conditional queries
- What is the difference between canvas and SVG?
- MySQL data table operation DDL & data type
- Making and using the cutting tool of TTF font library
- Solve the problem of cache and database double write data consistency
猜你喜欢
Implementing Yang Hui triangle with cyclic queue C language
Seven ways to achieve vertical centering
[figure neural network] GNN from entry to mastery
Constructing expression binary tree with prefix expression
Why learn harmonyos and how to get started quickly?
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
Pytoch implements tf Functions of the gather() function
Storage Basics
7月华清学习-1
Matlab struct function (structure array)
随机推荐
Read and understand the rendering mechanism and principle of flutter's three trees
MySQL basic operation -dql
嵌入式软件架构设计-消息交互
C alarm design
Cypher syntax of neo4j graph database
Programming skills for optimizing program performance
Introduction to relational model theory
Get data from the database when using JMeter for database assertion
Distributed cache architecture - cache avalanche & penetration & hit rate
Detailed steps for upgrading window mysql5.5 to 5.7.36
Matlab superpixels function (2D super pixel over segmentation of image)
Understand kotlin from the perspective of an architect
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Matlab boundarymask function (find the boundary of the divided area)
MySQL constraints
MySQL function
ZABBIX agent2 installation
How does MySQL execute an SQL statement?
MySQL multi table operation
Design of music box based on assembly language