我的 /home 目录已满。然而,该/
目录有130G的可用空间。是否可以/home
在root
不重新启动的情况下调整目录大小?
操作系统:Centos 7
[$~]# parted /dev/sda "print free"
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 268GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
32.3kB 1049kB 1016kB Free Space
1 1049kB 1075MB 1074MB primary xfs boot
2 1075MB 64.4GB 63.3GB primary
3 64.4GB 96.6GB 32.2GB primary lvm
4 96.6GB 268GB 172GB primary lvm
[$ ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs tmpfs 7.8G 275M 7.5G 4% /run
tmpfs tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 196G 66G 130G 34% /
/dev/sda1 xfs 1014M 358M 657M 36% /boot
/dev/mapper/centos-home xfs 30G 30G 20K 100% /home <----- This
tmpfs tmpfs 1.6G 12K 1.6G 1% /run/user/42
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/1000
[$ ~]$ sudo fdisk -l
Disk /dev/sda: 268.4 GB, 268435456000 bytes, 524288000 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 label type: dos
Disk identifier: 0x00000b68
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 125829119 61864960 83 Linux
/dev/sda3 125829120 188743679 31457280 8e Linux LVM
/dev/sda4 188743680 524287999 167772160 8e Linux LVM
parted print free
WARNING: You are not superuser. Watch out for permissions.
Error: Could not stat device print - No such file or directory.
Retry/Cancel? c
[$ ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 250G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 59G 0 part
│ └─luks-0cad437f-3fa3-479e-8a94-fcbe333513d6 253:0 0 59G 0 crypt
│ ├─centos-root 253:1 0 195.7G 0 lvm /
│ ├─centos-swap 253:2 0 5.9G 0 lvm [SWAP]
│ └─centos-home 253:3 0 30G 0 lvm /home
├─sda3 8:3 0 30G 0 part
│ └─centos-home 253:3 0 30G 0 lvm /home
└─sda4 8:4 0 160G 0 part
└─centos-root 253:1 0 195.7G 0 lvm /
sr0 11:0 1 1024M 0 rom
[$ ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/luks-0cad437f-3fa3-479e-8a94-fcbe333513d6 centos lvm2 a-- <59.00g 0
/dev/sda3 centos lvm2 a-- <30.00g <17.43g
/dev/sda4 centos lvm2 a-- <160.00g 0
[$ ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 3 3 0 wz--n- <248.99g <17.43g
谢谢。