maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   a quick and easy way to free more space on rootfs (https://talk.maemo.org/showthread.php?t=43825)

roamerjiang 2010-02-09 00:33

a quick and easy way to free more space on rootfs
 
Hi, guys, I'm not a technical staff, but found a very nice way to free much more space on root. The original link is http://www.maemoers.com/thread-162-1-1.html. It was quite easy, just several command lines in your x-termal (just copy & paste the following commands into your x-termal,

1) root
2) rm -r /home/root/
3) root
4)
mkdir -p /home/root/usr/share
cd /usr/
for FILE in games include local src var
do
mv $FILE /home/root/usr/
ln -s /home/root/usr/$FILE /usr/
done

mkdir -p /home/root/var/cache
cd /var/cache/
for FILE in apt
do
mv $FILE /home/root/var/cache/
ln -s /home/root/var/cache/$FILE /var/cache/
done

cd /usr/share/
for FILE in fonts icons locale mime nokia-maps pixmaps sounds themes tutorial-applet zoneinfo
do
mv $FILE /home/root/usr/share/
ln -s /home/root/usr/share/$FILE /usr/share/
done

mkdir /home/root/usr/share/games
ln -s /home/root/usr/share/games

I did this, and found free space on my root jumped to 93mb from 60mb before. Everything works normal.

NOTE: just do this one time, since when i did it second time, my n900 firewire was broken. I have to reflash it myself. So, please do backup your files before doing this, and it might be risky although it works fine for me.

stefanmohl 2010-02-09 00:45

Re: a quick and easy way to free more space on rootfs
 
Yes, what this does is move a few files to the 2GB home-partition, and add soft-links from the original locations to the new locations.

If you repeat, you will be moving the soft links instead of the real files, i.e. you will now be replacing the real files with the soft links you made earlier, and making new soft links to the old soft links.

thelushlife 2010-02-09 00:57

Re: a quick and easy way to free more space on rootfs
 
i tried this on my n900, from 57mb to 90mb freed up. thanks for the tip!

roamerjiang 2010-02-09 01:02

Re: a quick and easy way to free more space on rootfs
 
Quote:

Originally Posted by stefanmohl (Post 517053)
Yes, what this does is move a few files to the 2GB home-partition, and add soft-links from the original locations to the new locations.

If you repeat, you will be moving the soft links instead of the real files, i.e. you will now be replacing the real files with the soft links you made earlier, and making new soft links to the old soft links.

Thanks for your reply and explanation. Now, i understand why I broke my n900 after i did this second time :D.

buxz777 2010-02-09 01:16

Re: a quick and easy way to free more space on rootfs
 
this is a good tip

has this been added to wiki rootfs info :-) maybe it could be added with an explanation of what it does and if there are any risks

is this safe for neewbies to use , after doing this can you use the device as normal still :-) thanks

groeit 2010-02-09 01:52

Re: a quick and easy way to free more space on rootfs
 
Quote:

I did this, and found free space on my root jumped to 93mb from 60mb before. Everything works normal.
How :o I've never ever seen 90MB free on my rootfs! :-) Have you got any apps installed? I'm happy with my 54MB :-)

Filesystem Size Used Available Use% Mounted on
rootfs 227.9M 168.9M 54.8M 76% /
ubi0:rootfs 227.9M 168.9M 54.8M 76% /
tmpfs 1.0M 72.0k 952.0k 7% /tmp
tmpfs 256.0k 88.0k 168.0k 34% /var/run
none 10.0M 80.0k 9.9M 1% /dev
tmpfs 64.0M 4.0k 64.0M 0% /dev/shm
/dev/mmcblk0p2 2.0G 258.4M 1.6G 14% /home
/opt/pymaemo/usr/lib/python2.5
2.0G 258.4M 1.6G 14% /usr/lib/python2.5
/opt/pymaemo/usr/share/pyshared
2.0G 258.4M 1.6G 14% /usr/share/pyshared
/opt/pymaemo/usr/lib/pyshared
2.0G 258.4M 1.6G 14% /usr/lib/pyshared
/opt/pymaemo/usr/share/python-support
2.0G 258.4M 1.6G 14% /usr/share/python-support
/opt/pymaemo/usr/lib/python-support
2.0G 258.4M 1.6G 14% /usr/lib/python-support
/dev/mmcblk0p1 27.0G 16.6G 10.4G 61% /home/user/MyDocs
/dev/mmcblk1p1 968.3M 122.1M 846.1M 13% /media/mmc1

That's how it looks for me :-)

crail 2010-02-09 02:01

Re: a quick and easy way to free more space on rootfs
 
ive 82 percent of my root filled. i dont realy understand this process. id appreciate it someone would do a numpty guide on how to do this...

stefanmohl 2010-02-09 02:07

Re: a quick and easy way to free more space on rootfs
 
I've created a brainstorm for solving the rootfs problem properly. You can find the forum thread for it here:

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

The brainstorm itself is here:

https://maemo.org/community/brainsto...n_in_the_n900/

Vote for it, and we might get 2GB or more free in rootfs instead of just 90MB :-)

jakiman 2010-02-09 06:21

Re: a quick and easy way to free more space on rootfs
 
Very nice tip. Would love to know how to reverse it back just in case. =)
(Seems I can figure this one out by looking at the commands)

It feels like Nokia Ovi Maps take a little longer to load after this. (~3-5 seconds)
I guess moving it from the fast memory to a slower memory doesn't help. =P

This also broke the hitech 0.13 (latest) theme I was using.
Now whenever I reboot, it defaults to the default Nseries theme.
No idea why. Seems to be symlinked just fine.
I just uninstalled and reinstalled the theme but still same. grr.
I moved the themes folder back to /usr/share/.
Now the hitech theme works again as it should. Anyone know why?

I'm a linux noob but pretty okay with grasping the conceps quickly.
This thread alone made me learn quite a few commands. Awesome.

pycage 2010-02-09 07:13

Re: a quick and easy way to free more space on rootfs
 
I can imagine a lot of N900s will be getting bricked by PR 1.2 because of hacks like this.
Making root filesystem modifications circumventing the package database is generally a very bad idea.

jakiman 2010-02-09 07:18

Re: a quick and easy way to free more space on rootfs
 
Quote:

Originally Posted by pycage (Post 517301)
I can imagine a lot of N900s will be getting bricked by PR 1.2 because of hacks like this.
Making root filesystem modifications circumventing the package database is generally a very bad idea.

I can only imagine that new firmware will overwrite the symlinks with real directories again.
(Which makes some folders in the /home/root/ useless..)

Well, I'll uninstall some apps, revert the symlinks I've done here, then update to PR1.2 when it comes out. :D

ossipena 2010-02-09 07:21

Re: a quick and easy way to free more space on rootfs
 
what for do you need the extra 40mb of rootfs? isn't 60mb enough? if not, why?

berty 2010-02-09 07:28

Re: a quick and easy way to free more space on rootfs
 
Looks good, but don't want to risk it. I don't want to start messing about flashing my device etc.

roamerjiang 2010-02-09 15:01

Re: a quick and easy way to free more space on rootfs
 
Quote:

Originally Posted by ossipena (Post 517308)
what for do you need the extra 40mb of rootfs? isn't 60mb enough? if not, why?

When I found this method, i just wanted to try it since more free space is always better than less. To be honest, i didn't imagine it could free that much space just by doing this :D. It works fine for me with both previous firewire version and current 51.1. Hope those commands can be helpful to those who really need more rootfs :).

roamerjiang 2010-02-09 15:13

Re: a quick and easy way to free more space on rootfs
 
Quote:

Originally Posted by buxz777 (Post 517086)
this is a good tip

has this been added to wiki rootfs info :-) maybe it could be added with an explanation of what it does and if there are any risks

is this safe for neewbies to use , after doing this can you use the device as normal still :-) thanks

I think this should be ok to newbies, since I'm also a newbie :). After doing this, my device works quite normal and i haven't noticed anything wrong yet. BUT, just do it one time, no matter how much space you free, do not do it again except you want to reflash your n900 :).

titan 2010-02-09 17:49

Re: a quick and easy way to free more space on rootfs
 
you could also use the section "# move root stuff to /home" of my script on
http://wiki.maemo.org/User:Tanner#Re...ng_.26_Restore
it detects if some directory was already moved.

hawaii 2010-02-09 21:15

Re: a quick and easy way to free more space on rootfs
 
PR1.2 update should over-write the symlinks with REAL directories and files, I don't forsee a "break" happening unless the for some idiotic reason, the symlinks are followed instead of a force creation in parent directories.

titan 2010-02-09 21:22

Re: a quick and easy way to free more space on rootfs
 
Quote:

Originally Posted by hawaii (Post 518333)
PR1.2 update should over-write the symlinks with REAL directories and files, I don't forsee a "break" happening unless the for some idiotic reason, the symlinks are followed instead of a force creation in parent directories.

why should it overwrite and why would keeping the symlinks be stupid?
If you perform an over-the-air upgrade, dpkg will keep the symlinks as it already
does for the /opt symlink.

deadmalc 2010-02-09 21:29

Re: a quick and easy way to free more space on rootfs
 
sorry, I don't really see the point in this thread.
/opt is a little pain, but that's it.

rm -rf / ? anyone ;-)


All times are GMT. The time now is 10:00.

vBulletin® Version 3.8.8