"No space left on device" with FreeBSD

When I login with root, and run "mkdir test", the system says "No space left on device". But if I login with other user, it goes well.

[/root]df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/da0s1a    496M    411M     45M    90%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/da0s1e    496M     12K    456M     0%    /tmp
/dev/da0s1f     57G    878M     51G     2%    /usr
/dev/da0s1d    4.3G    215M    3.8G     5%    /var

[/root]df -i
Filesystem  1K-blocks    Used    Avail Capacity iused   ifree %iused  Mounted on
/dev/da0s1a    507630  420824    46196    90%   65790       0  100%   /
devfs               1       1        0   100%       0       0  100%   /dev
/dev/da0s1e    507630      12   467008     0%       6   65784    0%   /tmp
/dev/da0s1f  59252554 1261724 53250626     2%  164917 7513033    2%   /usr
/dev/da0s1d   4553102   91766  4097088     2%   22973  565825    4%   /var


[/root]mkdir test

/: create/symlink failed, no inodes free
mkdir: .ssh: No space left on device

Solution 1:

Your root user's home is on the root filesystem (/). That filesystem is not full, so I have to assume you are out of inodes. Check the output of df -i. Here's a reference about how to diagnose this and what you can do to fix it. Hint: you need to move files to another filesystem or create a new filesystem to use.

Solution 2:

It sounds like (a) your root filesystem is full, and (b) non-root users have home directories on a different filesystem. What does df -h show? The output will look something like this:

$ df -h
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ad10s3a    496M    279M    177M    61%    /
devfs           1.0K    1.0K      0B   100%    /dev
/dev/ad10s3e    496M    4.4M    452M     1%    /tmp
/dev/ad10s3f    363G    7.4G    327G     2%    /usr
/dev/ad10s3d    4.8G    151M    4.3G     3%    /var

The "capacity" column is how much space is used as a percentage.