Why a root partition doesn't need more than 20 GB

Questions about the project and the distribution - obviously no support questions here please
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
gm10

Re: Why a root partition doesn't need more than 20 GB

Post by gm10 »

redlined wrote: Thu Nov 29, 2018 1:28 pm but the bump to 13GB with LM19 was surprising and wasn't sure how to read linux veterans maintaining root under 10GB.
I'm also on LM19 btw, I didn't have that "bump". ;)

Thx for pointing out my typo btw.

Now based on your output seems you already had your system cleaned pretty well. But here the /var folder stands out, it shouldn't be that big by far after an apt clean:
redlined wrote: Thu Nov 29, 2018 1:28 pm

Code: Select all

anyuser@f023:~$ sudo du / -hxd 1 -t 100M
793M	/lib
5.8G	/usr
149M	/opt
5.0G	/var
12G	/
I suggest you go get some more details to see which folder in there it is:

Code: Select all

sudo du /var/* -sht 100M
Might be some excessive logging to /var/log that you may want to address.

Btw sorry to OP if you consider this off-topic, but I guess this is now some general space saving topic.

On that note about logging, if you've got the firewall enabled then by default it spams both syslog and kern.log. This is rarely needed or useful. You can change that behaviour in /etc/rsyslog.d/20-ufw.conf or just fully turn firewall logging off: sudo ufw logging off.

Further log duplication happens with systemd's journald service. The journal is quite useful, but if you want, this will toggle journal storage off (or back on):

Code: Select all

sudo sed -i '/none\|auto/{s/#//;s/none/auto/;t1;s/auto/none/;:1}' /etc/systemd/journald.conf
JerryF wrote: Thu Nov 29, 2018 2:25 pm One place I'd check is /var/log

Mine is 2 GB full.
That's excessive, too. Mine is 20 MB full.
Last edited by gm10 on Thu Nov 29, 2018 2:59 pm, edited 1 time in total.
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

JerryF wrote: Thu Nov 29, 2018 2:25 pm One place I'd check is /var/log

Mine is 2 GB full.
hi JerryF, thanks for that tip!
/var/log
363 items, totalling 4.4 GB
(some contents unreadable)

looks like I got some learning to do! https://linuxjourney.com/lesson/system-logging

edit to add, just saw your other reply gm10, I definitely have issues in /var/log and am sorting through your commands now. I'm also hopeful that mediclaser doesn't consider this off-topic or hijacked thread since he's looking to keep root free from stuff not needed there.

Code: Select all

anyuser@f023:~$ sudo du /var/* -sht 100M
[sudo] password for anyuser: 
131M	/var/cache
642M	/var/lib
4.2G	/var/log
kukamuumuka

Re: Why a root partition doesn't need more than 20 GB

Post by kukamuumuka »

If you make videos, etc. /tmp needs enough room for working. I used to use 30 to 40 GB for /
gm10

Re: Why a root partition doesn't need more than 20 GB

Post by gm10 »

redlined wrote: Thu Nov 29, 2018 2:35 pm

Code: Select all

4.2G	/var/log
Yep, definitely the culprit. So to drill further down into it:

Code: Select all

sudo du /var/log/* -t 5M
Probably at least syslog and possibly kern.log and by way of duplication (triplication?) the journal getting spammed with something.
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

gm10 wrote: Thu Nov 29, 2018 3:01 pm
redlined wrote: Thu Nov 29, 2018 2:35 pm

Code: Select all

4.2G	/var/log
Yep, definitely the culprit. So to drill further down into it:

Code: Select all

sudo du /var/log/* -t 5M
Probably at least syslog and possibly kern.log and by way of duplication (triplication?) the journal getting spammed with something.
all of the above! :lol:

Code: Select all

anyuser@f023:~$ sudo du /var/log/* -t 5M
[sudo] password for anyuser: 
11212	/var/log/installer
4210928	/var/log/journal/ef635a010d284bc38d762d2b9f0e65ac
4210932	/var/log/journal
21004	/var/log/syslog
47432	/var/log/syslog.1
8912	/var/log/syslog.2.gz
7680	/var/log/syslog.3.gz
was having fun paging down in less looking at kern.log a lot of ufw stuff in there, need to disable ufw to disable logging if I understood the error I got trying to disable log a bit ago. got some work to do in cleaning up the mess
gm10

Re: Why a root partition doesn't need more than 20 GB

Post by gm10 »

Yep. If you haven't used the journal before consider simply disabling it, see my script before. Or limit its size (edit /etc/systemd/journald.conf for all the options). To kill off archived journals older than a week:

Code: Select all

sudo journalctl --vacuum-time=7d
Maybe my 8 GB root statement is becoming clearer. If you remove the 4+ GB for your excessive logs from you're just about there. :D
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

gm10 wrote: Thu Nov 29, 2018 3:24 pm Yep. If you haven't used the journal before consider simply disabling it, see my script before.

Maybe my 8 GB root statement is becoming clearer. If you remove the 4+ GB for your excessive logs from you're just about there. :D
yes, certainly know now to look at what's going on when root is taking 10GB+.. About using journal, I don't know if I do or don't use it lol. are there pros and cons to consider before I disable using that script?
gm10

Re: Why a root partition doesn't need more than 20 GB

Post by gm10 »

redlined wrote: Thu Nov 29, 2018 3:32 pm About using journal, I don't know if I do or don't use it lol. are there pros and cons to consider before I disable using that script?
I think I ninja-edited the post you quoted. ;)

If you don't know whether you're using it the answer is you are not. The pro to disabling is that no disk space is being used for the journal, the con is that the journal will no longer conveniently aggregate all log files for you so you'll have to look at the individual log files if you're looking for something. Hardly a problem since it's pretty clear you're never looking at logs, anyway. :lol:

Same argument with the ufw logs. Are you ever gonna look at them? Probably not, so off they go.
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

gm10 wrote: Thu Nov 29, 2018 3:34 pm
redlined wrote: Thu Nov 29, 2018 3:32 pm About using journal, I don't know if I do or don't use it lol. are there pros and cons to consider before I disable using that script?
I think I ninja-edited the post you quoted. ;)
I'll retry!
If you don't know whether you're using it the answer is you are not. The pro to disabling is that no disk space is being used for the journal, the con is that the journal will no longer conveniently aggregate all log files for you so you'll have to look at the individual log files if you're looking for something. Hardly a problem since it's pretty clear you're never looking at logs, anyway. :lol:

Same argument with the ufw logs. Are you ever gonna look at them? Probably not, so off they go.
but I am! (looking at logs, via mint menu logs, that is:) Is this "using Journal" so to speak? If so then I like that interface, however I don't need the logs to go back to the begining of time- maybe just a week max would be sufficient for sure... and I just don't know yet what to do about managing the mess I see :oops: I do a lot of searching and found things like acpi errors I get by the droves are due to HP bios/uefi firmware I think was the final consensus and do want ufw logs when networking issues come up but realize I can reenable when troubleshooting such.

Is there a simple way to limit logging to deleting older than say 1 week and clearing that 4GB journal down to a reasonable couple hundred MB constant size?
gm10

Re: Why a root partition doesn't need more than 20 GB

Post by gm10 »

journalctl is "the" journal, but it's more than that, it's integrated into systemd so you'll e.g. get relevant journal entries below systemctl status queries, etc.

I already gave you the journald configuration file.
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

gm10 wrote: Thu Nov 29, 2018 4:10 pm journalctl is "the" journal, but it's more than that, it's integrated into systemd so you'll e.g. get relevant journal entries below systemctl status queries, etc.

I already gave you the journald configuration file.
got it, and sorted the 'ninja edit' part (thought it was refer to an earlier response). ok, got some cleaning of old logs with --vacuum-time=7d and looking at edit of journald.conf to better control that too.

Thanks gm10 for the tips and again mediclaser for bringing this topic to discussion!
mediclaser
Level 4
Level 4
Posts: 492
Joined: Tue Mar 20, 2018 2:28 pm

Re: Why a root partition doesn't need more than 20 GB

Post by mediclaser »

redlined wrote: Thu Nov 29, 2018 4:34 pm...and again mediclaser for bringing this topic to discussion!
I should thank you and all the experienced members who replied here because I won't have to google those very good tips we are getting. ;)
If you're looking for a greener Linux pasture, you won't find any that is greener than Linux Mint. ;)
Jastiv

Re: Why a root partition doesn't need more than 20 GB

Post by Jastiv »

I keep my data in /home, that way I can just leave it if I need to reinstall.
You might need more than 20GB if you install a lot of programs, but that depends on what programs you install on your computer and how much space they take up.
jglen490

Re: Why a root partition doesn't need more than 20 GB

Post by jglen490 »

I don't know where the concept of using using /mnt for storing permanent user data came from, but it's not really logical. Likewise, I'm not sure where the idea of keeping everything in a single root / partition came from. It makes recovery and re-installation very difficult.

Everything in the Linux filesystem hierarchy is under the root directory / but partitioning is not the same thing as directory identification.

The /home directory is for users. It stores user configuration data for programs, that are stored elsewhere, and is the only place where user data is stored by default. The /mnt is used as a mount point for transient storage media such as USB attached drives that are plugged and unplugged as needed without the need for user input "mount" commands - that's what the OS does!

You can store user "data" (i.e., docs, videos, mp3, etc.) literally anywhere, but it makes for ease in backups and restores of user owned files and configurations to keep them under the users directory within /home, or at least somewhere within /home if they can be shared among multiple users.

It's so very easy to then target partitions, or even drives to groups of directories. Such as / on /dev/sda1, and /home on /dev/sda2. Then you can size the partitions to the needs of the data stored in each grouping of directories. If you want, you could have sub-directories of /home on a completely separate permanent drive such as /home/multimedia on /dev/sdb1. One command to backup all user owned data and configurations and one command to backup the OS related files.
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

jglen490 wrote: Tue Dec 04, 2018 6:42 pm I don't know where the concept of using using /mnt for storing permanent user data came from, but it's not really logical.
hi jglen490!

speaking for myself, I do use /mnt for personal file storage (separate partition mount point /mnt/data for Documents, Music, Videos, Pictures, Downloads but not Desktop, that stays in /home)

I learned setting it up from tutorial this forum and although fairly dated advice I stuck with using /mnt versus /media simply because I do not want the desktop icon I was getting from anything in /media mountpoints

I do feel separate / (root) and /home partitions are good sense in that one could reinstall OS while keeping /home intact with all those tweaks, apps, configs, etc preserved (and in case of OS corruption I'd simply reformat both / and /home for the reinstall and get back to setting things up as preferred, including relinking personal files and directories to the untouched /mnt partition.
redlined

Re: Why a root partition doesn't need more than 20 GB

Post by redlined »

mediclaser wrote: Fri Nov 30, 2018 3:34 pm
redlined wrote: Thu Nov 29, 2018 4:34 pm...and again mediclaser for bringing this topic to discussion!
I should thank you and all the experienced members who replied here because I won't have to google those very good tips we are getting. ;)
Totally with you on that, got my terminal-fu ninja-notepad filling in rapidly... I'm ready to do more forum drive-bys as a slightly less dangerous newb trying to help other newbs! :mrgreen:
screenshot
Level 2
Level 2
Posts: 77
Joined: Sat Feb 01, 2014 8:54 am

Re: Why a root partition doesn't need more than 20 GB

Post by screenshot »

i created separate /home and /tmp partition and now it says that linux installation (lmde) takes only 6.5gb...
User avatar
Moem
Level 22
Level 22
Posts: 16238
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Why a root partition doesn't need more than 20 GB

Post by Moem »

screenshot wrote: Wed Jul 01, 2020 11:01 pm i created separate /home and /tmp partition and now it says that linux installation (lmde) takes only 6.5gb...
If you want help with that, I suggest starting a new topic in the appropriate area. This is an old thread in the Main Edition area (= not LMDE). Time to lock it.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Locked

Return to “Non-technical Questions”