LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Telling the OS that the home partition size has changed (https://www.linuxquestions.org/questions/linux-general-1/telling-the-os-that-the-home-partition-size-has-changed-4175544092/)

scramble64 05-31-2015 08:12 AM

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.

Carlo

smallpond 05-31-2015 09:42 AM

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.

scramble64 05-31-2015 09:43 AM

Quote:

Originally Posted by scramble64 (Post 5370189)
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!

Any advice is welcome.

michaelk 05-31-2015 09:56 AM

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.

scramble64 05-31-2015 10:33 AM

Thank you for your replies.

@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?

michaelk 05-31-2015 11:40 AM

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.

scramble64 06-01-2015 02:15 AM

@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!

suicidaleggroll 06-01-2015 10:22 AM

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.


All times are GMT -5. The time now is 02:24 AM.