maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Root space - What is "optifying"? (https://talk.maemo.org/showthread.php?t=40131)

chicoelnino 2010-01-11 21:16

Root space - What is "optifying"?
 
Could someone break down what is meant by root space? And how do I check mine etc...

Much appreciated!

Rob1n 2010-01-11 21:34

Re: Root space
 
The N900 has two (or three if you have a memory card installed) separate flash memory areas. The first is a 256M high-speed flash which is attached directly to the processor. The second is a 32GB built-in flash.

The root (or rootfs) is so-called because it's at the root of the directory tree (the lowest level). This is on the 256M high-speed memory, because it contains the libraries and applications that are used most often. The /home and the /home/MyDocs directories are on the 32GB internal memory - /opt is actually just a link to /home/opt.

The reason the root memory is only 256M is because that was the largest available at the time the phone was designed.

You can see what free space you have where by running X Terminal and typing:
Code:

df -h

RevdKathy 2010-01-11 21:39

Re: Root space
 
Quote:

Originally Posted by Rob1n (Post 465181)
The N900 has two (or three if you have a memory card installed) separate flash memory areas. The first is a 256M high-speed flash which is attached directly to the processor. The second is a 32GB built-in flash.

The root (or rootfs) is so-called because it's at the root of the directory tree (the lowest level). This is on the 256M high-speed memory, because it contains the libraries and applications that are used most often. The /home and the /home/MyDocs directories are on the 32GB internal memory - /opt is actually just a link to /home/opt.

The reason the root memory is only 256M is because that was the largest available at the time the phone was designed.

You can see what free space you have where by running X Terminal and typing:
Code:

df -h

So which figure should I be looking at? The line marked rootfs says it has a total of 227.6M. The line with a total of 256M is tmpfs.

Which one should I be worried about?

Rob1n 2010-01-11 21:42

Re: Root space
 
There's some rounding errors I think (or possibly binary vs decimal) - the rootfs line is the one you want to be worried about anyway.

RevdKathy 2010-01-11 21:51

Re: Root space
 
Quote:

Originally Posted by Rob1n (Post 465196)
There's some rounding errors I think (or possibly binary vs decimal) - the rootfs line is the one you want to be worried about anyway.

Ahh. Then I should probably be worried. Which is slightly worrying as I have about 3 items from devel, all carefully checked.

Rob1n 2010-01-11 21:56

Re: Root space
 
How much free do you have? And have you rebooted after installing any apps?

jaysire 2010-01-11 22:12

Re: Root space
 
Quote:

Originally Posted by RevdKathy (Post 465191)
So which figure should I be looking at? The line marked rootfs says it has a total of 227.6M. The line with a total of 256M is tmpfs.
Which one should I be worried about?

Here's my df (diskfree) output. The parameter -h just means "human readable", which is Linux for "change bytes to megabytes and kilobytes and whatnot".

Code:

Filesystem                Size      Used Available Use% Mounted on
rootfs                  227.9M    189.1M    34.6M  85% /
ubi0:rootfs            227.9M    189.1M    34.6M  85% /
tmpfs                    1.0M    68.0k    956.0k  7% /tmp
tmpfs                  256.0k    80.0k    176.0k  31% /var/run
none                    10.0M    72.0k      9.9M  1% /dev
tmpfs                    64.0M      4.0k    64.0M  0% /dev/shm
/dev/mmcblk0p2            2.0G    188.2M      1.7G  10% /home
/dev/mmcblk0p1          27.0G      9.7G    17.3G  36% /home/user/MyDocs

Our things of "interest" in this output are the first, next to last and last line.

We all have 227.9 megabytes of root file system available, but what's interesting is the "available" -column that says I have 34.6 megabytes or 85% in use.

The last two lines indicate that /home/user/MyDocs has a total of 27 gigabytes (with 17.3 gigs free) and /home (our home directory) has a total of 2 gigabytes (of which 1.7 gigs are still free).

This is called partitioning: The internal memory/drive has been divided into several parts, the most interesting of which are 227.9 megabytes, 27 gigabytes and 2 gigabytes in size.

These partitions can then be "mapped" (or mounted) to certain directories. That is why Linux lacks drives like windows (ie. C: and D:). Instead, the physical disk or partition is mapped (connected, mounted) to a directory. So when Linux-guys insert a dvd, it doesn't become D: like on Windows. Instead it has to be manually or automatically mounted to a directory. That could be any directory, but usually ends up being something sensible like /mnt/dvd.

This is done to protect the system: We can fill up one partition and leave the other ones with plenty of space to function well. In the Maemo-case, the root mount is very small in size (228 megabytes) and should be left alone as much as possible. Instead, programs should be installed to the /opt -directory.

Interestingly, opt is part of the root filesystem! But if we look at /opt with ls, it says:

Code:

Nokia-N900-42-11:~# ls -la /opt
lrwxrwxrwx    1 root    root            9 Oct 30 13:36 /opt -> /home/opt

... which means /opt is actually a symbolic link to /home/opt. So /opt actually points to /home/opt, which has 1.7 gigs free, making it a good place to install apps.

Presumably the 18 megabyte download of today's new firmware release was significantly more when extracted. Upgrading stuff on Linux is often comparable to unzipping (extracting) packages on top of old versions (and maybe cleaning up the old versions before that). So the installer for today's firmware might have checked that it could fit completely on the rootfs. Let's say the unextracted firmware was 30 megabytes. The installer would then probably halt installation if less than 30 megabytes are available on the rootfs.

The installer is also probably not able to account for files that will be replaced (if we install a file that is 2 megabytes in size, we need zero megabytes of free space if this file replaces an older version that is also 2 megabytes. In fact, by installing the new 2 megabyte version of a file, we can INCREASE free space if we replace a more inefficiently compressed file that used to be 3 megabytes).

Sorry for writing so much, but you asked ;)

wmarone 2010-01-11 22:15

Re: Root space
 
Quote:

Originally Posted by jaysire (Post 465259)
We all have 227.9 megabytes of root file system available, but what's interesting is the "available" -column that says I have 34.6 megabytes or 85% available.

I think you mean 85% used (15% available.)

RevdKathy 2010-01-12 08:37

Re: Root space
 
I have about 80% used, with 45mb free. I guess I'm just one of those cautious people that likes to have oodles of free space 'just in case'. (My Girl guide training - always have food in the cupboard, a bit of money in the bank, a day or two of annual leave in hand and space on your drives. :p )

Since others seem to have the same or less, and aren't worried, I shall hereby stop worrying.

tk421 2010-01-12 08:54

Re: Root space
 
The Conky app brings up a list of system info. I had a look but it mut have been in one of the extra reps. Worth installing if you can.
http://i45.tinypic.com/id6r2p.jpg


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

vBulletin® Version 3.8.8