当前位置:网站首页>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 :)
边栏推荐
- GPON other manufacturers' configuration process analysis
- Understand kotlin from the perspective of an architect
- Clear neo4j database data
- Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
- 图像超分实验:SRCNN/FSRCNN
- Learn JVM garbage collection 05 - root node enumeration, security points, and security zones (hotspot)
- Take you two minutes to quickly master the route and navigation of flutter
- One article tells the latest and complete learning materials of flutter
- July Huaqing learning-1
- Programming skills for optimizing program performance
猜你喜欢

Constructing expression binary tree with prefix expression

mysql拆分字符串做条件查询

Matlab superpixels function (2D super pixel over segmentation of image)

MySQL storage engine

Detailed structure and code of inception V3

How can beginners learn flutter efficiently?

UNIX socket advanced learning diary -ipv4-ipv6 interoperability

Average lookup length when hash table lookup fails

MySQL splits strings for conditional queries
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
随机推荐
How to clear floating?
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
GPS data format conversion [easy to understand]
Distributed cache architecture - cache avalanche & penetration & hit rate
Learn the memory management of JVM 03 - Method area and meta space of JVM
MySQL installation, Windows version
Summary of C language learning problems (VS)
信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
Hexadecimal conversion summary
Interviewer: is acid fully guaranteed for redis transactions?
C language structure is initialized as a function parameter
Constructing expression binary tree with prefix expression
Get all stock data of big a
Distributed solution - distributed session consistency problem
ZABBIX monitors mongodb templates and configuration operations
What is the difference between canvas and SVG?
Want to ask, how to choose a securities firm? Is it safe to open an account online?
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
GNN(pytorch-geometric)
Solve the problem of cache and database double write data consistency