LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "No space left on device" error on /tmp. How to increase space on /tmp? (https://www.linuxquestions.org/questions/linux-newbie-8/no-space-left-on-device-error-on-tmp-how-to-increase-space-on-tmp-857632/)

anilp 01-20-2011 03:24 PM

"No space left on device" error on /tmp. How to increase space on /tmp?
 
cp: writing `/tmp/tmpX2KZDc/system.image': No space left on device

However, when I right-click on properties, I see it has 51 items, totalling only 130.5 KB!

this is a dual boot system with Win XP and Ubuntu 10.10 (~58Gb partition)

Quote:

anil@anil-HP-EliteBook-8440p:/tmp$ mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev
Tried to find if my filesystem was full - is not full.

Quote:

anil@anil-HP-EliteBook-8440p:~$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda5 3637248 956625 2680623 27% /
none 212289 867 211422 1% /dev
none 215088 6 215082 1% /dev/shm
none 215088 49 215039 1% /var/run
none 215088 1 215087 1% /var/lock
/dev/sr0 0 0 0 - /media/GParted-live
anil@anil-HP-EliteBook-8440p:~$
---------
Quote:

anil@anil-HP-EliteBook-8440p:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 55G 37G 16G 70% /
none 1.5G 320K 1.5G 1% /dev
none 1.5G 1.7M 1.5G 1% /dev/shm
none 1.5G 88K 1.5G 1% /var/run
none 1.5G 0 1.5G 0% /var/lock
/dev/sr0 115M 115M 0 100% /media/GParted-live
anil@anil-HP-EliteBook-8440p:~$

Any help appreciated.

eSelix 01-20-2011 03:55 PM

Maybe you have some opened and then deleted files on this device. Did you tried copying after reboot? How large is file "system.image"? You can also have some space reserved for root (by default this is 5%), check if root also cannot copy this file.

tredegar 01-20-2011 03:59 PM

I think you should run a fsck on your filesystem, because it may have been corrupted (usually power failure or incorrect shutdown)

To do this, enter this in a terminal:

Code:

sudo touch /forcefsck
sudo reboot


anilp 01-20-2011 05:25 PM

Quote:

Originally Posted by eSelix (Post 4232152)
Maybe you have some opened and then deleted files on this device. Did you tried copying after reboot? How large is file "system.image"? You can also have some space reserved for root (bye default this is 5%), check if root also cannot copy this file.

I think system.image is up to 250Mb. It is flashed to a device.

More info: I was running a python build script tool and got this error.
Exception: Command cp -Rfp /home/anil/mydroid/myfs/* /tmp/tmpX2KZDc
failed

Here is a partial output from the console. "No space left on device" error.
---
mke2fs 1.41.12 (17-May-2010)
Filesystem label=android_fs
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
64000 inodes, 256000 blocks
12800 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
32 block groups
8192 blocks per group, 8192 fragments per group
2000 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
cp: writing `/tmp/tmpX2KZDc/system.image': No space left on device
---

anilp 01-20-2011 05:46 PM

Quote:

Originally Posted by tredegar (Post 4232157)
I think you should run a fsck on your filesystem, because it may have been corrupted (usually power failure or incorrect shutdown)

To do this, enter this in a terminal:

Code:

sudo touch /forcefsck
sudo reboot


I did, and when it rebooted, ubuntu said it was checking the hard drive and then it started normally.

austinium 01-20-2011 11:33 PM

run
Code:

df -i
see if you've run out of inodes

oops! the OP has already tried this...my bad.

appilu 01-21-2011 01:00 AM

HI,
Whats is the linux distro in your pc,

just try using Disk Usage Analyser.and check how your disk space is distributed in filesystem.
There you can track the files having more space.If it is an unwanted file,delete and recover space.

In case of improper shutdown also there is possibility of file locking.

eSelix 01-21-2011 04:35 AM

Quote:

More info: I was running a python build script tool and got this error.
So, are you compiling something? Maybe during compilation your free space (16GB) is eated entirely. I was compiled recently to other architecture and it needed very large amount of free space (some GB) to create about 5MB image file.

anilp 01-21-2011 09:35 AM

Quote:

Originally Posted by eSelix (Post 4232754)
So, are you compiling something? Maybe during compilation your free space (16GB) is eated entirely. I was compiled recently to other architecture and it needed very large amount of free space (some GB) to create about 5MB image file.

I asked the vendor and they said system.image is only 256 Mb.
At the point it fails, apparently it has already created the image.
To me, it seems the problem is with /tmp.

eSelix 01-21-2011 04:11 PM

Can you modify this script to pause before erroneous "cp" command and then check free space on /tmp and amount of data to copy? Something like:
Code:

df -h /tmp
du -hs /home/anil/mydroid/myfs

If this is python then you can use
Code:

os.system("some linux command")
with appropriate spaces at the begin of the line.

I have no other ideas, I vote for really finite free space.

And if you want to incrase space for /tmp - if you have more free space on hard drive (other partition or not allocated space), you can temporary remount /tmp directory there. If not, then partition resizing is possible, but not recommended by me. Backup is needed before doing this.

anilp 01-24-2011 10:21 AM

Quote:

Originally Posted by eSelix (Post 4233435)
Can you modify this script to pause before erroneous "cp" command and then check free space on /tmp and amount of data to copy?

As you suggested, I modified the script to print out the sizes just before the cp. Here are the values
Quote:

~/mydroid/27.7.2/mydroid$ df -h tmp

Filesystem Size Used Avail Use% Mounted on

/dev/loop0 243M 6.1M 224M 3% /home/anil/mydroid/27.7.2/mydroid/tmp

~/mydroid/27.7.2/mydroid$ du -s /home/anil/mydroid/myfs

65048 /home/anil/mydroid/myfs

After that, here is what the vendor sent me - the manual steps of the script:

Quote:


You probably want to tell them the manual steps on the thread so they
can see more of what is going on:

dd if=/dev/zero of=filesystem.img bs=1 count=1 seek=262143999
losetup /dev/loop0 filesystem.img
mkfs.ext3 -L android_fs /dev/loop0
mkdir tmp
mount /dev/loop0 tmp
cp -Rfp myfs/* tmp
chmod -R 777 tmp
sync
umount tmp
losetup -d /dev/loop0

Your problem appears to be with the cp step. you should also probably
let them know how big the myfs directory is, du -sh myfs
When I do the steps manually one by one from the console, it works. The vendor also does not know why or what the problem is.
I am wondering; when the error says
Quote:

cp: writing `/tmp/tmpX2KZDc/system.image': No space left on device
Is it referring to the main /tmp? or is it the tmp directory that it created? (/home/anil/mydroid/27.7.2/mydroid/tmp)

eSelix 01-24-2011 01:14 PM

This "tmp" is not on your PC filesystem. First is created file "filesystem.img" with size 262143999 bytes (250MB), next this file is formated as ext3 filesystem and mounted in subdirectory "tmp" (not related to /tmp) created in working directory. And then data is copied there.

You did not enter -h parameter in "du" command but I think there are 4k blocks. So you have about 243MB on prepared filesystem and about 254MB (65048*4096) to copy. Try incrasing this value if you have access to this script, but I don't known if incrased image file fit into your device, or remove some unnecesary files/packages from compilation.

Also I don't known why these command works executed step by step.

anilp 01-24-2011 01:40 PM

1 Attachment(s)
Quote:

Originally Posted by eSelix (Post 4236330)
Try increasing this value if you have access to this script, but I don't known if increased image file fit into your device, or remove some unnecessary files/packages from compilation.
Also I don't known why this command works executed step by step.

If you see the attached screen-shot, I right-clicked on the myfs folder and chose properties.
It says the size is only 62Mb.

I tried to find the block size:
Quote:

$ sudo dumpe2fs /dev/sda5 | grep -i 'Block size'
dumpe2fs 1.41.12 (17-May-2010)
Block size: 4096
But is it using 4K blocks? Perhaps it is 1K?

Quote:

man du

"Display values are in units of the first available SIZE from
--block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environ‐
ment variables. Otherwise, units default to 1024 bytes (or 512 if
POSIXLY_CORRECT is set)."
These env variables are not set
Quote:

~$ env | grep -i SIZE
~$
Thank you for your help!


All times are GMT -5. The time now is 09:31 PM.