Editing Free up rootfs space

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
{{Danger}}
+
<div style="border: 1px solid red; background-color: #faa; padding: 20px;"><div style="text-align:center;">'''Some instructions here may cause problems. When unsure, see [[General precautions]]'''</div>
-
Here's a simple howto for those suffering from lack of space in rootfs. The first suggestion is more of a temporary matter, for example to get enough space to install an update, but it's also the fastest and easiest. The suggestions are in order of potential threat to operating system. Least dangerous first and the most dangerous last. The rest are more permanent (and thus more useful), but they require [[root access]].
+
<br>'''Backing up your data is recommended.''' In case of trouble you might need to [[Updating the tablet firmware|re-flash your device]].</div>
-
==Listing rootfs space on your device ==
+
Here's a simple howto for those suffering from lack of space in rootfs. The first suggestion is more of a temporary matter, for example to get enough space to install an update, but it's also the fastest and easiest. The suggestions are in order of potential threat to operating system. Least dangerous first and the most dangerous last.
-
Use this command to determine how much rootfs space is allocated, used, and available on your device.
+
The rest are more permanent (and thus more useful), but they require [[root access]].
-
df -h /
+
=== Listing Disk Space in rootfs ===
-
If you want to see all filesystems, use only "df -h".
+
Use the 'df' command to determine how much space is allocated, used, and available in rootfs.
-
If you want to print a list of all directories under rootfs and their cumulative sizes, run the following command (sizes in MB, sorted in ascending order):
+
$ df
-
du -mx / | sort -n
+
=== Disable Extras-testing, Extras-devel and/or any other third party repositories===
-
If you want a comprehensive list of what packages are using what space on rootfs, which will take a little bit of time for your device to prepare, Chris Pitchford has prepared [http://discussions.europe.nokia.com/t5/Maemo-and-MeeGo-Devices/whats-apps-take-a-lots-of-roofts/td-p/715374 a couple of scripts] which will achieve this.
+
Simply check the disabled box and save in the Application Manager's catalogues menu. wait for app manger to update the lists.
 +
Of course this only helps if you actually had these repositories enabled.
-
== Freeing up space ==
+
Disabling extras-testing and extras-devel will (currently) give you an extra 11.5Mb in rootfs
-
===Disable Extras-testing, Extras-devel, and/or any other third party repositories===
 
-
Simply check the disabled box and save in the Application Manager's catalogues menu. Wait for app manger to update the lists. This only helps if you actually had these repositories enabled.
+
=== Clear apt-cache ===
-
 
+
-
Disabling [[extras-testing]] and [[extras-devel]] will (currently) give you an extra 5 MB in rootfs
+
-
 
+
-
===Clear apt cache===
+
-
 
+
-
Run following command (has to be done as root)
+
 +
Run following command as [[root]] (after you have disabled extras-testing&extras-devel)
  apt-get clean
  apt-get clean
-
will release probably near 10 MB.
+
And reboot after that.
-
''In my case, it freed about 250MB of 'home', as shown by 'storageusage' application.''
+
-
 
+
-
===Remove unused dependencies===
+
-
 
+
-
Run following command (has to be done as root)
+
-
 
+
-
apt-get autoremove
+
-
 
+
-
===Purge unused configuration files===
+
-
 
+
-
Even when you have uninstalled a package it may leave configuration files on your system. Use dpkg to find uninstalled packages with configuration files still in place:
+
-
 
+
-
dpkg -l|grep ^rc
+
-
 
+
-
Remove the configuration files by purging the packages:
+
-
 
+
-
dpkg --purge foo bar
+
-
 
+
-
If you don't want to purge all packages with uninstalled configuration files by hand, this line might come handy (as root, or with sudo in xargs):
+
-
 
+
-
  dpkg -l | grep ^rc | cut -d " " -f 3 | xargs dpkg --purge
+
-
 
+
-
===List of big and rarely used files===
+
-
 
+
-
You can't just delete these files, this is just a list with ideas! You have to know what you are going to do with them (optify, backup+remove, etc.).
+
-
* <code>/usr/lib/locale/locale-archive</code> (28 MB) : stupid idea : if you do such a thing, you will loose all the constant texts as the names of days ("Monday","Tuesday",...). What kind of advice is this?
 
-
* <code>/usr/share/locale</code> (10 MB, but you have to keep at least the languages you use)
 
-
* <code>/usr/share/themes/alpha</code> and <code>/beta</code> (they use 5-6 MB each, keep the one you use - REMOVING THESE WILL GENERALLY MESS UP YOUR UI - do not simply remove them with "rm -f $dir" - use "apt-get remove [hildon-theme-alpha|hildon-theme-beta]" Similarly you can reinstall them the same way. Dependency apps: "bluezwitch cherry feedingit google-search-widget hildon-desktop hildon-desktop-python-loader hildon-theme-alpha")
 
-
  hildon-theme-beta mp-fremantle-002-pr osso-startup-wizard ovi-promotion-widget)
 
-
* <code>/usr/share/fonts/arabic</code> and <code>/chinese</code> (2,5 MB less for people who don't speak those two languages)
 
-
===Move apt cache outside of rootfs===
+
=== Use apt cache outside of rootfs ===
-
If you run into a problem while using apt-get you can temporarily (for one command only) have the apt cache outside rootfs to be able to download larger deb files.
+
If you run into a problem while using apt-get you can temporarily have the apt cache outside rootfs to be able to download larger deb files.
Create a download folder on the eMMC to be used for the downloaded packages instead of the default apt archive folder.
Create a download folder on the eMMC to be used for the downloaded packages instead of the default apt archive folder.
-
  mkdir -p /home/user/MyDocs/apt-archive-cache/archives/partial
+
  $ mkdir -p /home/user/MyDocs/apt-archive-cache/archives/partial
-
Now execute apt-get with the -o option as root:
+
Now execute apt-get with the -o option as [[root]]:
-
 
+
-
apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache <command>
+
-
 
+
-
for <code><command></code> you can enter the command you normally would use after apt-get.
+
-
 
+
-
Examples:
+
  apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache dist-upgrade
  apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache dist-upgrade
-
 
-
apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache install <package>
 
-
===Optify Python===
+
=== Optify python ===
-
If you have installed python or a python program before it was optified, you can optify it with this method. First [[Terminal#Opening_the_terminal|open a console]], then type the following commands as root:
+
If you have installed python or a python program before python was optified, you can optify it with this method:
 +
first [[open a console]], then type the following commands as [[root]]:
  apt-get install pymaemo-optify
  apt-get install pymaemo-optify
Line 92: Line 50:
When the program is installed, type df -h in the xterm to see if it worked.
When the program is installed, type df -h in the xterm to see if it worked.
-
The output should now contain lines similar to this one:
+
The output should now contain these lines at the end:
  /opt/pymaemo/usr/lib/python2.5
  /opt/pymaemo/usr/lib/python2.5
                       2064208    471712  1487640  24% /usr/lib/python2.5
                       2064208    471712  1487640  24% /usr/lib/python2.5
 +
/opt/pymaemo/usr/share/pyshared
 +
                      2064208    471712  1487640  24% /usr/share/pyshared
 +
/opt/pymaemo/usr/lib/pyshared
 +
                      2064208    471712  1487640  24% /usr/lib/pyshared
 +
/opt/pymaemo/usr/share/python-support
 +
                      2064208    471712  1487640  24% /usr/share/python-support
 +
/opt/pymaemo/usr/lib/python-support
 +
                      2064208    471712  1487640  24% /usr/lib/python-support
-
===Remove non-optified packages===
+
=== Remove non-optified packages ===
-
If you have installed programs from extras-devel, third party repositories or rarely, but possible, extras-testing, the programs might not be properly optified. Removing these might help with rootfs space.
+
If you have installed programs from extras-testing, extras-devel or third party repositories, the programs might not be properly optified. Removing these might help with rootfs space.
You can free space by uninstalling applications that you do not need. A problem is if you do not know how these applications are called. To find it out:
You can free space by uninstalling applications that you do not need. A problem is if you do not know how these applications are called. To find it out:
-
 
+
* [[open a console]]
-
* [[Terminal#Opening_the_terminal|Open a console]]
+
* start the application that you do not need
-
* Start the application that you do not need
+
* in the console, type
-
* In the Terminal/console, type:
+
  ps -ef
  ps -ef
You get a listing of all running processes, including the application you just started. To find out what package an application belongs to, enter
You get a listing of all running processes, including the application you just started. To find out what package an application belongs to, enter
  dpkg --search $(which ''processname'')
  dpkg --search $(which ''processname'')
-
Source: http://talk.maemo.org/showpost.php?p=468063&postcount=1
 
-
===Custom scripts===
+
source:http://talk.maemo.org/showpost.php?p=468063&postcount=1
-
====Script to free up space on rootfs====
+
=== Remove ioquake3 ===
 +
The ioquake3 application prevents firmware upgrading no matter how much free space you have on your device. Uninstall it prior to upgrading then reinstall once the upgrade is complete.
-
This script will move some unnecessary files on rootfs to /home/opt/ to free up space on rootfs.
+
=== Script to move stuff to /home/opt/ ===
-
BEWARE: Icon Label Issue May Occur.
+
This script will move some files to /home/opt/ allowing rootfs space to be freed:
-
http://talk.maemo.org/showthread.php?p=654384#post654384
+
First, create a file, move-to-opt.sh for example, containing this script:
First, create a file, move-to-opt.sh for example, containing this script:
-
<source lang="bash">
+
 
-
#!/bin/sh
+
#!/bin/sh
-
# Nokia N900 Maemo 5 Script to free up space on rootfs
+
# Script for moving stuff from / to /home/opt to get more rootfs space on Nokia N900 Maemo 5
-
# ignoring errors when creating dirs that may already exist
+
# ignoring errors when creating dirs that may already exist
   
   
-
# Moving ?? icons to /home/opt
+
# Moving themes to /home/opt
-
mkdir -p /home/opt/usr/share/icons 2> /dev/null
+
mkdir -p /home/opt/usr/share/themes 2> /dev/null
-
cp -r /usr/share/icons/* /home/opt/usr/share/icons
+
cp -r /usr/share/themes/* /home/opt/usr/share/themes
-
rm -r /usr/share/icons
+
rm -r /usr/share/themes
-
ln -s /home/opt/usr/share/icons /usr/share/icons
+
ln -s /home/opt/usr/share/themes /usr/share/themes
-
 
+
-
# Moving video on start-up to /home/opt
+
# Moving icons to /home/opt
-
mkdir -p /home/opt/usr/share/hildon-welcome 2> /dev/null
+
mkdir -p /home/opt/usr/share/icons 2> /dev/null
-
cp -r /usr/share/hildon-welcome/* /home/opt/usr/share/hildon-welcome
+
cp -r /usr/share/icons/* /home/opt/usr/share/icons
-
rm -r /usr/share/hildon-welcome
+
rm -r /usr/share/icons
-
ln -s /home/opt/usr/share/hildon-welcome /usr/share/hildon-welcome
+
ln -s /home/opt/usr/share/icons /usr/share/icons
-
 
+
-
# ??
+
# Moving boot video to /home/opt
-
mkdir -p /home/opt/usr/share/pixmaps 2> /dev/null
+
mkdir -p /home/opt/usr/share/hildon-welcome 2> /dev/null
-
cp -r /usr/share/pixmaps/* /home/opt/usr/share/pixmaps
+
cp -r /usr/share/hildon-welcome/* /home/opt/usr/share/hildon-welcome
-
rm -r /usr/share/pixmaps
+
rm -r /usr/share/hildon-welcome
-
ln -s /home/opt/usr/share/pixmaps /usr/share/pixmaps
+
ln -s /home/opt/usr/share/hildon-welcome /usr/share/hildon-welcome
-
 
+
-
# Moving 'apt cache' to /home/opt - Valid until [https://bugs.maemo.org/show_bug.cgi?id=5746 Bug 5746] is fixed.
+
# ??
-
mkdir -p /home/opt/var/cache/apt 2> /dev/null
+
mkdir -p /home/opt/usr/share/pixmaps 2> /dev/null
-
cp -r /var/cache/apt/* /home/opt/var/cache/apt
+
cp -r /usr/share/pixmaps/* /home/opt/usr/share/pixmaps
-
rm -r /var/cache/apt
+
rm -r /usr/share/pixmaps
-
ln -s /home/opt/var/cache/apt /var/cache/apt
+
ln -s /home/opt/usr/share/pixmaps /usr/share/pixmaps
 +
 +
# Moving apt cache to /home/opt
 +
mkdir -p /home/opt/var/cache/apt 2> /dev/null
 +
cp -r /var/cache/apt/* /home/opt/var/cache/apt
 +
rm -r /var/cache/apt
 +
ln -s /home/opt/var/cache/apt /var/cache/apt
-
# Moving locales [http://talk.maemo.org/showpost.php?p=568370&postcount=11 Source]
 
-
mv /usr/share/locale /opt
 
-
ln -s /opt/locale /usr/share/locale
 
-
</source>
 
Set the script's permission for executable:
Set the script's permission for executable:
  chmod +x move-to-opt.sh
  chmod +x move-to-opt.sh
-
(note that this step will - without warning you in any way - not work on partitions which are only FAT formatted, as maybe your microSD card will initially be; in such a case, move the script somewhere else)
 
-
Run the script as root:
+
Run the script as [[root]]:
  ./move-to-opt.sh
  ./move-to-opt.sh
-
====Script to safely free space on rootfs====
+
=== alternative script to safely free space on rootfs ===
-
 
+
[http://wiki.maemo.org/User:Tanner#Safely_free_some_space_on_rootfs This script] shows you much space
-
[[User:Tanner#Safely_free_some_space_on_rootfs|This script]] shows you how much space will be freed and automatically detects whether some directories have already been moved.
+
will be freed and automatically detects whether some directories have already been moved.
-
 
+
-
BEWARE: Icon Label Issue May Occur.
+
-
http://talk.maemo.org/showthread.php?p=654384#post654384
+
-
 
+
-
====Move some of the pre-installed applications into /opt====
+
-
 
+
-
Some applications like Nokia Maps and the microb-engine are placed in /usr/share taking up valuable root space, moving these files will not affect the apps.
+
-
 
+
-
Moving Nokia Maps (has to be done as root) will save 8.7 Mb:
+
 +
=== Move some of the pre-installed applications into /opt ===
 +
Some applications like Nokia Maps and the microb-engine are placed in /usr/share taking up valuable root space, moving these files will not affect the apps.
 +
Moving Nokia Maps (has to be done as [[root]]):
  mv /usr/share/nokia-maps /home/opt/
  mv /usr/share/nokia-maps /home/opt/
  ln -s /home/opt/nokia-maps /usr/share/nokia-maps
  ln -s /home/opt/nokia-maps /usr/share/nokia-maps
-
Moving the microb-engine (has to be done as root) will save 13.9 Mb:
+
Moving the microb-engine (has to be done as [[root]]):
  mv /usr/share/microb-engine /home/opt
  mv /usr/share/microb-engine /home/opt
  ln -s /home/opt/microb-engine /usr/share/microb-engine
  ln -s /home/opt/microb-engine /usr/share/microb-engine
-
Moving the "Getting started" app/tutorial (has to be done as root) will save 0.9 Mb:
+
Moving the "Getting started" app/tutorial (has to be done as [[root]]):
  mv /usr/share/tutorial-applet /home/opt
  mv /usr/share/tutorial-applet /home/opt
  ln -s /home/opt/tutorial-applet /usr/share/tutorial-applet
  ln -s /home/opt/tutorial-applet /usr/share/tutorial-applet
-
 
-
(With the CSSU - and possibly without on PR1.3 - the tutorial may be uninstalled, getting rid of the tutorial folder entirely)
 
-
 
-
 
-
To get a bit more rootfs space you can move Flashplayer to opt; will save 3.5Mb:
 
-
mv  /usr/lib/browser/plugins/libflashplayer.so /opt/usr/lib/
 
-
ln -s /opt/usr/lib/libflashplayer.so  /usr/lib/browser/plugins/libflashplayer.so
 
-
 
-
====Move themes====
 
-
 
-
{{ambox
 
-
| type = notice
 
-
| text = '''This may cause problems when changing themes, and reversing it is NOT possible unless the device is [[Updating the firmware|reflashed]]
 
-
}}
 
-
 
-
Add the following into the script above OR add into another script (with #!/bin/sh at the start)
 
-
 
-
# Moving themes to /home/opt
 
-
mkdir -p /home/opt/usr/share/themes 2> /dev/null
 
-
cp -r /usr/share/themes/* /home/opt/usr/share/themes
 
-
rm -r /usr/share/themes
 
-
ln -s /home/opt/usr/share/themes /usr/share/themes
 
-
 
-
====See rootfs usage per package====
 
-
 
-
This script [http://www.robinhill.me.uk/downloads/pkgsize.py] outputs a list of all packages in rootfs and their size therein. I can not vouch for its validity but it seemed decent enough.
 
-
"python pkgsize.py checkpkgs | sort -n" gives you a sorted result in bytes. Most of these files are supposed to be there but it might help you find some non optified ones.
 
-
 
-
from [http://www.robinhill.me.uk/maemo/package_sizes.html]
 
-
 
-
Here is another script pkgscan.sh which sort big files on rootfs [http://talk.maemo.org/showpost.php?p=442804&postcount=28]
 
-
 
[[Category:Power users]]
[[Category:Power users]]
[[Category:N900]]
[[Category:N900]]
-
[[Category:Firmware update]]
 

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: