Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence? [SOLVED]

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
James_Smith
Level 4
Level 4
Posts: 380
Joined: Wed Feb 18, 2015 6:41 pm

Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence? [SOLVED]

Post by James_Smith »

During a data recovery attempt, I filled my hard drive to the brim. Then, because I was busy in the real world, I shut my computer down. I wasn't able to log back in.

That issue is resolved. However, I'd like to know if there is a way to automatically prevent this from happening again. It seems to me that, as customizable as LM is, there should be a program I can run that would either alert me if my hd is getting too full or maybe even one that would totally prevent me from filling it up and then tell me that it's intervened.

So, is there?

Thanks
Last edited by James_Smith on Tue Jul 12, 2016 12:33 am, edited 1 time in total.
sudo apt-get --purge remove macOS

User avatar
MajorMuff
Level 3
Level 3
Posts: 170
Joined: Thu Jun 23, 2016 4:41 am
Location: the Netherlands

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by MajorMuff »

Setting a disk quotum may be a solution?:

https://www.linux.com/learn/step-step-u ... otas-linux
If it screams it isn't food yet.

Cosmo.
Level 23
Level 23
Posts: 17825
Joined: Sat Dec 06, 2014 7:34 am

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by Cosmo. »

Actually you get (at least in Cinnamon) a message with a warning, short before a partition runs out of space. But to my remembrance this message appears with the default settings only for a few seconds and vanishes after that silently. IMO this is a design bug. This message should stay open (similar to the message about software rendering) until the user has clicked it.

James_Smith
Level 4
Level 4
Posts: 380
Joined: Wed Feb 18, 2015 6:41 pm

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by James_Smith »

Cosmo. wrote:IMO this is a design bug.
Indeed.
Cosmo. wrote:This message should stay open (similar to the message about software rendering) until the user has clicked it.
Agreed. Moreover, it should explicitly warn the user that, if he continues, he risks locking himself out of his computer until and unless he logs in as root.
sudo apt-get --purge remove macOS

Mute Ant
Level 14
Level 14
Posts: 5132
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by Mute Ant »

The kernel and ext4 take care of this for system purposes, reserving 5% of a file system's space for a single nominated user; usually UID=0 which is the kernel and root. You can do something similar...make a large file in the /tmp/ folder after you log in. That will be deleted next boot, so there will always be space to log in...

Code: Select all

### Reserve 1GiB in the /tmp/ folder...
    head -c 1G /dev/zero > /tmp/$UID-filler
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

User avatar
Dngrsone
Level 5
Level 5
Posts: 576
Joined: Thu Nov 29, 2012 12:18 pm

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by Dngrsone »

Huh; the "disk full" warning used to be a little more reliable... not that it prevented me from borking my system big-time.

I had a misbehaving/misconfigured server running and it filled the root volume with gigabybtes of error logs. Took me a week to get sorted out. It probably didn't help that I'd allocated root something like a 20GB partition, but at the time it seemed reasonable. :roll:

I ended up adjusting logrotate to accommodate my partition size until the next install, where I allocated a whopping 40GB to root. :shock:
Try politeness; people will like you for it.

James_Smith
Level 4
Level 4
Posts: 380
Joined: Wed Feb 18, 2015 6:41 pm

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by James_Smith »

Mute Ant wrote:The kernel and ext4 take care of this for system purposes, reserving 5% of a file system's space for a single nominated user; usually UID=0 which is the kernel and root. You can do something similar...make a large file in the /tmp/ folder after you log in. That will be deleted next boot, so there will always be space to log in...

Code: Select all

### Reserve 1GiB in the /tmp/ folder...
    head -c 1G /dev/zero > /tmp/$UID-filler
It seems like a good work-around. If I'm reading you correctly, I'll have to recreate this large file in the /tmp/folder each time I log in. Is that correct?

Also, please explain it to me as you would a child.

1. I open Terminal
2. I type in

Code: Select all

    head -c 1G /dev/zero > /tmp/$UID-filler
and that creates the large file you're talking about, right?

Thanks.
sudo apt-get --purge remove macOS

User avatar
Arch_Enemy
Level 6
Level 6
Posts: 1387
Joined: Tue Apr 26, 2016 3:28 pm

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by Arch_Enemy »

I believe the disk filling warning is a cron job, so you may be able to adjust it to give more warning, and an earlier warning.

I don't mess with CRON jobs, so someone more skilled than I will have to jump in.
I have travelled 35629424162.9 miles in my lifetime

One thing I would suggest, create a partition a ~28G partition as /. Partition the rest as /Home.
When the system fails, reinstall and use the exact same username and all your 'stuff' comes back to you.

Mute Ant
Level 14
Level 14
Posts: 5132
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by Mute Ant »

Exactly. Log in to the Mint GUI, open a console, type in that command, it reserves 1GiB of space in a file that is automatically freed up next boot. It can be automatically created too, if you decide to keep it. In the Startup Applications for your user you add and enable a single line 'application' command...

Code: Select all

bash -c "head -c 1G /dev/zero > /tmp/$UID-filler"
P.S. I am assuming the "can't log in" syndrome is caused by the root partition being stuffed full. If it's caused by some other partition being full, reserving space in /tmp/ for the next boot won't help.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

James_Smith
Level 4
Level 4
Posts: 380
Joined: Wed Feb 18, 2015 6:41 pm

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by James_Smith »

Mute Ant wrote:Exactly. Log in to the Mint GUI, open a console, type in that command...
Ok, it didn't ask for my password when I typed the command into terminal. May I presume it's because it's not a higher level (root or sudo, or whatever—forgive my ignorance of the proper terminology) command?

How do I ensure that it worked before proceeding?
Mute Ant wrote:P.S. I am assuming the "can't log in" syndrome is caused by the root partition being stuffed full. If it's caused by some other partition being full, reserving space in /tmp/ for the next boot won't help.
Yes, that is correct.
sudo apt-get --purge remove macOS

James_Smith
Level 4
Level 4
Posts: 380
Joined: Wed Feb 18, 2015 6:41 pm

Re: Hard drive not full anymore. I can log in again -HOWEVER- is there a way to prevent reoccurrence?

Post by James_Smith »

James_Smith wrote:How do I ensure that it worked before proceeding?
I just went to file system/tmp/ and I see that there is a document there called 1000-filler. That must be it.
sudo apt-get --purge remove macOS

Post Reply

Return to “Newbie Questions”