国产精品久久久久久亚洲影视,性爱视频一区二区,亚州综合图片,欧美成人午夜免费视在线看片

意見箱
恒創(chuàng)運營部門將仔細(xì)參閱您的意見和建議,必要時將通過預(yù)留郵箱與您保持聯(lián)絡(luò)。感謝您的支持!
意見/建議
提交建議

硬盤根目錄空間不夠 把/home分區(qū)的容量擴容到 /

來源:佚名 編輯:佚名
2024-08-09 13:09:29

物理服務(wù)器后臺安裝系統(tǒng)前可以自定義分區(qū),沒有數(shù)據(jù)的建議直接重裝時分區(qū)

舉例把/home刪除,剩余空間擴容到 /

生產(chǎn)中的服務(wù)器操作有風(fēng)險,請謹(jǐn)慎操作,本教程不對任何數(shù)據(jù)丟失負(fù)責(zé)

[root@localhost ~]# df -h    #查看分區(qū)情況,準(zhǔn)備卸載/home和刪除/home所在的lv
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   50G  3.8G   47G   8% /
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G     0  1.9G   0% /dev/shm
tmpfs                    1.9G   18M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1               1014M  178M  837M  18% /boot
/dev/mapper/centos-home  245G   33M  245G   1% /home
tmpfs                    379M     0  379M   0% /run/user/0
[root@localhost ~]# fdisk -l  #查看磁盤lv名稱

Disk /dev/sda: 322.1 GB, 322122547200 bytes, 629145600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000ed6dc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   629145599   313523200   8e  Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos-home: 263.2 GB, 263192576000 bytes, 514048000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

[root@localhost ~]# umount /home  #卸載/home
[root@localhost ~]# lvremove /dev/mapper/centos-home  # 刪除/home所在lv
Do you really want to remove active logical volume centos/home? [y/n]: y  #輸入y回車
  Logical volume "home" successfully removed
[root@localhost ~]# lvextend -r -l +100%FREE /dev/mapper/centos-root  #剩余容量全部分到 / ,回車后操作完成
  Size of logical volume centos/root changed from 50.00 GiB (12800 extents) to 2                                    95.12 GiB (75551 extents).
  Logical volume centos/root successfully resized.
meta-data=/dev/mapper/centos-root isize=512    agcount=4, agsize=3276800 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=13107200, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=6400, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 13107200 to 77364224
[root@localhost ~]# df -h  # 根目錄現(xiàn)在已經(jīng)擴容完成
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  296G  3.8G  292G   2% /
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G     0  1.9G   0% /dev/shm
tmpfs                    1.9G   18M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1               1014M  178M  837M  18% /boot
tmpfs                    379M     0  379M   0% /run/user/0
[root@localhost ~]# vi /etc/fstab   # 需要編輯此文件,刪除/home分區(qū)掛載,不然重啟后會無法開機

 


# /etc/fstab
# Created by anaconda on Sat Mar  7 06:19:07 2020
#
# 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
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=c02c8818-6a16-49df-a6f2-89e377303b9c /boot                   xfs     defaults        0 0
/dev/mapper/centos-home /home                   xfs     defaults        0 0    # 刪除這一行保存退出   
/dev/mapper/centos-swap swap                    swap    defaults        0 0


本網(wǎng)站發(fā)布或轉(zhuǎn)載的文章均來自網(wǎng)絡(luò),其原創(chuàng)性以及文中表達(dá)的觀點和判斷不代表本網(wǎng)站。
上一篇: centos云服務(wù)器輸入wget未找到命令 下一篇: 中小企業(yè)租用美國服務(wù)器的注意事宜有哪些
相關(guān)文章
查看更多