No space left on device when using rm


 
Thread Tools Search this Thread
Operating Systems Linux No space left on device when using rm
# 1  
Old 08-04-2013
No space left on device when using rm

Hello people

I have a small fileserver running busybox (very small linux distro with most essential stuff on it) and I am trying to remove some unused directories on it.

When I try this:
Code:
rm -R test/

I get:
Code:
rm: cannot remove 'test': No space left on device

df shows:
Code:
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock2           32768     15868     16900  48% /
none                    128004        12    127992   0% /tmp
/tmp/.cemnt/sdb1     369386932  54555641 290412091  16% /tmp/.cemnt/mnt_sdb1
/tmp/.cemnt/sda5     1915824128 1186595444 631553488  65% /tmp/.cemnt/mnt_sda5
/dev/mtdblock3           93184     17384     75800  19% /opt

The drive I am trying to remove this folder from is /mnt_sdb1. There is still plenty of space left there, so I am at a loss here what the cause could be. I can still copy files to the drive as well, so I believe it cannot be an inode-problem as well.

When trying to remove the folder by referring to its inode number:

Code:
-bash-3.2# find . -inum 7888609 -exec rm -r -i {} \;
rm: descend into directory './test'? y
rm: remove directory './test'? y
rm: cannot remove './test': No space left on device

So what could be the cause and how can I remove obsolete folder or files from the filesystem?

Thanks in advance!
# 2  
Old 08-04-2013
truncate each file in the directory

Code:
find /path/to/directory -type f -exec cat /dev/null > {} \;

Then use rm on the whole directory tree you want to remove

Code:
rm -R /path/to/directory

# 3  
Old 08-04-2013
Looks like a bug in the file system (or the file system driver).
What file system is it?
Code:
mount | grep sdb1

# 4  
Old 08-04-2013
Code:
 mount | grep sdb1
/tmp/.cemnt/sdb1 on /tmp/.cemnt/mnt_sdb1 type ext3 (rw,nosuid,nodev,noexec,noatime,data=ordered)

It's an ext3 filesystem.

I see nothing out of the ordinary. Is there something I can use to check/repair the filesystem?

---------- Post updated at 04:38 PM ---------- Previous update was at 04:38 PM ----------

Quote:
Originally Posted by jim mcnamara
truncate each file in the directory

Code:
find /path/to/directory -type f -exec cat /dev/null > {} \;

Then use rm on the whole directory tree you want to remove

Code:
rm -R /path/to/directory

I tried this, but no avail.
# 5  
Old 08-04-2013
Something is not Kosher here. /tmp is often not a physical device in Linux, it is the equivalent of a RAMDISK, or a filesystem in memory not on a disk. It is interesting that your problem filesystem seems to be mounted there.

Let's clarify:


As root - what is the exact output of this command?
Code:
df -k

# 6  
Old 08-05-2013
df -k is the same as the df already posted.
Code:
df -ki

would give information about inodes.

Any chance to umount it (for fsck)?
Code:
fuser /tmp/.cemnt/sdb1

shows the processes that use it.
# 7  
Old 08-06-2013
I have been able to solve the problem. I checked the drive with fsck and it seemed that a superblock of the drive was broken. Fsck needed a few hours to fix things, and now everything is working again.

So basically the Filesystem was all messed up, which caused not being able to delete stuff.

Thanks for your help people. This topic can be closed now.
This User Gave Thanks to GTCG For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

No space left on device while there is plenty of space available

Hello all posting here after scanning the net and tried most of the things offered still no solution that worked when I do : $ df -h Filesystem Size Used Avail Use% Mounted on footmpfs 7.9G 60K 7.9G 1% /dev tmpfs 7.9G 0 7.9G 0% /dev/shm /dev/da1 ... (3 Replies)
Discussion started by: umen
3 Replies

2. Ubuntu

Jenkins -- No space left on device

I am running a build on Jenkins and I get: No space left on device But when I do df, I get: Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/ROOT 19249724 18267492 4380 100% / udev 1457152 4 1457148 1% /dev tmpfs ... (4 Replies)
Discussion started by: sgffgs
4 Replies

3. Shell Programming and Scripting

No Space left On Device

Hi, We are trying to sort the 40GB file in unix and getting following error. Error: sort: can't write /var/tmp/stmAAAvsaGfJ.00002929: No space left on device sort -t ',' -k4 $DIR/INF_ff_FULL.dat >>$DIR/Sort_INF_ff_FULL.dat; 2>$DIR/sort_error.log Can you please advise how to... (2 Replies)
Discussion started by: koti_rama
2 Replies

4. Solaris

No space left on device but free space and inodes are available...

hi guys, me again ;) i recently opened a thread about physical to zone migration. My zone is mounted over a "bigger" LUN (500GB) and step is now to move the old files, from the physical server, to my zone. We are talking about 22mio of files. i used rsync to do that and every time at... (8 Replies)
Discussion started by: beta17
8 Replies

5. Solaris

pkgadd: errno 28: No space left on device

Hi, During package install, am getting: WARNING: unable to write temp contents file </var/sadm/install/t.contents> (errno 28: No space left on device) I tried to delete some stuff under "/var" But I cannot locate who is occupying "/var" space. Because: # df -h /var/ Filesystem ... (5 Replies)
Discussion started by: viki250
5 Replies

6. UNIX for Dummies Questions & Answers

No space left on device

hello all, i have a proc binary that we run on unix environment, and it is generating this error '' tstfile(): No space left on device '' can you please assist on how to narrow down the problem? thanks (4 Replies)
Discussion started by: mjdbouk
4 Replies

7. Solaris

No space left on device

We are using this function tmpfile() : FILE *tmpfp ; if ((tmpfp = tmpfile()) == NULL) { fprintf(stderr, "%s: ERROR: init_operator(): ", ROUTINE); perror("tmpfile()"); exit(ERR_OPEN); } and the above is raising error : MSMD0603: ERROR:... (3 Replies)
Discussion started by: atiato
3 Replies

8. Solaris

No space left on device

Hi all, A very strange problem I have this morning with my Solaris 8. I have a FS full, I deleted some files but the system doesn't seems to reallocate the free space (I'm using Veritas): df -k : /dev/vx/dsk/dlds02vg/dlds02oralv 4194304 4194304 0 100% /dlds02/lds/oracle ... (4 Replies)
Discussion started by: unclefab
4 Replies

9. UNIX for Advanced & Expert Users

no space left on device

I have a SCO UNIX on my Server. When I last tried to shutdown my system, I got an error message “no space left on device”. Now when I try to boot the system again, I just can't and I get the same error message. Please help! (2 Replies)
Discussion started by: anjane
2 Replies

10. UNIX for Dummies Questions & Answers

no space left on device

This seems like it would be a common question, but I didn't find much that helped in a search... I have a script scheduled in my crontab that outputs to /dev/null ie: /dir/scripts/script1 > /dev/null I have recently started getting the error: cp /dir1/dir2/file.xls: No space left on... (1 Reply)
Discussion started by: kristy
1 Replies
Login or Register to Ask a Question