Reply
Thread Tools
Posts: 16 | Thanked: 15 times | Joined on Jan 2010 @ Norway
#1
This is an attempt to start a clean thread about what folders we may safely move out of rootfs and symlink. This has been mentioned elsewhere, but I will try to keep a unified list here.

Those familiar with the file systems etc. of the N900 should skip to the actual list of manually relocatable directories, in the next post.

Primer about space and filesystems on the N900, intended to be informative to geeks and readable to noob/non-Linux-folk (impossible, I know . It may not be 100% accurate, so I'll update it if there's any relevant input:

The N900 has 256MB of NAND flash and 32GB of eMMC flash. The NAND is the main file system for operating system and application, called "root filesystem" or rootfs. NAND is faster and more robust. The N900 has a "full-blow" Linux operating system, resulting in a lot of write activity on the file system (even if it has been tuned to be less intensive). So the whole OS couldn't be on the cheaper eMMC.

The 32GB is cut (partitioned) into 768 MB swap, 2GB extra storage for apps, and 27 GB for general storage of files (pictures, documents, movies, music etc.). The split between apps and files is done so that Windows computers can "see" the N900 as a general Mass Storage device over USB (like a flashdrive). Windows can read a FAT file system (VFAT/FAT32), but FAT is old and primitive and not very suitable for Linux to store applications and system files on. Thus the 2GB separate part with a Linux-proper file system type (ext3).

How is all this tied together? Windows users may be used to A:, C:, D:. In Linux (and MacOS, and Unix, and…) the file system is one single hierarchy starting from /. Different file systems (hard disks, flash drives, CD-ROMs etc.) are mounted (attached) at points in the file system hierarchy. Read more here (noob friendly), here (more depth) and here i wikipedia.

So in the N900, at / (the root) we have the rootfs 256MB. Mounted at /home is the 2GB partition of the eMMC. But on top of that: /opt is not a directory, but a link to /home/opt. Finally the 27GB FAT partition is mounted at /home/user/MyDocs. My personal view is that 256MB rootfs is unnecessary cheap by Nokia, but NVM that now.

In Linux, simply put, /opt is often used to store some of applications' files. So Nokia strongly encourages developers to put as much as they can in /opt - this is called to "optify" the package.

But a lot of packages are just taken from "vanilla" Linux, or for other reasons not optified. So they fill up the rootfs. Also, when you install/update packages they are saved to a temporary folder in the rootfs (/var/cache/apt/archives). It's cleared at boot, but a lot of installing/updating will grow that folder to 30-40MB or more.

I mentioned the way /opt links to /home/opt. Any newbie proceeding from here needs to understand symbolic links. A symbolic link is a "pointer": Any application or user can enter /opt, and will get whatever is in /home/opt, and don't need to know about it.

So we want to move some of these space hogs out of the rootfs, by moving them to the 2GB /home file system, and put a symlink instead.

But: We can't just move any folder over. It may brick your phone. Some files/folders just plain need to reside in the rootfs. Often it's about availability at boot time.

Final newbie remark: You will need to know very simply how to use the CLI, a.k.a. X Terminal. I won't explain that in detail here. But briefly:
Install rootsh. Open X Terminal and type 'root', and 'mkdir /home/reclaim'
To move and link a folder
  • mv <folder> /home/reclaim (observe that the folder doesn't exist)
  • ln -s /home/reclaim/<folder>

    If you wan't to test moving/linking a different folder than those listed here:
  • cp -a <folder> /home/reclaim (observe that the folder doesn't exist)
  • mv <folder> <folder>.org
  • ln -s /home/reclaim/<folder>
If everything works OK, incl. booting / updating, you may
rm -rf <folder>.org

I don't know if this is feasible with the graphical file manager, maybe others can elaborate. Or you may install the file manager mc.

Final point: I found this post about repartitioning entirely, for those interested (and bold).

So much for v0.1 of the general info. Now for the list of actual movable folders, and what you can save.

Last edited by gaute; 2010-02-01 at 01:22.
 

The Following 7 Users Say Thank You to gaute For This Useful Post:
Posts: 16 | Thanked: 15 times | Joined on Jan 2010 @ Norway
#2
Got derailed by family business, but let's get started.

These are taken from this thread, kudos to kwotski:
http://forums.internettablettalk.com...=33362&page=17

List of folders that may (apparently) be safely moved and linked, and approx. saved size:

Code:
5-30M   /home/reclaim/usr/share/icons
2M      /home/reclaim/usr/share/mc
10-12M  /home/reclaim/usr/share/nokia-maps
0-50?M  /home/reclaim/var/cache/apt
3M      /home/reclaim/var/lib/apt
25-30M  /home/reclaim/var/lib/dpkg
10-20+M /home/reclaim/usr/share/themes
I have moved others, and will update as I see that they seem safe.

Last edited by gaute; 2010-03-13 at 00:13.
 

The Following User Says Thank You to gaute For This Useful Post:
Posts: 16 | Thanked: 15 times | Joined on Jan 2010 @ Norway
#3
As you can see space hogs are often under /user/share and /var.

The graphical Storage Usage application is OK, but there's no option not to list folders that are symlinked to/from other file systems. If you want to check the size of a folder, try:

Code:
du -hs <folder>
To check all folders under a folder, e.g. /usr/share

Code:
cd /usr/share
du -hs * | grep M
(listing only those with size in megabytes.)
 
mankir's Avatar
Posts: 276 | Thanked: 224 times | Joined on Dec 2009 @ Frankfurt, Germany
#4
For those who are interested in repartitioning, better have a look here: http://talk.maemo.org/showthread.php?t=35122
 
Posts: 50 | Thanked: 36 times | Joined on Feb 2010
#5
Originally Posted by gaute View Post
Got derailed by family business, but let's get started.

These are taken from this thread, kudos to kwotski:
http://forums.internettablettalk.com...=33362&page=17

List of folders that may (apparently) be safely moved and linked, and approx. saved size:

Code:
5-30M   /home/reclaim/usr/share/icons
2M      /home/reclaim/usr/share/mc
10-12M  /home/reclaim/usr/share/nokia-maps
0-50?M  /home/reclaim/var/cache/apt
3M      /home/reclaim/var/lib/apt
25-30M  /home/reclaim/var/lib/dpkg
I have moved others, and will update as I see that they seem safe.
can I move all of /usr/share???

what about /var/lib

I tried moving /var/cache and bricked my phone on reboot
 
Posts: 25 | Thanked: 0 times | Joined on Jan 2010
#6
Is it possible to browse like in file manager?

How do i view what's in folders? Is there the a DIR command?
 
Posts: 5,795 | Thanked: 3,151 times | Joined on Feb 2007 @ Agoura Hills Calif
#7
Ok, I'd just like to point out -- if there are any newbies looking at this thread, if you have 50k or even less, that is PLENTY for the rootfs as I understand it. Don't mess around with this unless you think it's fun, or like me, you don't mind reflashing once in awhile. In my opinion, once you start moving files around like this you are risking various problems that you might not even understand well.
 
Posts: 25 | Thanked: 0 times | Joined on Jan 2010
#8
I just want to change my WAD file in the doom folder.

EDIT:

Found it sweet!!

Got this little bit of code from another thread - can't remember where now...

sudo gainroot
mkdir /media/root
mount / /media/root -o bind




That let's you browse the root folder in file manager.

Last edited by bushi; 2010-02-14 at 05:07.
 
Posts: 8 | Thanked: 1 time | Joined on Jan 2010
#9
Is there any update to this thread?
Can all above mentioned folders be removed safely?
 
Posts: 16 | Thanked: 15 times | Joined on Jan 2010 @ Norway
#10
Just added /usr/share/themes which appears to be manually optifiably safely.
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:08.