首页
导航
博客
电子书
算法
众创
代码
随贴
关于我们
您好,欢迎来到码863代码分享网! 请
[登录]
/
[注册]
搜 索
标题:
*
140
字
TAG标签:
(用空格隔开)
30
字
恢复历史版本:
请选择分类
html
python
javascript
php
sql
c
c++
c#
java
plain
所有人可见
仅自己可见
编辑器:UEditor
编辑器:TinyMCE
编辑器:Editor.md
HTML转MD
HTML转MD2
<p><a href="https://www.niaoyun.com/docs/16483.html" _src="https://www.niaoyun.com/docs/16483.html">https://www.niaoyun.com/docs/16483.html</a></p><p><br/></p><p>lsblk<span style="white-space: pre;"></span>查看分区和磁盘</p><p>df -h<span style="white-space:pre"></span>查看空间使用情况</p><p>fdisk -l<span style="white-space:pre"></span>分区工具查看分区信息</p><p>cfdisk /dev/sda <span style="white-space:pre"></span>查看分区</p><p>blkid 查看硬盘label(别名)</p><p>du -sh ./* 统计当前目录各文件夹大小</p><p>free -h 查看内存大小</p><p>cat /proc/cpuinfo| grep "cpu cores"| uniq 查看cpu核心数</p><p> </p><p style="margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="" margin-top:="" 0px="">当云服务器使用一段时间后可能会有数据盘空间不足的情况,那么升级数据盘大小之后就需要进行系统内部磁盘空间扩容操作,这边以数据盘<code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">20G</code>升级为<code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">30G</code>为例(<span style="margin: 0px; padding: 0px; box-sizing: border-box; list-style: none; font-weight: 700;">针对此操作时需小心谨慎操作,操作失误将会导致数据丢失,建议先备份好数据再进行操作</span>):</p><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:=""><img src="/ueditor/php/upload/image/20181226/1545756172637995.jpg" alt="1.jpg" style="margin: 0px 0px 0px 18.3906px; padding: 0px; box-sizing: border-box; list-style: none; border: 0px; max-width: 97%; box-shadow: rgb(204, 204, 204) 0px 1px 5px;" title="1545756172637995.jpg"/></p><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:=""><img src="/ueditor/php/upload/image/20181226/1545756188731775.jpg" alt="2.jpg" style="margin: 0px 0px 0px 18.3906px; padding: 0px; box-sizing: border-box; list-style: none; border: 0px; max-width: 97%; box-shadow: rgb(204, 204, 204) 0px 1px 5px;" title="1545756188731775.jpg"/></p><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="">1、卸载挂载中的数据盘:</p><pre class="prettyprint linenums prettyprinted" style="margin-top: 0px; margin-bottom: 16px; padding: 2px; box-sizing: border-box; list-style: none; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13.6px; line-height: 1.6; font-family: Consolas, " liberation="" overflow-wrap:="" overflow:="" background-color:="" border-radius:="" border:="" 1px="" solid="" color:="">umount /dev/sdb1</pre><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="">2、使用parted工具读取磁盘分区表信息;先使用 <code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">p</code> 查看可扩容磁盘大小,再通过<code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">unit s</code>命令定义默认使用sectors展示,获取起始位置信息:</p><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:=""><img src="/ueditor/php/upload/image/20181226/1545756208519738.jpg" alt="3.jpg" style="margin: 0px 0px 0px 18.3906px; padding: 0px; box-sizing: border-box; list-style: none; border: 0px; max-width: 97%; box-shadow: rgb(204, 204, 204) 0px 1px 5px;" title="1545756208519738.jpg"/></p><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="">3、创建新分区。先使用 <code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">rm + 序列号</code> 来删除老的分区表;然后使用 <code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">mkpart</code> 命令来创建即可,这里需要注意的是parted工具里END的值,由于一般大家都不清楚具体的扇区数量,可以使用容量来替代。</p><ul style="list-style-type: none;" class=" list-paddingleft-2"><li><p><span style="margin: 0px; padding: 0px; box-sizing: border-box; list-style: none; font-weight: 700;">请注意以下操作步骤需要处于<code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">unit s</code>的<code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">sectors</code>扇区模式中操作,否则将导致数据盘扩展异常</span></p></li></ul><pre class="prettyprint linenums prettyprinted" style="margin-top: 0px; margin-bottom: 16px; padding: 2px; box-sizing: border-box; list-style: none; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13.6px; line-height: 1.6; font-family: Consolas, " liberation="" overflow-wrap:="" overflow:="" background-color:="" border-radius:="" border:="" 1px="" solid="" color:="">rm 1mkpart primary ext4 2048 32.2G</pre><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:=""><img src="/ueditor/php/upload/image/20181226/1545756295535898.jpg" alt="4.jpg" style="margin: 0px 0px 0px 18.3906px; padding: 0px; box-sizing: border-box; list-style: none; border: 0px; max-width: 97%; box-shadow: rgb(204, 204, 204) 0px 1px 5px;" title="1545756295535898.jpg"/></p><h5 id="h5-ps-information-you-may-need-to-update-etc-fstab-df-h-dev-sdb1-" style="margin: 26px 0px 16px; padding: 0px; box-sizing: border-box; list-style: none; position: relative; line-height: 1.4; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="" font-size:="" 1em=""><a style="margin: 0px; padding: 0px; box-sizing: border-box; list-style: none; outline: 0px; background-image: initial; background-position: 0px 0px; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(0, 170, 255) !important;" name="PS:请注意查看执行完扩展指令退出后是否有显示红色线条展示的信息(Information: You may need to update /etc/fstab.),有的话可执行下 df -h 查看是否/dev/sdb1磁盘已自动挂载上了,那么此时就需要重新卸载数据盘进行后续操作,否则就会提示数据盘已挂载:"></a>PS:请注意查看执行完扩展指令退出后是否有显示红色线条展示的信息(Information: You may need to update /etc/fstab.),有的话可执行下 df -h 查看是否/dev/sdb1磁盘已自动挂载上了,那么此时就需要重新卸载数据盘进行后续操作,否则就会提示数据盘已挂载:</h5><pre class="prettyprint linenums prettyprinted" style="margin-top: 0px; margin-bottom: 16px; padding: 2px; box-sizing: border-box; list-style: none; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13.6px; line-height: 1.6; font-family: Consolas, " liberation="" overflow-wrap:="" overflow:="" background-color:="" border-radius:="" border:="" 1px="" solid="" color:="">umount /dev/sdb1</pre><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:=""><img src="/ueditor/php/upload/image/20181226/1545756306701244.jpg" alt="5.jpg" style="margin: 0px 0px 0px 18.3906px; padding: 0px; box-sizing: border-box; list-style: none; border: 0px; max-width: 97%; box-shadow: rgb(204, 204, 204) 0px 1px 5px;" title="1545756306701244.jpg"/></p><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="">4、检测磁盘是否有错误:</p><pre class="prettyprint linenums prettyprinted" style="margin-top: 0px; margin-bottom: 16px; padding: 2px; box-sizing: border-box; list-style: none; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13.6px; line-height: 1.6; font-family: Consolas, " liberation="" overflow-wrap:="" overflow:="" background-color:="" border-radius:="" border:="" 1px="" solid="" color:="">e2fsck -f /dev/sdb1</pre><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="">5、扩展数据盘大小:(<code style="margin: 0px; padding: 0.2em 0px; box-sizing: border-box; list-style: none; font-family: Consolas, " liberation="" font-size:="" background-color:="" border-radius:="">如文件格式为xfs,则使用命令:xfs_growfs /dev/sdb1</code>)</p><pre class="prettyprint linenums prettyprinted" style="margin-top: 0px; margin-bottom: 16px; padding: 2px; box-sizing: border-box; list-style: none; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13.6px; line-height: 1.6; font-family: Consolas, " liberation="" overflow-wrap:="" overflow:="" background-color:="" border-radius:="" border:="" 1px="" solid="" color:="">resize2fs /dev/sdb1</pre><p style="margin-top: 0px; margin-bottom: 16px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="">6、重新挂载磁盘并检查磁盘大小:</p><pre class="prettyprint linenums prettyprinted" style="margin-top: 0px; margin-bottom: 16px; padding: 2px; box-sizing: border-box; list-style: none; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13.6px; line-height: 1.6; font-family: Consolas, " liberation="" overflow-wrap:="" overflow:="" background-color:="" border-radius:="" border:="" 1px="" solid="" color:="">mount -a</pre><p style="margin-top: 0px; padding: 0px; box-sizing: border-box; list-style: none; color: rgb(51, 51, 51); font-family: " microsoft="" meiryo="" malgun="" segoe="" trebuchet="" helvetica="" droid="" wenquanyi="" micro="" white-space:="" margin-bottom:="" 0px=""><img src="/ueditor/php/upload/image/20181226/1545756350671182.jpg" alt="6.jpg" style="margin: 0px 0px 0px 18.3906px; padding: 0px; box-sizing: border-box; list-style: none; border: 0px; max-width: 97%; box-shadow: rgb(204, 204, 204) 0px 1px 5px;" title="1545756350671182.jpg"/></p><p><br/></p>
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网
湘ICP备2023018646号-1
MYSQl共执行 4 个查询,用时 0.0016777515411377 秒,PHP脚本用时 0.003776 秒,占用内存 0.585 MB,Gzip 已启用