Недостаточно места на /tmp
Я не могу запустить менеджер обновлений, так как получаю сообщение об ошибке, указывающее, что в /tmp каталог. Я практически вычистил tmp каталог, но ошибка сохраняется.
/dev/loop0 13G 11G 952M 92% / udev 2.0G 4.0K 2.0G 1% /dev tmpfs 785M 920K 784M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 584K 2.0G 1% /run/shm /dev/sda6 20G 14G 6.4G 68% /host overflow 1.0M 16K 1008K 2% /tmp
7 ответов
Ваш / был заполнен, затем Ubuntu создал новый раздел в оперативной памяти для временного использования.
Теперь этот раздел размером 1 МБ недостаточно велик для работы.
1) увеличить размер этого раздела только для обновления
2) фактически удалите достаточно файлов на HD, чтобы этот раздел больше не нужен.
Чтобы сделать 1:
открыть терминал и запустить
sudo umount /tmp sudo mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp
Это должно дать вам 1 МБ раздел (так же, как тот, который у вас был =P).
Теперь, чтобы увеличить размер, вы увеличиваете size в этой строке, так что, с size=10485760 , вы получите 10 МБ.
Ваша цель — найти число, достаточное для работы, но оставляющее достаточно оперативной памяти.
Чтобы сделать 2:
Откройте терминал и запустите sudo umount /tmp или, если это не удается, sudo umount -l /tmp ,
Удалить файлы в /tmp (сейчас /tmp это на самом деле ваш HD, а не виртуальный RAM-диск), удалить неиспользуемые пакеты, удалить файлы в вашей домашней папке и так далее.
Not enough space on /tmp
I’m not able to run update manager as I get an error saying that there is not enough free space in the /tmp directory. I’ve practically cleaned out the tmp directory but the error persists. here’s df-h
/dev/loop0 13G 11G 952M 92% / udev 2.0G 4.0K 2.0G 1% /dev tmpfs 785M 920K 784M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 584K 2.0G 1% /run/shm /dev/sda6 20G 14G 6.4G 68% /host overflow 1.0M 16K 1008K 2% /tmp
Here, a simple reboot solved the issue. As @josinalvo explained, / was full and was increased on the fly: The disk was a virtual disk.
7 Answers 7
What seems to have happened:
Your / was full, then Ubuntu created a new partition, in RAM memory, to use temporarily.
Now, this 1MB partition is not big enough for the job, either.
1) increase the size of this partition just to do the upgrade
2) actually delete enough files in the HD that this partition is no longer needed.
sudo umount /tmp sudo mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp
This should give you an 1MB partition (just like the one you had =P).
Now, to increase the size, you increase the size in that line, so that, with size=10485760 , you’d get 10 MB.
Your goal is to find a number that is enough for the job, but leaves enough ram too
Comments on 1
You may want to try sudo umount -l /tmp , if you get some variation of «the file system is busy and cannot be unmounted»
Another possible solution to «the file system s busy(. )» is to do fuser -m /tmp to find pids (process numbers) that are using /tmp, then ps -elf , stop or kill processes
You may want to try sudo mount -t tmpfs -o size=1MB,mode=1777 overflow /tmp or even sudo mount -t tmpfs -o size=1G,mode=1777 overflow /tmp (for 1 megabyte or 1 gigabyte, respectively) — that is, units are available so that you dont have to type a huge number
Open a terminal and run sudo umount /tmp or, if that fails, sudo umount -l /tmp .
Delete files in /tmp (now /tmp is the thing actually in your HD, rather than a virtual ram disk), uninstall unused packages, delete files in your home folder and so on.
How to clean /tmp?
will delete all files and folders older than 10 days. you may want to add it to the daily cron.
UPDATE
In comments below @sfussenegger recommends a slightly different format of this command that may be better suited to your needs and to the system you’re operating on.
sudo find /tmp -type f -atime +10 -delete
Here the command is using sudo to make sure everything is deleted (or you could run it as root), operating on files that haven’t been accessed for more than 10 days and only deletes files, not folders. It also uses -delete to avoid having to execute rm command
instead of creation time (-ctime) you may want to use access time (-atime) instead — of course only if the filesystem keeps this information (check for noatime in /etc/fstab)
ok, please bear with me but there’s one more thing: you want to search files only ( -type f ). otherwise you may find that the parent of a directory tree hasn’t been accessed in a while and delete all its content that could potentially still be in use. so the final command I’d recommend is sudo find /tmp -type f -atime +10 -delete
@sfussenegger, perhaps your could promote your comments to an answer? I think it is better than being «hidden» in the comments.
You can assume that anything inside a tmp directory (/tmp/ /usr/tmp etc) can be deleted. BEFORE you start deleting stop all programs and services you are using since /tmp/ can be used by programs to temporarily store information for that session. So do a sudo service mysql stop and sudo service apache2 stop if you have a mysql and/or apache running. The name of the files in the /tmp/ directory most times give a clue to what program they belong.
will empty the /tmp/ directory and remove all files and subdirectories. Be careful to type it correctly. The command pwd in there is not necessary but should show /tmp .
If you want it interactively (so you need to confirm deleting):
Also worth noting that a reboot will clear /tmp aswell as shown here: How is the /tmp directory cleaned up? So if /tmp/ is full of files after a reboot you need to investigate where those files originate from.