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.


All times are GMT. The time now is 23:03.

vBulletin® Version 3.8.8