maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Problem with filesystem, data lost (https://talk.maemo.org/showthread.php?t=100387)

zimmerit 2018-07-03 09:51

Problem with filesystem, data lost
 
Hello

I'm using N900 as a music player, and I transferred some audio files to it via USB. After I disconnected the USB, I moved those files to audio clips (or MyDocs/.sounds) folder. The problem is that everything else on that folder was lost after moving these files to it.

Is there a way to recover them?

peterleinchen 2018-07-03 20:59

Re: Problem with filesystem, data lost
 
This sounds like a question for michaaa62 :)

Just a guess:
all other files under MyDocs are gone, too?

Maybe on removal of USB the MyDocs did not get mounted correctly.
/home/user/MyDocs is just a mount point for eMMC partition.
So the data now resides on the home partition.
If I am right after a reboot you will only see the old data, not the new one.

Where.did.you.copy.the.new.music.to? As you said after moving from already copied-over files to MyDocs/.sounds.

pichlo 2018-07-03 22:32

Re: Problem with filesystem, data lost
 
Good spot, Peter! I was going to speculate about partitions inside partitions and resulting fanthom FATs (yes, it has happened to me once), but not remounting after unplugging is indeed the most obvious answer. If that is the case and it gets mounted correctly after a reboot, then the new files will become invisible.

endsormeans 2018-07-04 04:40

Re: Problem with filesystem, data lost
 
yup...
I can confirm it has happened to me as well...
until I figured out what it was ....it was vexing .

zimmerit 2018-07-04 05:44

Re: Problem with filesystem, data lost
 
Quote:

Originally Posted by peterleinchen (Post 1545995)
This sounds like a question for michaaa62 :)

Just a guess:
all other files under MyDocs are gone, too?

Maybe on removal of USB the MyDocs did not get mounted correctly.
/home/user/MyDocs is just a mount point for eMMC partition.
So the data now resides on the home partition.
If I am right after a reboot you will only see the old data, not the new one.

Where.did.you.copy.the.new.music.to? As you said after moving from already copied-over files to MyDocs/.sounds.

No, everything else on MyDocs is still there. New music was copied from MyDocs to Mydocs/.sounds

edit. I've previously waited few minutes after removing USB connection, because old files in this .sounds/Audio clips are missing at first for some reason, and they appear later on. Now I forgot to wait before moving new files in to it.

peterleinchen 2018-07-04 21:35

Re: Problem with filesystem, data lost
 
Sounds strange.

Now: how did you move these files?
Terminal amd mv
or some file manager?

Even I.cannot believe that one of those would nuke the folder before moving :confused:

pichlo 2018-07-04 22:47

Re: Problem with filesystem, data lost
 
Quote:

Originally Posted by zimmerit (Post 1546001)
...old files in this .sounds/Audio clips are missing at first for some reason, and they appear later on.

That is exactly what Peter was talking about.

The N900's eMMC (think of it as a kind of permanently soldered-in memory card) has three partitions:
  1. 29 GB FAT, mounted as /home/MyDocs and usually just referred to as "MyDocs"
  2. 2 GB etx2, mounted as /home and referred to either as "home" or as "opt", depending on who you ask and in what context
  3. 768 MB swap

When you attach your N900 to a PC with a USB cable in the Mass Storage mode, the 29 GB MyDocs partition is unmounted (i.e., it becomes invisible to the phone) and is exposed in its entirety to the PC as an external USB storage.

Please note that the /home/MyDocs directory ("folder" in the Microsoft newspeak) still exists, only no longer as a mount point. Which means that if you try to read from or write to this directory, the phone will "see" it as part of the 2 GB "home" partition. The standard File Manager is aware of this and hides MyDocs in Mass Storage mode, but alternative file managers and of course the command line do no such tricks so any attempt to access /home/MyDocs goes to the "home" partition.

This situation persists for a few seconds, sometimes up to a minute, after unplugging the USB cable, until the phone re-mounts MyDocs again.

Once MyDocs is mounted, any content written to /home/MyDocs while it was seen as part of the "home" partition becomes shadowed by the mounted partition and effectively disappears from view, until you unmount MyDocs again. Thus, the contents of /home/MyDocs, as seen from the phone's point of view, changes depending on whether the phone is connected as Mass Storage or not. This is why the default File Manager hides MyDocs in the Mass Storage mode, to avoid confusing the user. But, as mentioned above, other file managers and CLI do no such thing.

I suggest using the command line to check the contents of /home/MyDocs while in the Mass Storage mode. It should be an empty directory but you may be surprised what you find. If you do find something there, move it somewhere else and, once the USB is unplugged and MyDocs mounted again, move it there. It would also free up space on the much smaller, 2 GB home partition.

I hope I did not make the above too confusing and/or too tedious. It is quite late and I am tired and prone to rambling incoherently.

endsormeans 2018-07-04 23:15

Re: Problem with filesystem, data lost
 
Naw pichlo not long enough,
This isn't approaching TL,DR territory...
More like...
EC,BH...
Epic Compendium, Brain Hemorrhaged....

Why Oh why pichlo ...
can you not write a simple sentence or paragraph...?

(You realize this is an opportunity I most certainly will take advantage of... :D)

peterleinchen 2018-07-05 04:50

Re: Problem with filesystem, data lost
 
Quote:

Originally Posted by endsormeans (Post 1546015)
Naw pichlo not long enough,
This isn't approaching TL,DR territory...
More like...
EC,BH...
Epic Compendium, Brain Hemorrhaged....

Why Oh why pichlo ...
can you not write a simple sentence or paragraph...?

(You realize this is an opportunity I most certainly will take advantage of... :D)

Oh endso :rolleyes:
At least this was readable under a minute. :D

juiceme 2018-07-05 07:53

Re: Problem with filesystem, data lost
 
@pichlo explained it very well, in a way that a layman can underztand it.
Of course to people who understand the way filesystem mounting in unix/linux works this is already old plain porridge.


All times are GMT. The time now is 01:36.

vBulletin® Version 3.8.8