Moving out apt metadata

As some of you may know, in the N900, the root file system is stored in a OneNAND chip with 256M of space. Meanwhile /home and /home/user/MyDocs are in a eMMC in two different partitions: ~2GB (ext2) for /home and ~29GB (vfat) for /home/user/MyDocs.

The OneNAND is faster than the eMMC, and it’s intended to host only the Maemo main system, moving out the third party applications to the eMMC. Though, this new layout has brought new limitations, the more visible one is the /opt problem [2].

One of the debates about what left and what not in the OneNAND is the apt’s database and metadata. Moving out the apt’s database out from the OneNAND to the eMMC, in my personal opinion, is very risky: It will slow down the database processing (which is already slow given the size of the Fremantle repositories), and if the eMMC gets corrupted, the base system wouldn’t be upgreadable either, because apt couldn’t read its database. And that’s why I’m against the proposal.

Nevertheless I’m aware that the apt’s metadata and database could be huge, consuming much of the precious OpenNAND storing space. Just to mention it,  I’ve found myself, in my development cycles, moving out those files.

That’s why I cooked this script: move-apt-dirs.sh

WARNING: this script is not official. You’re at your own if you run it: no promises, no guaranties.

Tags: , ,

8 comments

  1. mmm.. i want to try this solution, but when i write this in Xterm:

    sudo gainroot
    /directorywhereisthescript/# ./move-apt-dirs.sh

    N900 return me an error: i haven’t root permission! why?

    However: if i have any problems, after can i restore my N900 with Nokia Software Update?

  2. […] Non abbiamo testato questo metodo in quanto è molto rischioso e non supportato. Maggio informazioni QUI. […]

  3. Hi Simone,

    As you can see in the script source, at the beginning is a validation of the “effective user id”. And gainroot (sudo) doesn’t provide that.

    You have two options:

    a) Enters as root in the system and run the script (the easiest way is through an ssh connection)

    b) Modify the script in order to remove the validation.

    If you have problems, you shall re-flash the device.

    I’ve been using the moved apt files since PR 1.0.1 and the SSU to 1.1 went smooth.

    Cheers

  4. […] We have not tested this method because it is very risky and unsupported. More HERE. […]

  5. hi, thanks for your reply :)
    however, also with ssh connection i have problems.
    i’m trying to execute with “winscp” (filezilla doesn’t support the “execute-command”) the script (it’s located into the device) but nothing: permission denied!

  6. Hi Simone,

    When you download something into the n900, by default it goes into /home/user/MyDocs, which is a partition in vfat, which doesn’t manage the unix permissions.

    In order to run the command, you just specify the interpreter:

    # sh ./move-apt-dirs.sh

  7. :)
    i know that Home directory doesn’t recognize root-permission and i used “/root/” folder for the script…
    but now with the script in the “/”, it’s all ok!

    thank you!

  8. […] option is to execute the script move-apt-dirs.sh. But if you do it, the rescue mode could fail, because the apt cache is in a different (and […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>