Help shrink an xfs /home volume

Issues related to applications and software problems
Post Reply
foreverdba
Posts: 2
Joined: 2016/03/03 22:44:24

Help shrink an xfs /home volume

Post by foreverdba » 2016/03/03 22:49:44

Hi
I am new to Linux. I installed Centos7, took the default formatting for my 1TB HDD and it was allocated as follows. I need to shrink my /home (which is xfs and has only one user acct=oracle) down to like 100GB and allocate the rest to a new /u01 for my oracle folders. Can some one please list all the steps in details please to accomplish this task? I would like to make new free space that I will claim back from /home in ext4 format (unless someone has a good argument against that). I appreciate your help so much in advance:

[root@precision-390 home]# df -H
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos_precision--390-root 54G 6.0G 48G 12% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 87k 2.0G 1% /dev/shm
tmpfs 2.0G 9.4M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/sda1 521M 250M 272M 48% /boot
tmpfs 391M 17k 391M 1% /run/user/42
tmpfs 391M 0 391M 0% /run/user/0
/dev/mapper/centos_precision--390-home 942G 34M 942G 1% /home
[root@precision-390 home]# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 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: 0x00092e96

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 1953523711 976248832 8e Linux LVM

Disk /dev/mapper/centos_precision--390-root: 53.7 GB, 53687091200 bytes, 104857600 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/centos_precision--390-swap: 4160 MB, 4160749568 bytes, 8126464 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/centos_precision--390-home: 941.8 GB, 941759660032 bytes, 1839374336 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

Thanks.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Help shrink an xfs /home volume

Post by TrevorH » 2016/03/04 00:39:17

xfs cannot be shrunk. You'll have to backup the data on /home, delete it, recreate it smaller, reformat it, restore.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

foreverdba
Posts: 2
Joined: 2016/03/03 22:44:24

Re: Help shrink an xfs /home volume

Post by foreverdba » 2016/03/04 03:57:16

Thanks TrevorH, I realized all of the steps you listed. I was hoping to get help with the commands to make sure I do not destroy my other partitions. i need the specific commands and steps.... if it is not too much trouble...
thanks.

Post Reply