当前位置: 首页 > news >正文

企业网站开发注意什么天津市住房和城乡建设部网站

企业网站开发注意什么,天津市住房和城乡建设部网站,做百度手机网站点击,wordpress登录验证失败Centos 8系统ext4文件系统类型进行扩容缩容 (LVM) 1.磁盘情况:2.缩容home分区1.备份home数据:2.查找使用 /home 的进程:3.终止这些进程:4.卸载 /home 分区5.检查文件系统一致性 (e2fsck):6.调整…

Centos 8系统ext4文件系统类型进行扩容缩容 (LVM)

  • 1.磁盘情况:
  • 2.缩容home分区
    • 1.备份home数据:
    • 2.查找使用 /home 的进程:
    • 3.终止这些进程:
    • 4.卸载 /home 分区
    • 5.检查文件系统一致性 (e2fsck):
    • 6.调整文件系统大小 (resize2fs):
    • 7.再次检查文件系统一致性 (fsck):
    • 8.减少逻辑卷的大小 (lvreduce):
    • 9.确认逻辑卷大小减少成功:
    • 10.最终检查文件系统一致性 (fsck):
    • 11.挂载home分区
    • 12.验证 home 分区的大小是否成功缩容
    • 13.恢复home数据
  • 3.扩容root分区
    • 1.检查root分区状态:
    • 2.扩展根分区的逻辑卷
    • 3.在线调整文件系统大小
    • 4.确认扩展结果
  • 4. 重启系统

1.磁盘情况:

[root@localhost ~]# df -h
文件系统                 类型      容量  已用  可用 已用% 挂载点
devtmpfs                 devtmpfs   32G     0   32G    0% /dev
tmpfs                    tmpfs      32G     0   32G    0% /dev/shm
tmpfs                    tmpfs      32G   19M   32G    1% /run
tmpfs                    tmpfs      32G     0   32G    0% /sys/fs/cgroup
/dev/mapper/rfasl00-root ext4       69G   19G   47G   29% /
/dev/sda2                ext4      974M  164M  743M   19% /boot
/dev/sda1                vfat      599M  6.7M  593M    2% /boot/efi
tmpfs                    tmpfs     6.3G   48K  6.3G    1% /run/user/0
/dev/mapper/rfasl00-home ext4      338G   60K  321G    1% /home
[root@localhost ~]# 

2.缩容home分区

把home分区的空间划一部分到root分区

1.备份home数据:

这一步非常重要。在修改分区之前,请确保备份所有重要数据。

mkdir /root/home
cp /home/*  /root/home

2.查找使用 /home 的进程:

lsof +D /home
例如:
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
bash      1234  user1  cwd   DIR  8,1     4096    2   /home/user1
firefox   5678  user1  mem   REG  8,1    123456   3   /home/user1/.mozilla/firefox/xxxxxx.default/...

3.终止这些进程:

sudo kill -9 1234
sudo kill -9 5678

4.卸载 /home 分区

sudo umount /home

5.检查文件系统一致性 (e2fsck):

[root@localhost ~]# e2fsck -f /dev/mapper/rfasl00-home 
e2fsck 1.46.0 (29-Jan-2020)1 步:检查inode、块和大小
第 2 步:检查目录结构
第 3 步:检查目录连接性
第 4 步:检查引用计数
第 5 步:检查组概要信息
/dev/mapper/rfasl00-home:19/22560768 文件(0.0% 为非连续的), 1695888/90212352

6.调整文件系统大小 (resize2fs):

例如,如果你想将 /home 分区的大小调整为 100G:

[root@localhost ~]# resize2fs /dev/mapper/rfasl00-home  100G
resize2fs 1.46.0 (29-Jan-2020)/dev/mapper/rfasl00-home 上的文件系统调整为 26214400 个块(每块 4k)。
/dev/mapper/rfasl00-home 上的文件系统现在为 26214400 个块(每块 4k)。

7.再次检查文件系统一致性 (fsck):

[root@localhost ~]# fsck /dev/mapper/rfasl00-home 
fsck,来自 util-linux 2.32.1
e2fsck 1.46.0 (29-Jan-2020)
/dev/mapper/rfasl00-home:没有问题,19/6553600 文件,688929/26214400

8.减少逻辑卷的大小 (lvreduce):

[root@localhost ~]# lvreduce -L 100G /dev/rfasl00/home WARNING: Reducing active logical volume to 100.00 GiB.THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce rfasl00/home? [y/n]: ySize of logical volume rfasl00/home changed from 344.13 GiB (88098 extents) to 100.00 GiB (25600 extents).Logical volume rfasl00/home successfully resized.

9.确认逻辑卷大小减少成功:

[root@localhost ~]# resize2fs  /dev/mapper/rfasl00-home 
resize2fs 1.46.0 (29-Jan-2020)
文件系统已经为 26214400 个块(每块 4k)。无需进一步处理!

10.最终检查文件系统一致性 (fsck):

[root@localhost ~]# fsck /dev/mapper/rfasl00-home 
fsck,来自 util-linux 2.32.1
e2fsck 1.46.0 (29-Jan-2020)
/dev/mapper/rfasl00-home:没有问题,19/6553600 文件,688929/26214400

11.挂载home分区

[root@localhost ~]# mount -a

12.验证 home 分区的大小是否成功缩容

#磁盘情况
[root@localhost ~]# df -Th
df: /run/user/0/gvfs: 传输端点尚未连接
文件系统                 类型      容量  已用  可用 已用% 挂载点
devtmpfs                 devtmpfs   32G     0   32G    0% /dev
tmpfs                    tmpfs      32G     0   32G    0% /dev/shm
tmpfs                    tmpfs      32G   19M   32G    1% /run
tmpfs                    tmpfs      32G     0   32G    0% /sys/fs/cgroup
/dev/mapper/rfasl00-root ext4       69G   19G   47G   29% /
/dev/sda2                ext4      974M  164M  743M   19% /boot
/dev/sda1                vfat      599M  6.7M  593M    2% /boot/efi
tmpfs                    tmpfs     6.3G   48K  6.3G    1% /run/user/0
/dev/mapper/rfasl00-home ext4       98G   60K   93G    1% /home#块设备的详细信息
[root@localhost ~]# lsblk 
NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                8:0    0 447.1G  0 disk 
├─sda1             8:1    0   600M  0 part /boot/efi
├─sda2             8:2    0     1G  0 part /boot
└─sda3             8:3    0 445.6G  0 part ├─rfasl00-root 253:0    0    70G  0 lvm  /├─rfasl00-swap 253:1    0  31.4G  0 lvm  [SWAP]└─rfasl00-home 253:2    0   100G  0 lvm  
sdb                8:16   0 447.1G  0 disk 
└─sdb1             8:17   0 447.1G  0 part 
sdc                8:32   0   3.7T  0 disk 
└─sdc1             8:33   0   3.7T  0 part 
#显示逻辑卷的详细信息
[root@localhost ~]# lvdisplay /dev/rfasl00/home --- Logical volume ---LV Path                /dev/rfasl00/homeLV Name                homeVG Name                rfasl00LV UUID                lg3GEw-eXxJ-3bV2-mtz1-khta-9cEd-Ij5VTdLV Write Access        read/writeLV Creation host, time localhost.localdomain, 2024-07-18 17:50:33 +0800LV Status              available# open                 0LV Size                100.00 GiBCurrent LE             25600Segments               1Allocation             inheritRead ahead sectors     auto- currently set to     256Block device           253:2

13.恢复home数据

cp /root/home/* /home

3.扩容root分区

1.检查root分区状态:

首先,确认所有逻辑卷和文件系统的状态:

[root@localhost ~]# lsblk 
NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                8:0    0 447.1G  0 disk 
├─sda1             8:1    0   600M  0 part /boot/efi
├─sda2             8:2    0     1G  0 part /boot
└─sda3             8:3    0 445.6G  0 part ├─rfasl00-root 253:0    0    70G  0 lvm  /├─rfasl00-swap 253:1    0  31.4G  0 lvm  [SWAP]└─rfasl00-home 253:2    0   100G  0 lvm  /home
sdb                8:16   0 447.1G  0 disk 
└─sdb1             8:17   0 447.1G  0 part 
sdc                8:32   0   3.7T  0 disk 
└─sdc1             8:33   0   3.7T  0 part 
[root@localhost ~]# df -Th
df: /run/user/0/gvfs: 传输端点尚未连接
文件系统                 类型      容量  已用  可用 已用% 挂载点
devtmpfs                 devtmpfs   32G     0   32G    0% /dev
tmpfs                    tmpfs      32G     0   32G    0% /dev/shm
tmpfs                    tmpfs      32G   19M   32G    1% /run
tmpfs                    tmpfs      32G     0   32G    0% /sys/fs/cgroup
/dev/mapper/rfasl00-root ext4       69G   19G   47G   29% /
/dev/sda2                ext4      974M  164M  743M   19% /boot
/dev/sda1                vfat      599M  6.7M  593M    2% /boot/efi
tmpfs                    tmpfs     6.3G   48K  6.3G    1% /run/user/0
/dev/mapper/rfasl00-home ext4       98G   60K   93G    1% /home

2.扩展根分区的逻辑卷

[root@localhost ~]# lvextend -l +100%FREE /dev/rfasl00/rootSize of logical volume rfasl00/root changed from 70.00 GiB (17920 extents) to 314.13 GiB (80418 extents).Logical volume rfasl00/root successfully resized.

3.在线调整文件系统大小

[root@localhost ~]# resize2fs /dev/mapper/rfasl00-root
resize2fs 1.46.0 (29-Jan-2020)
/dev/mapper/rfasl00-root 上的文件系统已被挂载于 /;需要进行在线调整大小old_desc_blocks = 9, new_desc_blocks = 40
/dev/mapper/rfasl00-root 上的文件系统现在为 82348032 个块(每块 4k)。

4.确认扩展结果

[root@localhost ~]# lsblk
NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                8:0    0 447.1G  0 disk 
├─sda1             8:1    0   600M  0 part /boot/efi
├─sda2             8:2    0     1G  0 part /boot
└─sda3             8:3    0 445.6G  0 part ├─rfasl00-root 253:0    0 314.1G  0 lvm  /├─rfasl00-swap 253:1    0  31.4G  0 lvm  [SWAP]└─rfasl00-home 253:2    0   100G  0 lvm  /home
sdb                8:16   0 447.1G  0 disk 
└─sdb1             8:17   0 447.1G  0 part 
sdc                8:32   0   3.7T  0 disk 
└─sdc1             8:33   0   3.7T  0 part 
[root@localhost ~]# df -h
df: /run/user/0/gvfs: 传输端点尚未连接
文件系统                  容量  已用  可用 已用% 挂载点
devtmpfs                   32G     0   32G    0% /dev
tmpfs                      32G     0   32G    0% /dev/shm
tmpfs                      32G   19M   32G    1% /run
tmpfs                      32G     0   32G    0% /sys/fs/cgroup
/dev/mapper/rfasl00-root  309G   19G  278G    7% /
/dev/sda2                 974M  164M  743M   19% /boot
/dev/sda1                 599M  6.7M  593M    2% /boot/efi
tmpfs                     6.3G   48K  6.3G    1% /run/user/0
/dev/mapper/rfasl00-home   98G   60K   93G    1% /home
[root@localhost ~]# lvdisplay /dev/rfasl00/root--- Logical volume ---LV Path                /dev/rfasl00/rootLV Name                rootVG Name                rfasl00LV UUID                GEsUC5-mQjp-zeMW-QRtm-MxpW-B9sM-qjgokfLV Write Access        read/writeLV Creation host, time localhost.localdomain, 2024-07-18 17:50:39 +0800LV Status              available# open                 1LV Size                314.13 GiBCurrent LE             80418Segments               2Allocation             inheritRead ahead sectors     auto- currently set to     256Block device           253:0

4. 重启系统

reboot
http://www.yayakq.cn/news/953505/

相关文章:

  • 企业3合1网站建设电话企业网站建设应遵守的原则
  • 网站页脚怎么做wordpress anspress
  • 怎么做动漫网站ppt制作
  • .design 域名的网站网站建设实训报告的内容怎么写
  • 又拍网站怎么做国外搜索引擎排行榜
  • 门户网站营销策略dedecms仿站教程
  • 有专门做背景音乐的网站吗为什么一个人做网站有难度
  • 专家库 网站 建设方案网站如何集成微信支付
  • 哈尔滨模板建站服务商什么是建设型的网站
  • 电子商务网站建设管理论文建设发展公司网站
  • 江苏省医院网站建设管理规范常州公司建站模板
  • wordpress个人博客建站wordpress个人中心页
  • 做家教网站如何招生十种网络推广的方法
  • 如何用织梦搭建网站wordpress404错误
  • 怎么在百度上建立网站wordpress注册用户邮件验证
  • 网站建设费可分摊几年怎样制作公司的网页
  • 宿城区住房和城乡建设局网站营销型网站制作哪家好
  • 网站模板 介绍网站界面设计教程
  • flash做的小动画视频网站flash怎么做电子书下载网站
  • 网站建设一般多少钱官网网页设计与开发第四版答案
  • 长宁区公司网站建设wordpress 连接后台
  • 中小企业网站建设策划苏州模板做网站
  • 网站建设核心提供网站建设搭建
  • 一个网站做多少个关键词比较好南通网站seo报价
  • 好公司网站建设价格杭州巴顿设计公司官网
  • 莆田网站制作软件个人网站里在哪点击模版
  • python可以做网站后台吗百度的排名规则详解
  • 咸阳网站建设方案公司网站建设价格表
  • 电子商务网站建设详细策划杭州网站建设服务公司
  • 分析seo网站深圳的公司排名