[root@host2 etc]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 4.8G 0 4.8G 0% /dev
tmpfs tmpfs 4.9G 4.0K 4.9G 1% /dev/shm
tmpfs tmpfs 4.9G 18M 4.9G 1% /run
tmpfs tmpfs 4.9G 0 4.9G 0% /sys/fs/cgroup
/dev/mapper/almalinux-root xfs 70G 17G 54G 23% /
/dev/mapper/almalinux-home xfs 94G 803M 93G 1% /home
/dev/sda1 xfs 1014M 264M 751M 26% /boot
tmpfs tmpfs 989M 36K 989M 1% /run/user/1000
192.168.203.129:/data/engine nfs4 70G 17G 54G 23% /rhev/data-center/mnt/192.168.203.129:_data_engine
[root@host2 etc]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 171G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 170G 0 part
├─almalinux-root 253:0 0 70G 0 lvm /
├─almalinux-swap 253:1 0 6.7G 0 lvm [SWAP]
└─almalinux-home 253:2 0 93.3G 0 lvm /home
sr0 11:0 1 1024M 0 rom
[root@host2 etc]# fdisk -l
Disk /dev/sda: 171 GiB, 183609851904 bytes, 358612992 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: 0x0f8a62c3
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 358612991 356513792 170G 8e Linux LVM
Disk /dev/mapper/almalinux-root: 70 GiB, 75161927680 bytes,
146800640 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/almalinux-swap: 6.7 GiB, 7218397184 bytes,
14098432 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/almalinux-home: 93.3 GiB, 100151590912 bytes,
195608576 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
您需要从 /dev/mapper/almalinux-home 中“撕下”50 个 gig,并将它们附加到 192.168.203.129:/data/engine 如何做到这一点?
所有这些都在一台虚拟机上运行。192.168.203.129:/data/engine 不是远程驱动器。全部在一张磁盘上。
xfs 无法缩小。而且在不减少文件系统的情况下,减少块设备不仅有害,而且很危险。必须重新创建文件系统。
这就是为什么:
/home某处复制到根分区(例如 rsync 以提供帮助)umount /home. 如果分区正在被某人使用,因此无法卸载 - 解决这个问题,然后重新开始lvremove /dev/mapper/almalinux-homelvresize -L+50G /dev/mapper/almalinux-root. 这是假设由于某种原因您将 nfs 提升到根分区xfs_growfs /是否有必要恢复
/home为一个单独的分区是你作为管理员的问题。如果你不需要它,不要忘记将它从中删除并将/etc/fstab以前保存的内容转移到/home根分区上的现在如果您需要一个单独的文件系统
/home,lvcreate -n home -l100%free almalinux那么mkfs.xfs(或您喜欢的另一个文件系统)/etc/fstab如果用于挂载的 UUID 在那里被阻塞,则进行更改。挂载并复制/home回来。