"No space left on device" with FreeBSD

6,347

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.

Share:
6,347
larry
Author by

larry

Updated on September 17, 2022

Comments

  • larry
    larry over 1 year

    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
    
  • larry
    larry about 13 years
    I found that there is a link from other user(/home/why) to /usr except root dir
  • BillThor
    BillThor about 13 years
    Home is often its own partition. Given your partioning /usr is far oversized, and a good location for home directories. When faced with this setup I would symlink the home directories to a directory under /usr. /usr/home would be my choice with /home replaced with a symlink to /usr/home. This would be a relatively transparent change.
  • Tabitha
    Tabitha about 13 years
    @BillThor, I'm going to assume you have never used FreeBSD before at least not much. By default home directories are /usr/home/${USER}. With the exception of root who's home is /root. /home is a symlink to /usr/home. In addition /usr is used for many other purposes including all user installed software, and the ports tree to name a few. The /usr partition should in 90% of cases be the largest partition.
  • BillThor
    BillThor about 13 years
    @Wergan I haven't used FreeBSD for several years, and not much then. The systems I have most experience with use /home or /homes either directly or symlinked from somewhere else. /usr/home is a rational location if it isn't in its own partition.
  • larry
    larry about 13 years
    I think you are right!
  • larry
    larry about 13 years
    hi Phil, could you please look over my "df -i" ?
  • larry
    larry about 13 years
    I hava edited my question .
  • Phil Hollenback
    Phil Hollenback about 13 years
    Yes, you are out of inodes. You can only increase them by recreating the filesystem. So you either have to move files to another filesystem to free up inodes, or reinstall your system.
  • larry
    larry about 13 years
    why "%iused" of "/" is 100%, but " /usr" is 2% ? I think they are all out if inodes, because "/usr" belongs to "/".
  • Phil Hollenback
    Phil Hollenback about 13 years
    No, every line of the df output is a different filesystem. /usr is completely separate from /.
  • rustyx
    rustyx about 11 years
    Goddammit, the inode info should be included in the daily df reports. Caused some severe hair pulling!