Home > Linux > Amazingly large null file (/var/log/lastlog)

Amazingly large null file (/var/log/lastlog)

I’ve been seeing a lot of strange size reports on some Linux machines… specifically 64-bit systems.

The reason why you see a 1.2TB file full of null info is because the “nfsnobody” user is created with a userid of “-1″ which is the highest UID available. On a 32-bit system this is “65534″ but on a 64-bit system it’s a staggering “4294967294″. Lastlog pre-allocates space for every uid it obeys and counts 4.2 billion users just to accommodate for the user “nfsnobody”. It really doesn’t use _that_ much space but most backup utilities (E.G. EMC Retrospect) don’t know how to handle null/sparse files it will hang almost indefinitely when it tries to backup that file. Here’s the quick and dirty solution:

# usermod -u 65533 nfsnobody
# groupmod -g 65533 nfsnobody
# echo "" > lastlog

Happy Linuxing!

Categories: Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.