当我的主机设置我的服务器时,他们以一种奇怪的方式对驱动器进行分区。我有以下两个文件系统。
/dev/mapper/vg_norecordset-lv_root
/dev/mapper/vg_norecordset-lv_home
不幸的是,我的...root
空间只有 50GB,而且已经 100% 满了。...home
仍然有大量剩余空间。问题是位于/var/spool/postfix/
,...root
我无法发送或接收任何邮件。
我想我现在有两个选择。将 postfix 的位置移至其他文件系统 - 或者 - 以主分区为代价增加根分区的大小。
我也不知道该怎么办。
fdisk -l
输出:
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0009294e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 243202 1953001472 8e Linux LVM
Disk /dev/mapper/vg_norecordset-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_norecordset-lv_swap: 4143 MB, 4143972352 bytes
255 heads, 63 sectors/track, 503 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_norecordset-lv_home: 1942.0 GB, 1942038249472 bytes
255 heads, 63 sectors/track, 236106 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
pvs && vgs && lvs
输出:
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_norecordset lvm2 a-- 1.82t 0
VG #PV #LV #SN Attr VSize VFree
vg_norecordset 1 3 0 wz--n- 1.82t 0
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
lv_home vg_norecordset -wi-ao-- 1.77t
lv_root vg_norecordset -wi-ao-- 50.00g
lv_swap vg_norecordset -wi-ao-- 3.86g
答案1
如果允许停机时间并且您具有物理访问权限并且您有备份或者不关心这是否会消耗您的数据:
- 重新启动进入单用户模式(或者以 root 身份从 shell 执行 telinit 1)
- 卸载 /home
- 执行 resize2fs /dev/mapper/vg_norecordset-lv_home ,确保它足够大以容纳您的所有数据!!!
- 即 resize2fs /dev/mapper/vg_norecordset-lv_home 20g
- 你将被要求执行完整的 fsck
- 执行 lvresize --size /dev/mapper/vg_norecordset-lv_home
- 即 lvresize --size 21g /dev/mapper/vg_norecordset-lv_home
- 再次执行 resize2fs,无需指定大小
- resize2fs /dev/mapper/vg_norecordset-lv_home
- 挂载/dev/mapper/vg_norecordset-lv_home
- 你将被要求再次进行 fsck
这应该可行,但这只是记忆问题。我不得不这样做很多次,但一段时间都没有用过。
高血压