1

I need to resize my CentOS 7 root on my mail server. I found this answer:

https://serverfault.com/a/811124/213096

but I don't know if I can do it while server is running or do I have to stop it, run from live CD etc etc. I need fast and safe solution and if possible without shutting down my server

Info about my file system:

[root@mail1 ~]# lsblk
    NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda               8:0    0   223G  0 disk
    ├─sda1            8:1    0   500M  0 part /boot
    └─sda2            8:2    0 222,5G  0 part
      ├─centos-root 253:0    0    50G  0 lvm  /
      ├─centos-swap 253:1    0  15,8G  0 lvm  [SWAP]
      └─centos-home 253:2    0 156,7G  0 lvm  /home


[root@mail1 ~]# df -H
System plików           rozm. użyte dost. %uż. zamont. na
/dev/mapper/centos-root   54G   50G  4,3G  93% /
devtmpfs                  17G     0   17G   0% /dev
tmpfs                     17G     0   17G   0% /dev/shm
tmpfs                     17G  1,4G   16G   8% /run
tmpfs                     17G     0   17G   0% /sys/fs/cgroup
/dev/sda1                521M  309M  212M  60% /boot
/dev/mapper/centos-home  169G   34M  169G   1% /home
tmpfs                    3,4G     0  3,4G   0% /run/user/996
tmpfs                    3,4G     0  3,4G   0% /run/user/0

[root@mail1 ~]# blkid
/dev/sda1: UUID="243e672e-4944-4f07-9581-641f872e72fa" TYPE="xfs"
/dev/sda2: UUID="dTidfk-zBkf-bQo3-usRq-XjNR-Z8Ni-lKn8tv" TYPE="LVM2_member"
dzilupl
  • 11
  • 2

1 Answers1

1

XFS cannot be reduced, so no.

Create a new small logical volume for /home. Restore data from backup. Delete the old larger one.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • I know that I need to delete and create a new / home partition - luckily I don't have much data there and it is not used. The only question is whether the operations from the link I gave can be done on a working system or do I have to stop the server, start from some LiveCD etc. – dzilupl Nov 08 '19 at 10:48
  • I don't know this host well enough to say if /home can be umounted. Possibly, if services don't use it and you cd to a different working directory. – John Mahowald Nov 08 '19 at 22:13