LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-11-2011, 03:06 PM   #1
JDtheGrey
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Rep: Reputation: Disabled
unable to add or delete files on TS-Linux embedded single board computer


Hi everyone,

My company has been using ARM boards loaded with TS-Linux for some time now (http://www.embeddedarm.com/products/...oduct=TS-7250#), and we have had very few problems. It's a bare-bones OS so there's not much that can go wrong (relatively speaking).

Today, however, I was trying to upload a file to a board (using sftp) and it failed. Using ssh to log into the board as root, I saw the the flash memory was 100% full -- thus the problem. Things got weird when I tried to delete a file to make room.

So, here's a summary of what I tried and the results:

Code:
$ df -h
Filesystem   Size  Used Available Use% Mounted on
/dev/root   29.0M 29.0M         0 100% /
$ ls
BPU.exe   RunBPU.log   Savefile.xml   bpu.xml
$ rm BPU.exe
rm: unable to remove `BPU.exe': Directory not empty
(This is the first hint that something strange is up - BPU.exe is clearly not a directory. But fine, if it wants to be treated like a directory, I can play ball...)
Code:
$ rm -r BPU.exe
rm: unable to remove `BPU.exe': Directory not empty
$ ls
RunBPU.log   Savefile.xml   bpu.xml
$ df
Filesystem   Size  Used Available Use% Mounted on
/dev/root   29.0M 29.0M         0 100% /
$ ls BPU.exe
BPU.exe
$ ls -a
.   ..   RubBPU.log   Savefile.xml   bpu.xml
So basically, the file throws an error that doesn't make any sense when I try to remove it. It then disappears from the ls search, unless I point to it directly, in which case it is still there. It is also still taking up space on the disk. The same thing happens for every file I have tried. What's more, when I reboot the system and log back in, all the files are back as if I had never touched them.

I haven't the faintest clue what is going on here. I have tried rebooting the system, changing the permissions on the files, and even unplugging the thing for a few minutes. No luck. They are like ghost files. I can make them invisible, but I can't kill them, and they always come back.

Any ideas would be greatly appreciated.

Thanks!
 
Old 03-11-2011, 03:57 PM   #2
Omnicronos
Member
 
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40

Rep: Reputation: 12
Nevermind. I was under the wrong assumption.

Last edited by Omnicronos; 03-12-2011 at 11:51 AM.
 
Old 03-11-2011, 04:17 PM   #3
JDtheGrey
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
I'm not entirely sure. I have to admit I am a physicist by trade, and am learning all this software stuff as I go.

What are the different modes, and how do I check that?
 
Old 03-11-2011, 04:20 PM   #4
JDtheGrey
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
I will add, in case it helps, that the board I am using does not have a hard disk, in the classic sense. It has 32MB SDRAM and 32MB flash memory, where the kernel and file structure are stored.
 
Old 03-11-2011, 11:11 PM   #5
Omnicronos
Member
 
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40

Rep: Reputation: 12
Nevermind. I was under the wrong assumption.

Last edited by Omnicronos; 03-12-2011 at 11:51 AM.
 
Old 03-12-2011, 11:17 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
This is an ARM based single board computer that runs an embedded version of linux. It is not tinycore and AFAIK TC runs only on x86 based hardware.

I have several TS-7200 boards but have not run into this problem yet. It is possible that the on board flash memory has gone bad and would suggest calling Technologic Systems to ask for assistance. I assume this problem is unique to a particular board. Have other boards produced similar behavior?
 
1 members found this post helpful.
Old 03-12-2011, 11:52 AM   #7
Omnicronos
Member
 
Registered: Oct 2010
Location: N. VA
Distribution: Redhat, CentOS, Solaris
Posts: 40

Rep: Reputation: 12
Quote:
Originally Posted by michaelk View Post
This is an ARM based single board computer that runs an embedded version of linux. It is not tinycore and AFAIK TC runs only on x86 based hardware.

I have several TS-7200 boards but have not run into this problem yet. It is possible that the on board flash memory has gone bad and would suggest calling Technologic Systems to ask for assistance. I assume this problem is unique to a particular board. Have other boards produced similar behavior?
You are right. My apologies.
 
Old 03-13-2011, 04:38 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I do seem to recall reading about this problem somewhere, and I think it goes something like this: The journalling filesystem has to write something to the disk related to the journal, before it can do the erasure, but since the disk is full, it fails and cannot do the erasure. I can only imagine that I read this in the TS-7000 mailing list on Yahoo groups. You might be able to find something in the archives there.

Can you unmount the drive, and rebuild the filesystem with fdisk and mkfs?

--- rod.
 
1 members found this post helpful.
Old 03-14-2011, 09:40 AM   #9
JDtheGrey
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the input!

Yes, michaelk, my first thought was also that the on board flash memory has gone bad, but I was hoping I was mistaken. We have almost 30 of these boards which have been running for over a year, and this is the first time I have seen this issue.

Your idea also seems plausible, theNbomr, so I will try rebuilding the file system as you suggest. My one hesitation: due to a lack of robust error-checking in our upload scripts, the boards are overloaded to 100% of their disk capacity semi-regularly. It is usually not an issue, I just have to clear some space and they work again. Since this one is behaving differently, I am inclined to believe it is a hardware failure rather than a journaling issue. Still, it couldn't hurt to try.

Thanks for your help, I'll report any new findings as they come.

JD
 
Old 03-14-2011, 02:39 PM   #10
JDtheGrey
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Update: I did a little digging in the TS-7000 mailing list archives that theNbomr mentioned, and found a very helpful thread: http://tech.groups.yahoo.com/group/ts-7000/message/2349 (you may or may not have to join the yahoo group to view the thread). It turns out this is a problem with the YAFFS file system. The dmesg log shows the following error (don't know why I didn't check this earlier):

!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
yaffs tragedy: no space during gc

Apparently the problem can be fixed by saving the file contents elsewhere and using flash_eraseall to reset the flash partition. However, this does not address a related issue, namely that YAFFS marks bad blocks far too conservatively, eliminating blocks that are actually ok and reducing the amount of space available over time. The eraseall utility will not touch blocks that are marked bad, so they can not be recovered.

For the brave at heart: Eddie Dawydiuk hacked the kernel and eraseall utility and posted modified versions so that you can recover those bad sectors (ftp://oz.embeddedarm.com/tmp/erase_BB/). Beware though, as this method might also recover blocks that really are bad, which could be, well, bad.
 
  


Reply



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
LXer: Free Single Board Computer runs Linux LXer Syndicated Linux News 0 04-01-2007 10:31 PM
How to begin Installing Linux on an Single Board Computer. Laeeq Linux - Hardware 0 02-27-2004 08:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:09 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
Open Source Consulting | Domain Registration