Advertisement
Guest User

Untitled

a guest
May 28th, 2010
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1.  
  2. Personal tools
  3.  
  4. Log in / create account
  5. Intro
  6. Downloads
  7. Community
  8. Development
  9. News
  10. TALK
  11.  
  12. Navigation
  13.  
  14. Main Page
  15. Recent changes
  16. Random page
  17. Help
  18. Advanced search
  19. Views
  20.  
  21. Page
  22. Discussion
  23. Edit
  24. History
  25. Free up rootfs space
  26.  
  27.  
  28. Some instructions here may cause serious problems. When unsure, see General precautions
  29. Backing up your data is recommended. In case of trouble you might need to re-flash your device.
  30.  
  31. 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.
  32.  
  33.  
  34. Contents [hide]
  35. 1 Listing rootfs space on your device
  36. 2 Disable Extras-testing, Extras-devel, and/or any other third party repositories
  37. 3 Clear apt cache
  38. 4 Remove unused dependencies
  39. 5 List of big and rarely used files
  40. 6 Move apt cache outside of rootfs
  41. 7 Optify Python
  42. 8 Remove non-optified packages
  43. 9 Custom scripts
  44. 9.1 Script to free up space on rootfs
  45. 9.2 Script to safely free space on rootfs
  46. 9.3 Move some of the pre-installed applications into /opt
  47. 9.4 Move themes
  48. 9.5 See rootfs usage per package
  49. [edit]Listing rootfs space on your device
  50.  
  51. Use this command to determine how much rootfs space is allocated, used, and available on your device.
  52.  
  53. df -h /
  54. If you want to see all filesystems, use only "df -h".
  55.  
  56. [edit]Disable Extras-testing, Extras-devel, and/or any other third party repositories
  57.  
  58. 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.
  59.  
  60. Disabling extras-testing and extras-devel will (currently) give you an extra 5 MB in rootfs
  61.  
  62.  
  63. [edit]Clear apt cache
  64.  
  65. Run following command (has to be done as root)
  66.  
  67. apt-get clean
  68.  
  69. [edit]Remove unused dependencies
  70.  
  71. Run following command (has to be done as root)
  72.  
  73. apt-get autoremove
  74.  
  75. [edit]List of big and rarely used files
  76.  
  77. 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.).
  78.  
  79. /usr/lib/locale/locale-archive (28 MB)
  80. /usr/share/locale (10 MB, but you have to keep at least the languages you use)
  81. /usr/share/themes/alpha and /beta (they use 5-6 MB each, keep the one you use)
  82. /usr/share/fonts/arabic and /chinese (2,5 MB less for people who don't speak those two languages)
  83. [edit]Move apt cache outside of rootfs
  84.  
  85. 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.
  86.  
  87. Create a download folder on the eMMC to be used for the downloaded packages instead of the default apt archive folder.
  88.  
  89. mkdir -p /home/user/MyDocs/apt-archive-cache/archives/partial
  90. Now execute apt-get with the -o option as root:
  91.  
  92. apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache <command>
  93. for <command> you can enter the command you normally would use after apt-get.
  94.  
  95. Examples:
  96.  
  97. apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache dist-upgrade
  98.  
  99. apt-get -o dir::cache=/home/user/MyDocs/apt-archive-cache install <package>
  100. [edit]Optify Python
  101.  
  102. If you have installed python or a python program before it was optified, you can optify it with this method. First open a console, then type the following commands as root:
  103.  
  104. apt-get install pymaemo-optify
  105. apt-get clean
  106. 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:
  107.  
  108. /opt/pymaemo/usr/lib/python2.5
  109. 2064208 471712 1487640 24% /usr/lib/python2.5
  110.  
  111. [edit]Remove non-optified packages
  112.  
  113. 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.
  114.  
  115. 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:
  116.  
  117. Open a console
  118. Start the application that you do not need
  119. In the Terminal/console, type:
  120. ps -ef
  121. You get a listing of all running processes, including the application you just started. To find out what package an application belongs to, enter
  122.  
  123. dpkg --search $(which processname)
  124.  
  125. Source: http://talk.maemo.org/showpost.php?p=468063&postcount=1
  126.  
  127.  
  128. [edit]Custom scripts
  129.  
  130. [edit]Script to free up space on rootfs
  131.  
  132. This script will move some unnecessary files on rootfs to /home/opt/ to free up space on rootfs.
  133.  
  134. BEWARE: Icon Label Issue May Occur. http://talk.maemo.org/showthread.php?p=654384#post654384
  135.  
  136. First, create a file, move-to-opt.sh for example, containing this script:
  137.  
  138. #!/bin/sh
  139. # Nokia N900 Maemo 5 Script to free up space on rootfs
  140. # ignoring errors when creating dirs that may already exist
  141.  
  142. # Moving ?? icons to /home/opt
  143. mkdir -p /home/opt/usr/share/icons 2> /dev/null
  144. cp -r /usr/share/icons/* /home/opt/usr/share/icons
  145. rm -r /usr/share/icons
  146. ln -s /home/opt/usr/share/icons /usr/share/icons
  147.  
  148. # Moving video on start-up to /home/opt
  149. mkdir -p /home/opt/usr/share/hildon-welcome 2> /dev/null
  150. cp -r /usr/share/hildon-welcome/* /home/opt/usr/share/hildon-welcome
  151. rm -r /usr/share/hildon-welcome
  152. ln -s /home/opt/usr/share/hildon-welcome /usr/share/hildon-welcome
  153.  
  154. # ??
  155. mkdir -p /home/opt/usr/share/pixmaps 2> /dev/null
  156. cp -r /usr/share/pixmaps/* /home/opt/usr/share/pixmaps
  157. rm -r /usr/share/pixmaps
  158. ln -s /home/opt/usr/share/pixmaps /usr/share/pixmaps
  159.  
  160. # Moving 'apt cache' to /home/opt - Valid until Bug 5746 is fixed.
  161. mkdir -p /home/opt/var/cache/apt 2> /dev/null
  162. cp -r /var/cache/apt/* /home/opt/var/cache/apt
  163. rm -r /var/cache/apt
  164. ln -s /home/opt/var/cache/apt /var/cache/apt
  165.  
  166. # Moving locales Source
  167. mv /usr/share/locale /opt
  168. ln -s /opt/locale /usr/share/locale
  169. Set the script's permission for executable:
  170.  
  171. chmod +x move-to-opt.sh
  172. (note that this step will - without warning you in any way - not work on partitions which are only fat formatted, as maybe your micro sd card will initially be; in such a case, move the script somewhere else)
  173.  
  174. Run the script as root:
  175.  
  176. ./move-to-opt.sh
  177. [edit]Script to safely free space on rootfs
  178.  
  179. This script shows you how much space will be freed and automatically detects whether some directories have already been moved.
  180.  
  181. BEWARE: Icon Label Issue May Occur. http://talk.maemo.org/showthread.php?p=654384#post654384
  182.  
  183. [edit]Move some of the pre-installed applications into /opt
  184.  
  185. 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:
  186.  
  187. mv /usr/share/nokia-maps /home/opt/
  188. ln -s /home/opt/nokia-maps /usr/share/nokia-maps
  189. Moving the microb-engine (has to be done as root) will save 13.9 Mb:
  190.  
  191. mv /usr/share/microb-engine /home/opt
  192. ln -s /home/opt/microb-engine /usr/share/microb-engine
  193. Moving the "Getting started" app/tutorial (has to be done as root):
  194.  
  195. mv /usr/share/tutorial-applet /home/opt
  196. ln -s /home/opt/tutorial-applet /usr/share/tutorial-applet
  197. [edit]Move themes
  198.  
  199.  
  200. This may cause problems when changing themes, and reversing it is NOT possible unless the device is reflashed
  201. Add the following into the script above OR add into another script (with #!/bin/sh at the start)
  202.  
  203. # Moving themes to /home/opt
  204. mkdir -p /home/opt/usr/share/themes 2> /dev/null
  205. cp -r /usr/share/themes/* /home/opt/usr/share/themes
  206. rm -r /usr/share/themes
  207. ln -s /home/opt/usr/share/themes /usr/share/themes
  208. [edit]See rootfs usage per package
  209.  
  210. This script [1] 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.
  211.  
  212. from [2]
  213.  
  214. Categories: Power users | N900 | Firmware update
  215.  
  216. This page was last modified 12:18, 26 May 2010.
  217. This page has been accessed 32,273 times.
  218. All Content CC
  219. Legal
  220. Privacy policy
  221. About maemo.org wiki
  222. Powered by MediaWiki
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement