Reply
Thread Tools
Posts: 11 | Thanked: 16 times | Joined on Jun 2015
#1
I've been having trouble with getting the Rootfs enought space to install packages without problems. What's the best way to open some space in Rootfs?

Also, I've tried ccooke's script, which just made the phone act crazy. I've read that some packages shouldn't be moved to opt with that script, but I'm no sure what is same to move and what not.

Is there some better solution than ccooke's script?

Thanks, everyone.
 

The Following 3 Users Say Thank You to Twilight For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#2
Originally Posted by Twilight View Post
What's the best way to open some space in Rootfs?
https://wiki.maemo.org/Free_up_rootfs_space
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
Posts: 11 | Thanked: 16 times | Joined on Jun 2015
#3
I know that article and I've tried everything in it, except the "Optify Python" part. Have you tried that? And what else have you tried?

One thing in particular is that that article used to mention the ccooke's script ( http://talk.maemo.org/showthread.php?t=33429 ) and no longer does so. I'd really like to ask questions about that solution, though.

Also, how often have you tried the solutions in the wiki article? Can it really clean the rootfs more than one time? I've tried those script solutions currently in there, and they all failed.
 

The Following 2 Users Say Thank You to Twilight For This Useful Post:
Posts: 11 | Thanked: 16 times | Joined on Jun 2015
#4
Bumping this thread.

Give me a hand, TMO.
 

The Following User Says Thank You to Twilight For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#5
I cannot answer the part about the script as I have never used any. I have done all my rootfs crearing manually and I would wholeheartedly recommend anyone to do the same. The only scripted optification I am aware of that happened to my devices is during the CSSU installation.

Why are you asking, by the way? Are you suffering any specific problems?
 

The Following User Says Thank You to pichlo For This Useful Post:
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#6
I tend to use this script for creating space in rootfs. It does not try to optify any packages, but moves the largest folders and their content to /opt, which is part of the sdcard's partition.
Code:
#!/bin/sh
# N900 script to safely free space on rootfs
# (c) 2010 by Thomas Tanner <maemo@tannerlab.com>
# licensed under GPLv3
# version 0.5 (16. May 2010)

if test "`id -u`" -ne 0; then
    echo "Error: This script must be run as root!"
    echo "Please make sure that the package rootsh from extras is installed"
    echo "and execute \"sudo gainroot\" and then \"$0\" in Terminal"
    exit 1
fi

echo rootfs before:
df -h /
# move root stuff to /home
dirs="usr/share/icons usr/share/nokia-maps usr/share/fonts usr/share/locale usr/lib/locale var/lib/apt usr/share/themes  var/lib/dpkg"
#optional: usr/share/themes  var/lib/dpkg
if test -d /home/var/cache/apt; then
  # keep existing apt cache
  rm -rf /var/cache/apt
  ln -s /home/var/cache/apt /var/cache/apt
else
  dirs="$dirs var/cache/apt"
fi
(cd / && du -sc $dirs)
for d in $dirs; do
    test -L /$d && continue
    echo moving /$d
    rm -rf /home/opt/$d
    mkdir -p /home/opt/$d
    cp -a /$d /home/opt/$d/..
    mv /$d /$d.old
    ln -s /home/opt/$d /$d
    rm -rf /$d.old
done
sync
echo "success"
echo "rootfs after (after a reboot the actual free space will be shown):"
df -h /
Copy and paste to a file, make it executable and run it from X-Terminal application as root.
I did not create the script, but modified it for easier reading
 

The Following 4 Users Say Thank You to michaaa62 For This Useful Post:
Posts: 11 | Thanked: 16 times | Joined on Jun 2015
#7
Originally Posted by pichlo View Post
Why are you asking, by the way? Are you suffering any specific problems?
Lack of space, plenty of downloaded things and more to download still. Even going through the Games subsection of the available packages will fill rootfs up to the point where there's less than 10mb, I think.

Originally Posted by michaaa62 View Post
I tend to use this script for creating space in rootfs. It does not try to optify any packages, but moves the largest folders and their content to /opt, which is part of the sdcard's partition.

Copy and paste to a file, make it executable and run it from X-Terminal application as root.
I did not create the script, but modified it for easier reading
Thanks, I'll try that one!
Is there an option to revert changes, in case something goes wrong?
 

The Following User Says Thank You to Twilight For This Useful Post:
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#8
There is no way back, but to remove the symlinks and copy things back to the default place.

The script fetches the folders usr/share/icons, usr/share/nokia-maps, usr/share/fonts, usr/share/locale, usr/lib/locale, var/lib/apt, usr/share/themes, var/lib/dpkg and /var/cache/apt and copies them one by one to the second partition of the internal card (by default 2GB) and creates links to the new place for the system to find them.
Basically you move folders from the smaller rootfs to larger optfs.
 

The Following User Says Thank You to michaaa62 For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#9
Originally Posted by michaaa62 View Post
The script fetches the folders usr/share/icons, usr/share/nokia-maps, usr/share/fonts, usr/share/locale, usr/lib/locale, var/lib/apt, usr/share/themes, var/lib/dpkg and /var/cache/apt and copies them one by one to the second partition of the internal card (by default 2GB) and creates links to the new place for the system to find them.
That rings a bell. I have never run a script to free my rootfs but I may have been inspired by a similar script to do that manually.

Please be aware that if you screw up moving locales, you may end up with something like this:

Name:  Screenshot-20131101-200907.jpg
Views: 205
Size:  23.1 KB
 

The Following User Says Thank You to pichlo For This Useful Post:
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#10
@ pichlo:
Here is the snippet from a ssh session running that script:
Nokia-N900:~# cd /home/user/MyDocs/Recovery/
Nokia-N900:/home/user/MyDocs/Recovery# sh movetoopt.sh
rootfs before:
Filesystem Size Used Available Use% Mounted on
rootfs 227.8M 136.0M 87.5M 61% /
0 usr/share/icons
7448 usr/share/nokia-maps
0 usr/share/fonts
12860 usr/share/locale
23352 usr/lib/locale
0 var/lib/apt
0 usr/share/themes
25648 var/lib/dpkg
0 var/cache/apt
69308 total
moving /usr/share/nokia-maps
moving /usr/share/locale
moving /usr/lib/locale
moving /var/lib/dpkg
success
rootfs after (after a reboot the actual free space will be shown):
Filesystem Size Used Available Use% Mounted on
rootfs 227.8M 120.6M 103.0M 54% /

Nokia-N900:/home/user/MyDocs/Recovery# reboot & exit
Connection to 192.168.49.249 closed.
root@asterix:/home/micha# n900


BusyBox v1.23.1 (Debian 1.23.1power2+thumb0) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N900:~# cd /home/user/MyDocs/Recovery/
Nokia-N900:/home/user/MyDocs/Recovery# sh movetoopt.sh
rootfs before:
Filesystem Size Used Available Use% Mounted on
rootfs 227.8M 111.5M 112.1M 50% /
0 usr/share/icons
0 usr/share/nokia-maps
0 usr/share/fonts
0 usr/share/locale
0 usr/lib/locale
0 var/lib/apt
0 usr/share/themes
0 var/lib/dpkg
0 var/cache/apt
0 total
success
rootfs after (after a reboot the actual free space will be shown):
Filesystem Size Used Available Use% Mounted on
rootfs 227.8M 111.5M 112.1M 50% /
Nokia-N900:/home/user/MyDocs/Recovery#

All is fine with the localisation here.

The real sizes of above directories following symlinks:
Nokia-N900:~# du -Hs /usr/share/icons/ /usr/share/nokia-maps/ /usr/share/fonts /usr/share/locale /usr/lib/locale /var/lib/apt /usr
/share/themes /var/lib/dpkg /var/cache/apt/
6896 /usr/share/icons/
8296 /usr/share/nokia-maps/
3224 /usr/share/fonts
du: /usr/share/locale/it/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/nl/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/cs/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/pl/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/fr/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/de/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/sv/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/vi/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/ro/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
du: /usr/share/locale/zh_CN/LC_MESSAGES/libgpg-error.mo: Too many levels of symbolic links
15300 /usr/share/locale
23740 /usr/lib/locale
42028 /var/lib/apt
8892 /usr/share/themes
26004 /var/lib/dpkg
48564 /var/cache/apt/

Last edited by michaaa62; 2015-06-15 at 11:30. Reason: Readability
 

The Following User Says Thank You to michaaa62 For This Useful Post:
Reply

Tags
optification, optifying

Thread Tools

 
Forum Jump


All times are GMT. The time now is 19:37.