markdown 调整AWS RHEL实例上的主卷大小

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 调整AWS RHEL实例上的主卷大小相关的知识,希望对你有一定的参考价值。

* Given a volume ID $volid modified the size to $size GB
`aws ec2 modify-volume --volume-id $volid --size $size`

* Verify that disk $dev reports proper size (e.g. `dev=/dev/sda1`)
`sudo parted -l $dev`

* Use fdisk (interactively) to remove the desired partition.
```shell
$ sudo fdisk $dev
Command (m for help): p

Disk /dev/nvme0n1: 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: gpt
Disk identifier: F27664E9-0E9F-434A-9AB6-62C730E0F0DF


#         Start          End    Size  Type            Name
 1         2048         4095      1M  BIOS boot parti
 2         4096     20971486     10G  Microsoft basic

Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 is deleted

Command (m for help): n
Partition number (2-128, default 2):
First sector (34-209715166, default 4096):
Last sector, +sectors or +size{K,M,G,T,P} (4096-209715166, default 209715166):
Created partition 2


Command (m for help): p

Disk /dev/nvme0n1: 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: gpt
Disk identifier: F27664E9-0E9F-434A-9AB6-62C730E0F0DF


#         Start          End    Size  Type            Name
 1         2048         4095      1M  BIOS boot parti
 2         4096    209715166    100G  Linux filesyste

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

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.
```

* Reboot the system
`sudo shutdown -r`

* Verify that the partition has been successfully resized
`df -h`

以上是关于markdown 调整AWS RHEL实例上的主卷大小的主要内容,如果未能解决你的问题,请参考以下文章

在 Python 中读取和/或更改 Windows 8 主卷 [重复]

关于使用AWS上的RHEL-8.x/Redhat系统使用自己单独购买的Redhat官网license导致的yum命令报错处理

AWS EC2 Autoscaling:定义一个永不终止的主实例

markdown EC2上的AWS redis-cli

如何在 aws Secrets Manager 服务中管理 aws RDS(由 cloudformation 创建)的主用户凭证?

从 Windows 部署到 aws 上的 ubuntu 实例