LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2011, 04:24 PM   #1
anilp
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Rep: Reputation: 0
Question "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.

Last edited by anilp; 01-20-2011 at 04:34 PM.
 
Old 01-20-2011, 04:55 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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.

Last edited by eSelix; 01-21-2011 at 05:25 AM. Reason: Silly typo "bye" instead "by" :)
 
Old 01-20-2011, 04:59 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
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
 
Old 01-20-2011, 06:25 PM   #4
anilp
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eSelix View Post
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
---

Last edited by anilp; 01-24-2011 at 05:06 PM. Reason: corrected size of system.image
 
Old 01-20-2011, 06:46 PM   #5
anilp
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
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.
 
Old 01-21-2011, 12:33 AM   #6
austinium
Member
 
Registered: Nov 2007
Location: India
Distribution: Debian Stable, Debian Testing
Posts: 218

Rep: Reputation: 27
run
Code:
df -i
see if you've run out of inodes

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

Last edited by austinium; 01-21-2011 at 01:08 AM.
 
Old 01-21-2011, 02:00 AM   #7
appilu
Member
 
Registered: Jan 2011
Distribution: RedHat,Debian-Ubuntu,Fedora
Posts: 73

Rep: Reputation: 8
Smile

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.
 
Old 01-21-2011, 05:35 AM   #8
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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.

Last edited by eSelix; 01-21-2011 at 05:37 AM.
 
Old 01-21-2011, 10:35 AM   #9
anilp
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eSelix View Post
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.

Last edited by anilp; 01-21-2011 at 11:16 AM.
 
Old 01-21-2011, 05:11 PM   #10
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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.

Last edited by eSelix; 01-21-2011 at 05:24 PM.
 
Old 01-24-2011, 11:21 AM   #11
anilp
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by eSelix View Post
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)

Last edited by anilp; 01-24-2011 at 12:11 PM.
 
Old 01-24-2011, 02:14 PM   #12
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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.

Last edited by eSelix; 01-24-2011 at 02:20 PM.
 
1 members found this post helpful.
Old 01-24-2011, 02:40 PM   #13
anilp
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by eSelix View Post
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!
Attached Thumbnails
Click image for larger version

Name:	Screenshot-myfs Properties-1.png
Views:	50
Size:	29.7 KB
ID:	5936  

Last edited by anilp; 01-24-2011 at 05:07 PM. Reason: attached screenshot and size of myfs
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"No space left on device" - rootfs image build error sjremya Linux - Software 2 08-30-2010 01:16 AM
Zone says "no space left on device" in /tmp when there's plently? AlucardZero Solaris / OpenSolaris 10 08-18-2010 04:53 PM
Having problem with /tmp "No space left on device" Error jim.thornton Linux - Newbie 13 05-26-2009 08:12 PM
"No space left on device" error using SystemV shared memory clalfa Programming 5 07-09-2007 08:34 AM
"no space left on device" error. ekkasit Linux - General 5 07-08-2007 03:50 PM


All times are GMT -5. The time now is 01:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration