欢迎来到cool的博客
7

Music box

Click to Start

点击头像播放音乐
新博客链接

bug: cap deploy时服务器临时文件夹 /tmp 空间太小 Net::SFTP::StatusException (Net::SFTP::StatusException write /tmp/

root@iZ2ze5nxdfkx6wk1rkd4rzZ:/tmp# df -kh
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G  4.0K  3.9G   1% /dev
tmpfs           799M  396K  799M   1% /run
/dev/vda1        99G   14G   80G  15% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            3.9G     0  3.9G   0% /run/shm
none            100M     0  100M   0% /run/user
overflow        1.0M  1.0M     0 100% /tmp

可以看到  /tmp  空间大小只有  1.0M 。  
仙子要扩大 /tmp 的大小   请参考:Not enough space on /tmp   

solution:

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.

What we can do:

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.


To do 1:

open a terminal and run

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

首先删除 /tmp 文件夹  然后再建一个容量更大的时  出现 : device  is busy.

root@iZ2ze5nxdfkx6wk1rkd4rzZ:/tmp# umount /tmp
umount: /tmp: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

 你可以输入:

lsof /tmp               #解决 device is busy

sudo umount -l /tmp        #删除 /tmp

mount -t tmpfs -o size=1048576,mode=1777 overflow /tmp

sudo mount -t tmpfs -o size=1048576000,mode=1777 overflow /tmp

然后 /tmp 文件夹,被增加到 1000M

root@iZ2ze5nxdfkx6wk1rkd4rzZ:/# df -kh
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G  4.0K  3.9G   1% /dev
tmpfs           799M  392K  799M   1% /run
/dev/vda1        99G   14G   80G  15% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            3.9G     0  3.9G   0% /run/shm
none            100M     0  100M   0% /run/user
overflow       1000M     0 1000M   0% /tmp

返回列表