LVM partition layout

General support questions
Post Reply
amtrakuk
Posts: 21
Joined: 2017/09/16 17:32:49

LVM partition layout

Post by amtrakuk » 2018/07/16 09:46:39

I've been using CentOS 7 for about 8 months with little to no problems and really enjoying its reliability however!

The other day I had a notification saying I was getting low on disk space. Puzzled I checked and indeed I had under 1GB free. Is it normal for "home" to be split 50/50 with "root" when using the default LVM partitioning scheme? Is there an easy way of resizing the LVM allocation?

Thanks

User avatar
TrevorH
Forum Moderator
Posts: 24118
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: LVM partition layout

Post by TrevorH » 2018/07/16 10:22:00

Yes, it's normal if you take the default partitioning scheme that the installer sets up. It's not actually 50/50 in percentage terms unless you just happen to have a 100GB disk. It actually defaults to setting up with 50GB allocated to / and the rest of the space in /home. Since it uses xfs by default and xfs cannot be shrunk, it's not as easy as it might be to resize. Since xfs cannot be shrunk, you will need to back up the contents of /home, reduce the size of its LV, reformat the filesystem on it then restore your data.

You can resize xfs filesystems to add more space, you just cannot shrink it. So you can backup/shrink/format/restore /home but to add more space to / (or any other filesystem) you can just lvresize to add more and use the -r switch to also resize the filesystem on it at the same time.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

tunk
Posts: 462
Joined: 2017/02/22 15:08:17

Re: LVM partition layout

Post by tunk » 2018/07/16 12:53:36

Is it /home or / that's running low?
A clean GUI install (with a few extras) is around 7GB, so if it's / then you've collected quite a bit extra.
Maybe some temp or log files can be deleted?
Otherwise, maybe you could create /backup and move some of your (least used) data there.

User avatar
TrevorH
Forum Moderator
Posts: 24118
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: LVM partition layout

Post by TrevorH » 2018/07/16 13:09:37

The problem will be that the installer defaults to using all available space and divides it 50GB/the rest and leaves nothing left to create new filesystems or LVs. The only clean solution to that is to shrink /home and free up the space it uses - and it can often be enormous - on a 2TB disk / would be 50GB and /home would be the remaining 2TB-50GB.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

amtrakuk
Posts: 21
Joined: 2017/09/16 17:32:49

Re: LVM partition layout

Post by amtrakuk » 2018/07/16 13:23:47

Got it... So 50GB is reserved for root regardless. That's fine. I'm using a 120GB SSD in my laptop by the time the system has been installed it seems to only leave 100GB, if so 50GB is reserved for root and the remaining 50GB for home - hence why I thought it was 50/50.

If I have got a grasp of it on a 2TB drive it would be about 10GB for the system, 50 GB for "root" leaving about 1940GB for "home" - Theoretical values.

Coming from Ubuntu and Manjaro where "root" is minimal, "swap" is a few GB and "user" has the rest of the disk. :D

amtrakuk
Posts: 21
Joined: 2017/09/16 17:32:49

Re: LVM partition layout

Post by amtrakuk » 2018/07/16 13:35:56

tunk wrote:
2018/07/16 12:53:36
Is it /home or / that's running low?
A clean GUI install (with a few extras) is around 7GB, so if it's / then you've collected quite a bit extra.
Maybe some temp or log files can be deleted?
Otherwise, maybe you could create /backup and move some of your (least used) data there.
No I think my home to blame as I had a thin out of files and that stopped the nag. I was just a bit "Ehhhh" when I first saw the nag, and a "Ehhhh" accompanied with an "Ohhhhh" after running disk usage analyst when I saw "root" had 50GB free :D

Post Reply