change partition space in Centos 7

General support questions
Post Reply
Yassine.01
Posts: 5
Joined: 2019/02/12 21:30:04

change partition space in Centos 7

Post by Yassine.01 » 2019/02/18 11:54:42

Hello,

I have computer with 2 TB in hard drive space, While I was installing Centos7 I have made automatically partitioning and now I found that / has only 50 GB and /Home have 1.8 TB, I would like to work on a an application that automatically download large files and stock them in /mnt. So I want to ask if can change space disk of / to 1.8 and give home that 50 GB. Or I should install Centos again.

Thank you

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

Re: change partition space in Centos 7

Post by TrevorH » 2019/02/18 12:38:03

If you took all the defaults then that is how you'd end up. Your /home is presumably using xfs so cannot be shrunk so to make it smaller you will need to back up its contents, delete it and redefine it (or just shrink it, ignoring any errors telling you it will break), reformat it then restore your data to it. Once that's done, it will have returned its unused space back to the volume group and now you can use the lvextend command with the -r switch to expand your root filesystem (or create a new LV and mount it where you want the space).

To remove /home you will need to umount it and to do that you'll need to be using a user with a current working directory that is not on /home or it will be in use and you won't be able to umount it.
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

Yassine.01
Posts: 5
Joined: 2019/02/12 21:30:04

Re: change partition space in Centos 7

Post by Yassine.01 » 2019/02/18 14:25:19

Thank you for your reply, I don't have anything important in my /home partition, and I'm a very new user so can you please tell me the exact commands I should write in order to fix that ?
Thank you

Yassine.01
Posts: 5
Joined: 2019/02/12 21:30:04

Re: change partition space in Centos 7

Post by Yassine.01 » 2019/02/18 14:47:03

Hello,
Are these the right steps to follow for my problem ?

https://themacwrangler.wordpress.com/20 ... n-centos7/

Post Reply