服务器上有两块磁盘,第一块是系统盘,第二块是数据盘。系统升级以后,数据盘需要登录进系统手动挂载。
df 查看磁盘分区:
挂载方法:
df 查看磁盘分区,可以看到/dev/xvdb1已经挂载到/mnt磁盘了
--
平时做好磁盘快照很关键,当遇到系统出问题或者系统升级这些场景,能够一键还原,保证数据不丢失。
云服务为开发者提供了很大的便利性。我这次升级前后不过几十分钟,点了几下按钮就完成了系统的平滑升级。赞!
可以的,可以升级配置。
升级配置:支持对当前实例的实例规格(CPU、内存)和基础公网带宽进行升级,同时可以将数据盘的付费模式从按量付费转换成包年包月,升级后新配置将覆盖实例的整个生命周期,您需要支付从当前配置到升级新配置的差价。
实例规格或经典网络类型实例的首次0Mbps带宽升级在您支付完成后需要通过ECS控制台或ECS API重启ECS实例,配置变更才能生效;通过其他方式重启实例无效。
在升级配置中可以升级ECS实例规格和CPU内存大小,也可以升级服务器公网带宽,如果只是想升级公网带宽,也可以在“带宽临时升级”中操作。
总结如下:
注意:升级服务器ECS规格及CPU内存配置需要重启云服务器,可以在变配生效之后,立即重启实例 (推荐),也可以预约重启实例。
以上为阿里云服务器ECS实例规格及CPU内存及公网带宽升级方法,可以参考官方文档:升降配方式汇总,官方文档有关于各种升级方式的详细说明。
如果是阿里云服务器磁盘升级可以使用“云盘扩容”的方式,参考:阿里云服务器磁盘扩容的方法(云盘不够用升级),本文来自云服务器吧(yunfuwuqiba.com)详细可以参考云服务器吧。
[root@test ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b6c99
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 83886046 41941999+ 83 Linux
Disk /dev/vdb: 100.4 GB, 107374182400 bytes, 209715200 sectors 需要挂载的磁盘
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@test~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xc247eca8.
Command (m for help): n 输入n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p 输入p
Partition number (1-4, default 1): 1
First sector (2048-209715199, default 2048): 回车
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): 回车
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set
Command (m for help): wq 输入wq退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@test~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b6c99
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 83886046 41941999+ 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xc247eca8
Device Boot Start End Blocks Id System
/dev/vdb1 2048 209715199 104856576 83 Linux 已创建/dev/vdb1分区
[root@test~]# mkfs.ext4 /dev/vdb1 格式化磁盘
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214144 blocks
1310707 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2174746624
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[root@test~]# mkdir /mnt 创建挂载目录
mkdir: cannot create directory ‘/mnt’: File exists
[root@Hilbert ~]# echo /dev/vdb1 /mnt ext4 defaults 0 0 >>/etc/fstab
[root@Hilbert ~]# cat /etc/fstab 写入新分区信息
#
# /etc/fstab
# Created by anaconda on Wed May 25 02:12:53 2022
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=d71b01a9-bf24-4afb-b7d9-3a0961522139 / ext4 defaults 1 1
/dev/vdb1 /mnt ext4 defaults 0 0
[root@test~]# mount /dev/vdb1 /mnt 把分区挂载在/mnt目录下
[root@test~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 608K 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/vda1 40G 2.1G 36G 6% /
tmpfs 783M 0 783M 0% /run/user/0
/dev/vdb1 98G 61M 91G 1% /mnt 新挂载的分区
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)