Reply
Thread Tools
Posts: 139 | Thanked: 32 times | Joined on May 2008 @ France
#1
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.

Last edited by choubbi; 2010-02-16 at 16:17. Reason: title edition
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#2
Originally Posted by choubbi View Post
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
 

The Following User Says Thank You to Rob1n For This Useful Post:
Posts: 139 | Thanked: 32 times | Joined on May 2008 @ France
#3
You rock !

Thank you, that worked !
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#4
Originally Posted by choubbi View Post
You rock !

Thank you, that worked !
No problem - I've fixed the script on the wiki page as well now.
 

The Following 4 Users Say Thank You to Rob1n For This Useful Post:
Posts: 41 | Thanked: 23 times | Joined on Jan 2010
#5
daaaamn
i did something wrong... i did the same thing with choubbi. even after i followed Rob1n's code, i have the following problem:

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
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#6
Originally Posted by tratrafe2 View Post
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
 

The Following User Says Thank You to Rob1n For This Useful Post:
Posts: 20 | Thanked: 2 times | Joined on Feb 2010 @ UK, Birmingham
#7
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?
 
Posts: 20 | Thanked: 2 times | Joined on Feb 2010 @ UK, Birmingham
#8
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?
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#9
Originally Posted by Crude View Post
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.

Originally Posted by Crude View Post
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.
 

The Following User Says Thank You to Rob1n For This Useful Post:
Posts: 20 | Thanked: 2 times | Joined on Feb 2010 @ UK, Birmingham
#10
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.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:16.