当前位置:网站首页>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 :)
边栏推荐
- Interviewer: is acid fully guaranteed for redis transactions?
- How can labels/legends be added for all chart types in chart. js (chartjs.org)?
- II. Data type
- Solve the error 1045 of Navicat creating local connection -access denied for user [email protected] (using password
- Distributed cache architecture - cache avalanche & penetration & hit rate
- Four operations and derivative operations of MATLAB polynomials
- Implementing Yang Hui triangle with cyclic queue C language
- Handwriting blocking queue: condition + lock
- Get all stock data of big a
- 16 channel water lamp experiment based on Proteus (assembly language)
猜你喜欢
Yum only downloads the RPM package of the software to the specified directory without installing it
Pytoch loads the initialization V3 pre training model and reports an error
Matlab boundarymask function (find the boundary of the divided area)
Get the variable address of structure member in C language
- [email protected] (using password"/>
Solve the error 1045 of Navicat creating local connection -access denied for user [email protected] (using password
Migrate data from Mysql to neo4j database
嵌入式软件架构设计-消息交互
Preliminary exploration of basic knowledge of MySQL
Get all stock data of big a
Matlab struct function (structure array)
随机推荐
ZABBIX ODBC database monitoring
Matlab imoverlay function (burn binary mask into two-dimensional image)
byte2String、string2Byte
Want to ask, how to choose a securities firm? Is it safe to open an account online?
Distributed solution - Comprehensive decryption of distributed task scheduling platform - xxljob scheduling center cluster
Resnet+attention project complete code learning
MVVM framework part I lifecycle
Seven polymorphisms
Get all stock data of big a
Master the new features of fluent 2.10
NPM install reports an error
语义分割实验:Unet网络/MSRC2数据集
Understanding the architecture type of mobile CPU
IPv6与IPv4的区别 网信办等三部推进IPv6规模部署
Recyclerview paging slide
MySQL data table operation DDL & data type
[hdu 2096] Xiaoming a+b
Xi IO flow
Distributed solution - distributed session consistency problem
Learn JVM garbage collection 02 - a brief introduction to the reference and recycling method area