Running on 0bytes

I like some of my classes at my university. I get into fun little arguments with the instructors sometimes. It's how they handle these that I either gain or lose a lot of respect for them.

If they just look at the ground, shake their head, say "no, no, no that's wrong" and never offer an explanation of why Linux sucks beyond "You get what you pay for." then I'm going to lose a lot of respect for them. If I had any left for Jim McKeown to start with..... If anyone has any respect for him.... I paid a lot for that class and I sure as heck didn't get crap for what I paid for.

On the other hand we can talk about security vulnerabilities. I enjoy these little discussions of what makes Linux secure and insecure. It's not "no, you're wrong." It's, "maybe, but ...." They offer an explanation for their side. Sometimes they have experience to back it up.

That's where this is coming from. We all know Windows will die, grind to a halt, freak out, not be able to boot anymore, want to kill itself but it can't even do that when it runs out of available HD space. Memory is something that it will die over but that's easy enough to recover. Without the aid of a recovery system (usually a linux based tool) you can rarely ever recover this issue.

My instructor said (with my prior 2 cents) that this happens with Linux. He said he's experienced a Fedora system unable to boot. I don't doubt that he's in full honesty about his experience. Have things changed? I decided to find out.

SEE! This instructor inspires me to actually go out and find answers. I love this. He didn't just say "No, you're wrong." He instead said "No, this happened to me first hand. Maybe it's different between Ubuntu and Fedora." Not exact wording but the jest of it.

So what did I discover? This is the exact email I wrote back to him.



So I was curious if maybe I was wrong on this thing.... I'm typing this
as I do this whole little project. So the outcome is as known to you as
it is to me. (except I'll wait to send this until I finish :P)

I created a virtual machine with a 2.5GB disk. Installed default Ubuntu
9.10 Desktop. After logging in the first time I filled up the entire
drive with 'cat /dev/urandom > ~/tmp'. Once it filled up I verified
with df that there were 0 bytes left on the drive. Apparently the
default byte size meant that there were still 60 bytes left on the
drive.

I made a text file that repeated '1234567890' six times and saved it.
That filled up so I created a 1 byte file and kept copying it until I
couldn't do that anymore.

Then the system seemed to magically find more free space. It was a pain
but I eventually got it down to 0 bytes without being able to continue.
I guess the system tries to reserve some buffer space in case this
happens and will only let you write a maximum of 8bytes at a shot.
Seems like a good idea need to look into it more to see if that's
actually wants going on. Important thing - no space left at all.

At this point I have only a few configuration files in ~. I started
gedit and it seemed to not complain at all. The calculator started
fine. Firefox on the other hand; it just didn't start at all. I guess
for the situation that's pretty graceful. I was even able to load up
solitaire and play a game. The surprising part was that I could even
load the movie player...

That's not what we mentioned in class though... Reboot time...

Well - I'm at the gnome login screen. I'm noticing that no theming
elements were applied.

I can't login through the login manager. Makes sense if it can't create
a .Xauthority file...

Switching to TTY2: Ctrl+Alt+F2 (I don't like using TTY1). I'm able to
login here and recheck the so space available. Make sure nothing became
free.. I just double checked using 'echo 0 > 0'. I couldn't complete
that because there isn't a single byte available.

So... I was able to boot and login, then become root 'sudo -s' which
would allow an admin to fix the issue. (I'm just going to trash the VM.)


I think I would have been able to log into Gnome if I setup a virtual
tmpfs for /tmp.


I'm also curious if I can log into gnome at all.... So:
sudo stop gdm
startx
.. Kind of confirms what I guessed, an error about not being able to
create a .Xauthority file.

It's interesting because after I should have had 0 bytes I kept
creating files. After that I removed those files I shouldn't have been
able to create and couldn't create anything. It's like I filled a
buffer that shouldn't be fillable.

rm tmp
startx
Gnome starts and logged in


So you can at least get to the point of booting up, logging in as a
user, becoming root, and correcting the issue without having a single
byte left on the system.

I did the same thing with Fedora to see the results. It was definitely
bigger PITA when hitting this disk limit but it was still able to
hobble through.

Fun little experiment. :)

BTW: I had to post what I came up with: http://profarius.com/content/running-0bytes

General: 
Ubuntu: 

Submitted by mtecknology (not verified) on Thu, 02/04/2010 - 17:38

dholbert brought it to my attention that ext reserves 5% of the file system for this situation. It seems that by copying single byte files repetitively as root I broke this. However, I intend to try again using his suggestion of 'tune2fs -m 0 /dev/sdX' which will reserve no space for this.

Thanks for that suggestion.

Submitted by tonyyarusso on Fri, 02/05/2010 - 09:33

It's a rather old known issue, tracked at https://bugzilla.gnome.org/show_bug.cgi?id=144473

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.
2011 © Michael Lustfield