Telling the OS that the home partition size has changed
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Telling the OS that the home partition size has changed
Hello,
I have had to shrink the size of my home partition with GParted, which went well. Now I have rebooted but cannot log into KDE because the space available results to be zero, but obviously the 'Used' space from 'df -h' does not coincide with the actual partition size, so I am thinking I need to somehow tell the OS that the partition size has changed. How do I do that?
Please let me know if you need any other information. Many thanks in advance for any help you may be able to give.
You must reduce the size of the file system before shrinking the partition. If you have logical volumes, you must reduce their size after reducing the filesystems and before shrinking the partition.
I have rebooted but cannot log into KDE because the space available results to be zero, but obviously the 'Used' space from 'df -h' does not coincide with the actual partition size, so I am thinking I need to somehow tell the OS that the partition size has changed. How do I do that?
To clarify, the partition manager says the partition size is 495.12 GiB, but when I type 'df -h' I am told the size is 488G, of which only 465G are used and yet 0G is available!
Assuming /home is an ext3/4 partition by default 5% of the total space is reserved for root. The space does not "appear" in the output of df so the numbers do not add up. You can reduce the amount of reserved space via the tune2fs command.
Reserved space is supposed to reduce fragmentation as well as allow root to log in case the file system becomes full.
@smallpond: I used GParted live from a usb drive to resize and I assume GParted knows the filesystem size needs to be reduced before the partition is shrunk? There were no errors reported after aplying the resizing changes from the GParted GUI.
@michaelk: the original size was 500G and I removed 5G to give a 495G large partition. So even if a portion is reserved for root and that is why I see a total size of 488G from 'df -h', since used space is 465G, there are still ~23G missing! Where did they go?
If you try adding up the numbers from df i.e used + avail it does not equal size. That difference is the reserved space i.e ~24GB. When the file system exceeds 95% available space will be zero.
The difference between df size and partition size is due to file system overhead.
@michaelk, thank you for your clarification. I didn't know about file system overhead. After freeing up some space, I was able to log in. Thanks again for all the help!
You really shouldn't be running your filesystem that close to capacity anyway. As soon as you pass ~70%, you should start clearing out space to bring it back down. If you can't clear out enough space to keep it below ~70%, then you should consider upgrading your hardware. As you approach 80-90% and higher, fragmentation goes through the roof and the drive slows to a crawl, it's not a good place to be.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.