# Mysqld can't write to /tmp after crashing...

## Syster

Hi all!

My computer suddenly runs out of memory. And everything's crashed  :Sad: 

Now, i'm trying to restart every service it provides. Almost everything goes well, except mysql.

Here's mysqld.err file:

 *Quote:*   

> 111107 16:10:46 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
> 
> /usr/sbin/mysqld: Can't create/write to file '/tmp/ibCHi99A' (Errcode: 2
> 
> 111107 16:10:46  InnoDB: Error: unable to create temporary file; errno: 28
> ...

 

The errcode 28 is no space left on device.

But...Everything works fine, and i have plenty of free space in RAM (about 400MB) O_o

I have no idea why mysqld can't write to tmp?

----------

## eccerr0r

I'm confused, you're out of RAM or out of hard drive space?

Or both?

Or swap?

Are you out of inodes?

----------

## Syster

I'm sorry i haven't wrote, but i was sure that is clear from the log.

Mysqld says that i'm out of space in /tmp, and /tmp is located on harddrive (default configuration from gentoo, i haven't moved it to RAM).

I don't have partition for /tmp, so it's located into / partition.

But:

 *Quote:*   

> 
> 
> Server / # df -h
> 
> Filesystem            Size  Used Avail Use% Mounted on
> ...

 

It shows, that i have a lot of free space O_o

----------

## tomk

You could be out of inodes. What's the output of this:

```
df -hi
```

----------

## Syster

 *tomk wrote:*   

> You could be out of inodes. What's the output of this:
> 
> ```
> df -hi
> ```
> ...

 

You got right!

```
Filesystem            Inodes   IUsed   IFree IUse% Mounted on

rootfs                  257K    257K       0  100% /

/dev/root               257K    257K       0  100% /

```

But.. What to do now?

Can i increase number of inodes?

Or how to find which folders are using a lot of inodes?

----------

## eccerr0r

You have to recreate the partition to get more inodes.

It looks like your /tmp is on your root filesystem.  One particular Gentoo struture that uses a lot of inodes is /usr/portage.  If you could move that to another disk it could help.  I frequently run out of inodes when I mkfs a disk with smaller block allocation sizes (1K or 2K blocks) but do not increase inode count from default.  mke2fs using -N, -I or -i can affect number of inodes created.

Keep in mind inodes uses disk space, so you're trading off file space for inode space...

----------

