maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Tried to free up rootfs space, problem happened (https://talk.maemo.org/showthread.php?t=44703)

choubbi 2010-02-16 15:17

[FIXED] Tried to free up rootfs space, problem happened
 
Hi, I was trying to free some space in rootfs, so I followed this page of the wiki, and finally ran the script I copied/pasted in my N900.

I got this :
Code:

/home/user # ./move.sh
cp: cannot create directory '/home/opt/var/cache/apt/archives': No such file or directory
cp: cannot create directory '/home/opt/var/cache/apt/pkgcache.bin': Path does not exist
cp: cannot create directory '/home/opt/var/cache/apt/srcpkgcache.bin': Path does not exist
/home/user # apt-get update
E: Archive directory /var/cache/apt/archives/partial is missing.
/home/user # apt-get clean
E: Could not open lock file /var/cache/apt/archives/lock - open (2 No such file or directory)
E: Unable to lock the download directory

The script itself is :
DON'T RUN THIS SCRIPT, IT IS WRONG
Code:

#!/bin/sh
# 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
mkdir /home/opt/usr 2> /dev/null
mkdir /home/opt/usr/share 2> /dev/null
mkdir /home/opt/usr/share/themes 2> /dev/null
mkdir /home/opt/usr/share/icons 2> /dev/null
mkdir /home/opt/usr/share/hildon-welcome 2> /dev/null
mkdir /home/opt/usr/share/pixmaps 2> /dev/null
mkdir /home/opt/var/cache/apt 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

cp -r /usr/share/icons/* /home/opt/usr/share/icons
rm -r /usr/share/icons
ln -s /home/opt/usr/share/icons /usr/share/icons

cp -r /usr/share/hildon-welcome/* /home/opt/usr/share/hildon-welcome
rm -r /usr/share/hildon-welcome
ln -s /home/opt/usr/share/hildon-welcome /usr/share/hildon-welcome

cp -r /usr/share/pixmaps/* /home/opt/usr/share/pixmaps
rm -r /usr/share/pixmaps
ln -s /home/opt/usr/share/pixmaps /usr/share/pixmaps

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

Can anyone help me understand what I did wrong, or/and how to fix that ? My first guess would be to reflash the N900, but maybe someone has a cleaner way.

Rob1n 2010-02-16 15:22

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by choubbi (Post 529725)
Hi, I was trying to free some space in rootfs, so I followed this page of the wiki, and finally ran the script I copied/pasted in my N900.

I got this :
Code:

/home/user # ./move.sh
cp: cannot create directory '/home/opt/var/cache/apt/archives': No such file or directory
cp: cannot create directory '/home/opt/var/cache/apt/pkgcache.bin': Path does not exist
cp: cannot create directory '/home/opt/var/cache/apt/srcpkgcache.bin': Path does not exist
/home/user # apt-get update
E: Archive directory /var/cache/apt/archives/partial is missing.
/home/user # apt-get clean
E: Could not open lock file /var/cache/apt/archives/lock - open (2 No such file or directory)
E: Unable to lock the download directory

Can anyone help me understand what I did wrong, or/and how to fix that ? My first guess would be to reflash the N900, but maybe someone has a cleaner way.

Not your fault - the script is wrong. Try running the following (as root):
Code:

mkdir -p /home/opt/var/cache/apt/archives/partial
touch /var/cache/apt/archives/lock
apt-get update


choubbi 2010-02-16 15:35

Re: Tried to free up rootfs space, problem happened
 
You rock !

Thank you, that worked !

Rob1n 2010-02-16 15:42

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by choubbi (Post 529759)
You rock !

Thank you, that worked !

No problem - I've fixed the script on the wiki page as well now.

tratrafe2 2010-02-16 17:27

Re: Tried to free up rootfs space, problem happened
 
daaaamn :(
i did something wrong... i did the same thing with choubbi. even after i followed Rob1n's code, i have the following problem:

Quote:

E: Could not open lock file /var/lib/apt/lists/lock - open (2 No such file or directory)
E: Unable to lock the list directory

Rob1n 2010-02-16 18:26

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by tratrafe2 (Post 530025)
daaaamn :(
i did something wrong... i did the same thing with choubbi. even after i followed Rob1n's code, i have the following problem:

You've obviously done something else other than running the script choubbi did, as that script doesn't touch /var/lib/apt at all.

What's the output of:
Code:

ls -l /var/lib /var/lib/apt /var/lib/apt/lists /home/opt/var/lib/apt

Crude 2010-02-18 19:01

Re: Tried to free up rootfs space, problem happened
 
Hey Rob1n thanks for the script. It worked for me but somehow did not free any rootfs space. Any idea on why that could be?

Crude 2010-02-18 19:03

Re: Tried to free up rootfs space, problem happened
 
Also I've been looking around on other ways to free some space and it looks like some D-level apps are the problem. I couldn't find one but Is there any page available that shows a list of programs, which use a lot of rootfs space so I could just remove them?

Rob1n 2010-02-18 19:07

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by Crude (Post 535026)
Hey Rob1n thanks for the script. It worked for me but somehow did not free any rootfs space. Any idea on why that could be?

Which script? I've not actually written any scripts to free up rootfs space.

Quote:

Originally Posted by Crude (Post 535030)
Also I've been looking around on other ways to free some space and it looks like some D-level apps are the problem. I couldn't find one but Is there any page available that shows a list of programs, which use a lot of rootfs space so I could just remove them?

You can use the StorageUsage app to view the disk space packages are using, and that will flag those using rootfs space. There's also some scripts I've written here which will list all packages using rootfs space.

Crude 2010-02-18 19:24

Re: Tried to free up rootfs space, problem happened
 
I'm a complete noob in running the scripts. I've transferred them in my Documents directory. Can't seem to run the checkpkgs.pl script :$ through the terminal.

I've read the instructions but could you please post a noobguide here.

mikhmv 2010-02-18 19:26

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by Crude (Post 535070)
I'm a complete noob in running the scripts. I've transferred them in my Documents directory. Can't seem to run the checkpkgs.pl script :$ through the terminal.

please provide more details. Did you run it under "root"? Please provide outcome from script...

etuoyo 2010-02-18 19:33

Re: Tried to free up rootfs space, problem happened
 
There seems to be a problem with my root. I discovered it when I was trying to create space for the update.

I ran the script above but get message

mkdir:cannot create directory ' home/opt/var/': Permission denited
and then on the next line a similar message saying something about some file already existing. Sorry can't say exactly what the second line was because I had a random reboot just as I was typing it in here.

I get a similar message when I run apt-get clean or apt-get autoremove.

Does anyone know what the problem is? Thanks.

Megaltariak 2010-02-18 19:38

Re: Tried to free up rootfs space, problem happened
 
Install rootsh and type root in the terminal before writing the commands.

etuoyo 2010-02-18 19:53

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by Megaltariak (Post 535100)
Install rootsh and type root in the terminal before writing the commands.

Thanks I type that and then no error message just the message you get at the top of x terminal (busybox v1.10.2, etc). Does that mean the command worked?

Megaltariak 2010-02-18 19:55

Re: Tried to free up rootfs space, problem happened
 
Yes, now you can type cammands wich need root access.

Rob1n 2010-02-18 20:29

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by Crude (Post 535070)
I'm a complete noob in running the scripts. I've transferred them in my Documents directory. Can't seem to run the checkpkgs.pl script :$ through the terminal.

I've read the instructions but could you please post a noobguide here.

You should be able to do (you don't need to be root):
Code:

cd /home/user/MyDocs/.documents
perl checkpkgs.pl | sort -rn > pkgsizes.txt

The pkgsizes.txt file will then contain an (ordered) list of the packages using rootfs space. You can page through it using:
Code:

more pkgsizes.txt

Crude 2010-02-18 23:43

Re: Tried to free up rootfs space, problem happened
 
Rob1n thanks it works now.
I was able to free up quite a bit of space and who knew documents to go took up so much!
Using Conky I know that now I have 40 MiB free in rootfs and I should be able to insall the update BUT it still gives me an error of not enough space! The other areas have more than enough space so now I'm just lost.

Crude 2010-02-19 00:42

Re: Tried to free up rootfs space, problem happened
 
Thanks for the help to all but it seems like this 3 simple steps somehow managed to over look the no space problem.

apt-get clean
apt-get update
apt-get upgrade

Thanks to chuchu for the find and drukane for spreading it.

late666 2010-02-19 01:18

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by Crude (Post 535611)
Rob1n thanks it works now.
I was able to free up quite a bit of space and who knew documents to go took up so much!
Using Conky I know that now I have 40 MiB free in rootfs and I should be able to insall the update BUT it still gives me an error of not enough space! The other areas have more than enough space so now I'm just lost.

Yeah, for some reason the new update needs 46mb

Crude 2010-02-19 05:44

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by late666 (Post 535725)
Yeah, for some reason the new update needs 46mb

To do it through the manager it might take 46MB but if done through the terminal it let me install with no hassle and with memory to spare. They really should've given more space with the rootfs.

I always knew its a bit of a geeky phone but an everyday user with loads of dl apps wouldn't go through forums and hence not like the device!

Shame it really is a gem of a tablet.

maemo.it 2010-02-24 10:02

Re: Tried to free up rootfs space, problem happened
 
well guys, thanks to your advices.. I installed storage usage and Rob1n's pkgs (thank you). Now I'm able to see details about few rootfs memory but...what can I do now?
For example I've only 27,8mb free on rootfs and bigger problem is in usr (245mb).
inside usr I found bigger directory is lib 161mb. what can I delete in lib to free rootfs mem?
eg. locale-archive 28,4mb..I think I can't delete it;
microb-engine 21,9mb..same, I think I can't delete it..
Third bigger in lib/ libqtgui.so.4.5.3 10.2mb, I can't delete it too..
so, what can I do?
:(

ossipena 2010-02-24 10:14

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by maemo.it (Post 543980)
well guys, thanks to your advices.. I installed storage usage and Rob1n's pkgs (thank you). Now I'm able to see details about few rootfs memory but...what can I do now?
For example I've only 27,8mb free on rootfs and bigger problem is in usr (245mb).
inside usr I found bigger directory is lib 161mb. what can I delete in lib to free rootfs mem?
eg. locale-archive 28,4mb..I think I can't delete it;
microb-engine 21,9mb..same, I think I can't delete it..
Third bigger in lib/ libqtgui.so.4.5.3 10.2mb, I can't delete it too..
so, what can I do?
:(

remove something that isn't in rootfs as default? like some extras-testing/dev -software?

F2thaK 2010-02-24 10:27

Re: Tried to free up rootfs space, problem happened
 
WARNING: THIS INFO MAY BE DANGEROUS TO YOUR N900's HEALTH

POWER USERS ONLY



Ive got access through WinSCP over SSH. I can search my enitre device for large files in rootfs.

Ive moved (SYMLINKED) 5 files and saved 46.7 MB on my root.

http://talk.maemo.org/showthread.php?t=43349

This has caused me no trouble has been tested.



the thread below also helps free about another 30-50 MB
but havent tested this as thoroughly:

http://maemo-experience.blogspot.com...on-rootfs.html

maemo.it 2010-02-24 12:09

Re: Tried to free up rootfs space, problem happened
 
my curiosity (I tried to find it in search but nothing) what is rootfs?
egual / in linux desktop distros?
I'd like to know logical structure of maemo filesystem

Rob1n 2010-02-24 12:43

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by maemo.it (Post 544202)
my curiosity (I tried to find it in search but nothing) what is rootfs?
egual / in linux desktop distros?
I'd like to know logical structure of maemo filesystem

rootfs is the filesystem that the root directory is on. The N900 has a 256M OneNAND chip that's used for rootfs, and a (slower) 32GB eMMC flash that's partitioned for 768M swap space, 2G /home, and 27G /home/user/MyDocs. The other key directory you'll read about is /opt which is actually a symlink to /home/opt.

late666 2010-02-24 13:12

Re: Tried to free up rootfs space, problem happened
 
Rootfs is limited to 256mb of memory on a separate chip that's attached to the processor if I'm not mistaken.
Every program installs a bit of itself in rootfs, some more than others, and the rest of it it installs on other parts of the device.
Now, it runs out real quick, so you have to be aware of it, a good way to keep track is to download conky (or the desktop command widget) and check it out once in a while.
If you run out of space, you can't install anything else.. Firmware updates require huge amounts of rootfs space (Just for installation) and updating can be extremely problematic.

Not sure if you know all that already or not, but maybe it will be helpful to anyone else who comes in here.

Edit: Alright, I've created a wiki page for rootfs, I put your explanation in it too rob1n, I hope you don't mind.
http://wiki.maemo.org/Rootfs

maemo.it 2010-02-25 13:16

Re: Tried to free up rootfs space, problem happened
 
thank you guys, following your advices I disabled some repos (eg. extras-devel, extras-testing,..) and now I'd like uninstall all apps in my n900 that aren't optified. There's a way?

Yes: there's a way: http://wiki.maemo.org/Free_up_rootfs_space
;)

nielsvg 2010-02-25 22:58

Re: Tried to free up rootfs space, problem happened
 
Quote:

Originally Posted by maemo.it (Post 545790)
thank you guys, following your advices I disabled some repos (eg. extras-devel, extras-testing,..) and now I'd like uninstall all apps in my n900 that aren't optified. There's a way?

Yes: there's a way: http://wiki.maemo.org/Free_up_rootfs_space
;)

i almost uninstalled every app on my phone and dit apt-get clean and deactivated some repos but there is still only 37mb free? how can i get more memory free? in the program i see a lot of memory in use under lbs but what more can i do r may i delete without any problems? i am a noob :)

i read somewhere you need a minimum of 45mb for installing a big update?

sifo 2012-04-14 17:35

Re: Tried to free up rootfs space, problem happened
 
1 Attachment(s)
Hi i used the "moveroot.sh" script by Thomas Tanner to free up some space in " / " and the commands in the FAQ i also played around and searched then moved some files (Ringing msg email......tunes and some icoms ) this is what i exactly moved it freed more than 10 MB just you will need a basic knowledge and some time :D

im not responsable about any damage do it at your own risk

well for me nothing happend :D !!

just make the directories (mkdir) then move (mv) then link (ln -s).
I suggest using Filbox to move multiple files then remove them then link them



from To

/usr/include /home/usr/
/usr/lib/gstreamer-0.10 /home/usr/lib/
/usr/share/google-search-widget /home/usr/share/
/usr/share/bookmark-manager /home/usr/share/
/usr/share/calendar /home/usr/share/
/usr/share/rtcom-messaging-ui /home/usr/share/rtcom-messaging-ui/
/usr/share/sounds/(unlinked files) /home/usr/share/sounds/
/usr/share/zenmap/pixmap/ /home/usr/share/zenmap/pixmap

example :
root
mkdir /home/usr/share/
mv /usr/share/google-search-wiget /home/usr/share/
ln -s /home/usr/share/google-search-wiget /usr/share/

"if anybody want all of the commands i will write it no problem im here to help and get helped l:D"

hope this help.,
All respect.
Sifo:cool:
*******************

immi.shk 2012-04-14 18:10

Re: Tried to free up rootfs space, problem happened
 
remove Firefox & icedtea(i.e microemulator)..

sifo 2012-04-17 15:59

Re: Tried to free up rootfs space, problem happened
 
1 Attachment(s)
Hi Again and again im not responsable about any damage to your system ( for me nothing happend )
Copy and paste these commands exactly as they are to save some root space from 5-->20 MB
NOTE...: 1-If you faced a problem with the application manager after this commands just move the files back to where were they (for me nothing happend :D)
2-reboot after the commands to get the actuall freed space
3- type in terminal : and see how much availble befor and after :D
4- when using mkdir command if you got file exist tjen it is ok just complete :D
5-when using mv commnd if you got no such file or directory then you dont need that step and complete :D
**********
df -h /
**********
COMMANDS:
******************************
root
mkdir /home/var
mkdir /home/usr
mkdir -p /home/var/lib
mkdir -p /home/usr/python2.5
mkdir -p /home/var/cache
mkdir -p /home/usr/lib
mv /var/lib/apt /home/var/lib && ln -s /home/var/lib/apt /var/lib
mv /var/lib/dpkg /home/var/lib && ln -s /home/var/lib/dpkg /var/lib
mv /var/cache/apt /home/var/cache && ln -s /home/var/cache/apt /var/cache
mv /usr/lib/dpkg /home/usr/lib/ && ln -s /home/usr/lib/dpkg /usr/ib/
mv /usr/lib/apt /home/usr/lib/ && ln -s /home/usr/lib/apt /usr/lib/
mv /usr/lib/nokiamaps-navigation-provider /home/usr/lib/ && ln -s /home/usr/lib/nokiamaps-navigation-provider /usr/lib
mv /usr/lib/python2.5/bsddb/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/bsddb/
mv /usr/lib/python2.5/compiler/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/compiler/
mv /usr/lib/python2.5/config/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/config/
mv /usr/lib/python2.5/ctypes/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/ctypes/
mv /usr/lib/python2.5/curses/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/curses
mv /usr/lib/python2.5/encoding/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/encoding/
mv /usr/lib/python2.5/hotshot/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/hotshot/
mv /usr/lib/python2.5/idlelib/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/idlelib/
mv /usr/lib/python2.5/lib-dynload/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/lib-dynload/
mv /usr/lib/python2.5/lib-tk/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/lib-tk/
mv /usr/lib/python2.5/logging/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/logging/
mv /usr/lib/python2.5/plat-linux2/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/plat-linux2/
mv /usr/lib/python2.5/sqlite3/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/sqlite3/
mv /usr/lib/python2.5/wsgiref/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/wsgiref/
mv /usr/lib/python2.5/xml/ /home/usr/lib/python2.5 && ln -s /home/usr/lib/python2.5/xml/
******************************
mkdir -p: means that creat the directories without errors
&&: means that what followes need to be done immediately after what behind && (just for saving time :D)
*****************************
i wou.d love to make a shell script for that commands but sorry for NOW i dont know
"sorry for the fingers pain :D"
*****************************
and dont forget to run this every several days
apt-get clean
apt-get autoclean
apt-get autoremove
***********************
CHEERS!
SIFO.


All times are GMT. The time now is 22:09.

vBulletin® Version 3.8.8