The File System - Is Everything Except /media/ Stored In The Nand?


Esn

(:";
Joined
Mar 5, 2003
Messages
3,239
Location
Toronto, Canada
Website
esn.newgrounds.com
This is just a really basic question... basically, I still don't really understand how the file system in Xfce works. I read the Basic Linux Guide on the Pandorawiki, but it didn't answer my questions.

Which folders represent things that are saved on the NAND, and which ones represent things saved in my SD card? This is important to know, so I don't accidentally save stuff on the NAND and fill it up.

Do some folders contain things that are in 2 places at once? For example, like in Windows Explorer, where you have Desktop\My Documents, which can also be found in My Computer, C:\Documents and Settings\Administrator\My Documents.
 
Esn said:
This is just a really basic question... basically, I still don't really understand how the file system in Xfce works. I read the Basic Linux Guide on the Pandorawiki, but it didn't answer my questions.

Which folders represent things that are saved on the NAND, and which ones represent things saved in my SD card? This is important to know, so I don't accidentally save stuff on the NAND and fill it up.

Do some folders contain things that are in 2 places at once? For example, like in Windows Explorer, where you have Desktop\My Documents, which can also be found in My Computer, C:\Documents and Settings\Administrator\My Documents.

Your home folder is by default stored on the NAND, as everything else except devices mounted in folders inside /media (/media itself is stored on NAND). Some of the folders are RAM-disks (/tmp etc.) to save the NAND from wearing out. Some folders can have the same content (/tmp is a symlink to /var/tmp, for example). What the UI add to that; I don't know.
 
Last edited by a moderator:
In general you will want to keep all or nearly all your own data on SD; somestuff (desktop backgrounds say) would be a good candidate for NAND home directory so it works when you pop out SDs though..
 
Thanks. Can anyone tell me where the programs embedded in the OS are located? I'd like to associate some file types with them in Xfe, but I can't find them.
I'm using Xfe because the official file browser is pretty buggy (maybe it should be replaced with Xfe in the next hotfix if the issue isn't fixed... though it IS lacking a search function, but then so is the official file browser; otherwise I would have found their location myself and wouldn't be asking about it here)
 
^ This is just off the top of my head, but check /usr/share/applications - I'm pretty sure that that's where they should be.
 
Thanks for clearing things up a bit.

It strikes me that this file system is not really made for a computer with limited internal memory like the Pandora. The "home" or "username" directories should be by default on an SD card, probably.

Or the file manager should open up in /media/ by default, at least.

Also, it's not possible to assign file types to programs in PND format (or if it is, only through the command line...)

I changed the wiki article to hopefully clear things up a little; I hope I understood it correctly.
 
Esn said:
It strikes me that this file system is not really made for a computer with limited internal memory like the Pandora.
Indeed it isn't. (Well, it's not so much that Linux isn't suited - the same filesystem runs on a million devices with the same or less storage. From DSL routers to CCTV cameras to infinity. But we're using it more like a desktop PC). That's why so much thought and debate went into how it should all work on the Pandora.

Esn said:
The "home" or "username" directories should be by default on an SD card, probably.
...and this goes straight to the heart of said debate. You can read some opposing views on that in the comments of this article.

On a normal Linux system, the /home/username directory does far more than catch a few documents. To use Windows terminology, all your Documents, Settings, and Application Data are installed in here, in (usually) hidden directories. You can imagine the problem of having this directory on your SD, then accidentally ejecting it, or booting without it. The filesystem would be broken, the system would stop functioning.

So /home stayed on the NAND, but that came with pitfalls of its own. If Linux functioned on the Pandora the way it does on a desktop, the NAND would probably be full within an hour of running the first setup. So they developed the PND system, which as you know uses science/magic to keep apps and app data on SD cards, which can be swapped at will without breaking the filesystem.

/media

Onward to /media and the wiki edit. If you browse to your own /media directory, you'll see quite a few things listed in there in addition to the SDs you have inserted. If it is declared as 'safe' / non-NAND zone on the wiki, and Thunar dumps you there by default, people will (i) wonder why they appear to have eight external storage devices plugged in and (ii) try to save things to random directories in there. I think the concept of /media needs to be made clearer.

For the record I don't think the original wording was great either... "the contents of that media have been placed here" implies things have been moved or copied there, instead of them being mere 'shortcuts'. My complete description would be:

External media such as SD cards, flash drives and HDDs show up in here as folders.

I don't know if Linux purists will like that, but it conveys the right message in this context IMO. Truth is people will almost never need to access /media via Thunar, when shortcuts are provided to their storage devices on the left. It's handy stuff to know though, when you're in an emulator trying to find your ROMs.

Thunar landing location

How about this idea: We create a diagram, infographic style, outling the basics of the filesystem on the Pandora (using visual elements screencapped from Thunar). It's placed in the /home dir as part of the stock firmware image. When people open Thunar, the first thing they see is a PNG or PDF saying "Hi, open me." They will instantly be informed that they are on the NAND, and shown how to avoid filling it.
 
Last edited by a moderator:
Hold on, if my appdata are on the NAND, what does the folder on my SD card do? Also, if the appdata are removed along with the executable for the program (when I eject the external media), I'm not sure why things would stop functioning...

P.S. Please feel free to change the wording in the wiki to something better. I would also very much welcome a diagram showing where all the folders in the file system go. However, it will probably be an impossible task, since there are so many of them...

for example, let's just look at the /media/ folder. Here's what it contains:

card
cf
hdd
mmc1
[mySDcard]
net
ram
realroot
union

A confusing mess! And only one of those folders is actually useful in any way (and it's not "card", which is an easy mistake to make). It's almost the only one I'll ever use, but it's hidden inside a directory tree.

And the list on the wiki doesn't give a full list of the directories in / either. Here's what's really there:

bin
boot
dev
etc
home
lib
media
mnt
pandora
proc
sbin
sys
tmp
usr
var

Lots of opportunity for confusion there, as well!

In an ideal world, the file system should have been something simple like this:

-SD card
-USB key
-any other external media; they'd all appear as main folders once plugged in
-Internal (this folder would be for all things stored in the Pandora)
->directory where everything installed in the NAND is located, & its appdata
->RAM (all the temporary stuff)
 
Oh sorry, I worded that paragraph really badly. Pandora stores appdata on SD only. I've reworded the paragraph with the Windows terminology, please read it again and see if it's better.
 
Gruso said:
Oh sorry, I worded that paragraph really badly. Pandora stores appdata on SD only.
That's not true either.
There's an appdata directory in the /pandora folder (not the one on my SD card). It seems to store things for some of the applications that are stored in /usr/share (on the NAND, in other words). There seems to be another one in /home/user/Applications/data.
 
Last edited by a moderator:
Ok... the intended behaviour on the Pandora is that all Appdata is stored on SD. There are exceptions to the rule, and there has been software that breaks the rule. But if you cover every eventuality in every statement you make, you will find yourself never getting to the point!

I'm not a Linux guru, and in those first paragraphs I'm not trying to cover every in and out of the Linux filesystem. I was just trying to describe, conceptually, what the intended function of /home is and why it's different on the Pandora.

[edit] Also, IMO you do not need to document every detail of the filesystem on the wiki. It's Linux, people can learn about its inner depths anywhere on the web and use that knowledge directly on the Pandora. The things that are unique to Pandora like libpnd are already documented quite well. The wiki should focus on what Pandora users need to know, which boils down to four main points:

- These parts are NAND
- These parts are not NAND
- This is safe to do
- This is not safe to do

I'm working on the diagram.
 
I was just trying to describe, conceptually, what the intended function of /home is and why it's different on the Pandora.
And I appreciate the attempt.

At the same time, if you simply things too much, the user goes and sees that it's not as you say it is, and leaves confused.

Anyway, I've changed some more things around in the wiki article... hopefully it's a bit more accurate now.

It's Linux, people can learn about its inner depths anywhere on the web and use that knowledge directly on the Pandora.
But HOW MUCH of it will apply? Some things are different on the Pandora. If there is such an in-depth guide, it should be entirely repasted and edited so as to be accurate for the Pandora, so users don't have to guess what is the same and what is changed.

- These parts are NAND
- These parts are not NAND
- This is safe to do
- This is not safe to do
I'd add:
-where the programs in the internal memory are located (since sometimes you have to know where they are, to assign file types to them in other file browsers, for example)
 
Ok, here's the diagram (very rough draft).

I've gone way off the path of the wiki page here; the idea of this diagram is for people to find it when they first open Thunar.

nkw33.jpg

Getting back to the wiki. I've attempted to further clarify /media. I removed the instruction to save files into that folder, because you don't generally advise people to go into /media to find their SD cards (unless you're giving them command line instructions). If they save a file from Mousepad, or they open Thunar, they're going to have direct access to their SD card in the sidebar.

But they do need to know what it is, and that they can use it if they need to. I think the current wording conveys this succinctly.

Re: things like finding NAND apps to associate files with, and tips like saving backgrounds to the home folder, I agree that stuff should be on the wiki. But I'm not sure if a basic intro to Linux is the best page for such specifics?
 
Gruso said:
External media such as SD cards, flash drives and HDDs show up in here as folders.

I don't know if Linux purists will like that, but it conveys the right message in this context IMO. Truth is people will almost never need to access /media via Thunar, when shortcuts are provided to their storage devices on the left. It's handy stuff to know though, when you're in an emulator trying to find your ROMs.
It doesn't matter if purists don't like it - if it doesn't tell the curious user what they need to know in an understandable fashion, then it isn't helping anyone. :p I think that's a good description of it, to be honest.

Esn said:
But HOW MUCH of it will apply? Some things are different on the Pandora. If there is such an in-depth guide, it should be entirely repasted and edited so as to be accurate for the Pandora, so users don't have to guess what is the same and what is changed.
In my experience, most things. I should note that my primary OS is Linux-based (Xubuntu, specifically), and everything I already know applies - the changes made for the Pandora's sake (which, in my experience, in the big picture, seem to be relatively few) seem obvious and common-sensical to me.
 
Last edited by a moderator:
The default file manager is a bit buggy (sometimes you can't select anything in the right window no matter what you do), so I prefer to use Xfe... I imagine others might also use file managers where the SD cards don't automatically show up on the left panel. There are several listed in the wiki software list now.

I think a lot of non-coder Linux newbies who'd read that page come over fairly familiar with doing things in Windows, so you don't need to assume that they prefer to not know where directories are actually located...

On that note, Pencil saves everything in /mnt/utmp/pencil. sebt3 has told me that this is on the SD card, but I've also been told in this thread that only the directory in /media is the SD card. So...?
 
Esn said:
On that note, Pencil saves everything in /mnt/utmp/pencil. sebt3 has told me that this is on the SD card, but I've also been told in this thread that only the directory in /media is the SD card. So...?
That's pnd system magic ;)

In fact, when a PND is run, his appdata directory is mounted as overlay over /mnt/utmp/<name>.
So every write in this directory is in fact done in the appdata directory which is on SD-Card.
 
Last edited by a moderator:
[edit] First sentence ninja by sebt3 [/edit]

Point taken on locating SD cards, not everyone is going to do it the same way. However I think the current wording covers every approach:
External media such as SD cards, flash drives and HDDs show up in here as folders. You can think of these folders as shortcuts to the devices.
 
Esn said:
On that note, Pencil saves everything in /mnt/utmp/pencil. sebt3 has told me that this is on the SD card, but I've also been told in this thread that only the directory in /media is the SD card. So...?
/mnt and /media are both mount directories: things in those directories are typically other devices*. The difference is that things mounted in /media will appear as icons on the desktop or in Thunar, while things in /mnt are only accessible by actually going to that directory. the /mnt/utmp/* directories are, as already said, part of the PND magic.


*"other device" actually means a lot of different things in Linux. It could be a physical device like an SD card or hard drive; it could be a file like a PND; it could just be a loop to an already mounted directory anywhere else in the file system. Linux is kind of awesomely flexible like that.
 
Last edited by a moderator:
Thanks sebt3 & WizardStan. Are there any other directories like that?

So this "mnt" directory is something like a clone of "media"? (or part of it...)

Maybe a good general section to add to the article would be "where is it safe to save my files?". (because lots of programs ask you where to save files)

It is, as far as I can understand currently, safe to save them in the SD card folders (which can be accessed either through /media or they might be listed in the left column directly), and also in /mnt/utmp/<name> if the program asks for that.
 
Esn said:
Are there any other directories like that?
Not that I now. Let's summerize :
/dev, /tmp are ram disk : files there will disapper if the pandora is shutdown
/proc and /sys are specials directories where nobody should write
/media/<devicename> is external drives (be it USB or sdcards)
every thing else is on NAND.
A normal user (as opposite to root) can only write to : /tmp, /media/<devicename> and his home directory. only the later is stored on NAND.

Esn said:
So this "mnt" directory is something like a clone of "media"? (or part of it...)
In fact it's the opposite. /mnt is the historical mount-point. /media appeared when things like automounter and then userfriendly mounting appeared. It offered a clear distinction between what was mounted by the automates and what was mounted by the system. Nowadays, it look like only /media is used.


Esn said:
Maybe a good general section to add to the article would be "where is it safe to save my files?". (because lots of programs ask you where to save files)
You're the wiki master here ;)
 
Last edited by a moderator:
Back
Top