我试图用 MySQL 替换我服务器上的 MariaDB。但由于空间不足,它不允许我完成任务。
pxl0hosp0048:/ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/system-lv_root 9.8G 9.6G 0 100% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.7M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sda1 478M 116M 334M 26% /boot
/dev/mapper/system-lv_dados 276G 63M 276G 1% /dados
/dev/mapper/system-lv_var 27G 330M 26G 2% /var
/dev/mapper/system-lv_opt 4.8G 11M 4.6G 1% /opt
/dev/mapper/system-lv_tmp 4.8G 11M 4.6G 1% /tmp
172.16.12.98:/dados/compartilhados 276G 63M 276G 1% /mnt/dados98
并且...
pxl0hosp0048:/ # fdisk -l
Disk /dev/sdb: 300 GiB, 322122547200 bytes, 629145600 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
Disklabel type: gpt
Disk identifier: A9FE2C95-8600-4ACB-A15D-82418B3A2216
Device Start End Sectors Size Type
/dev/sdb1 2048 629143551 629141504 300G Microsoft basic data
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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
Disklabel type: dos
Disk identifier: 0x000f3ea7
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1028095 1026048 501M 83 Linux
/dev/sda2 1028096 62914559 61886464 29.5G 8e Linux LVM
Disk /dev/mapper/system-lv_root: 10 GiB, 10737418240 bytes, 20971520 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 /dev/mapper/system-swap: 2 GiB, 2147483648 bytes, 4194304 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 /dev/mapper/system-lv_opt: 5 GiB, 5368709120 bytes, 10485760 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 /dev/mapper/system-lv_tmp: 5 GiB, 5368709120 bytes, 10485760 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 /dev/mapper/system-lv_var: 27.5 GiB, 29532094464 bytes, 57679872 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 /dev/mapper/system-lv_dados: 280 GiB, 300647710720 bytes, 587202560 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
我该如何才能释放一些空间?欢迎任何帮助...
答案1
首先,我会使用 查看system
卷组vgs
,看看卷组中是否还有更多空间system
。如果有 10-20G,则将其添加到逻辑卷lv_root
( lvextend
) 并调整文件系统的大小 (如果 ext[34],则使用 resize2fs),因为即使安装了其他卷,10G 对于 rootfs 来说也有点小。
如果 中没有空间vgs
,则卸载并调整另一个文件系统的大小,然后调整下面的卷的大小。然后将其分配给lv_root
。
第三个也是最不受欢迎的选项是删除软件包或者通常尝试在 rootfs 上查找不需要的程序/文件。