View Single Post
sifo's Avatar
Posts: 1,359 | Thanked: 1,292 times | Joined on Oct 2011 @ Tartus.Syria
#5
This script edited by Amr.fayz you can find him here in Meecolay thread, anyway this is his script :
Code:
#!/bin/sh
# Miroroot script to safely free space on rootfs
# by Amr.fayz

if test "`id -u`" -ne 0; then
    echo "Error: This script must be run as root!"
    echo "Please make sure that the package rootsh from extras is installed"
    echo "and execute \"sudo gainroot\" and then \"$0\" in Terminal"
    exit 1
fi

echo rootfs before:
df -h /
chmod +x /home/Miroroot
chmod 775 /home/Miroroot
# move root stuff to /home/Miroroot
dirs="usr/share/icons usr/share/nokia-maps usr/share/fonts usr/share/locale usr/share/microb-engine usr/share/tutorial-applet usr/share/cherry usr/local/lib /usr/include usr/lib/locale usr/lib/microb-engine usr/lib/skyhost /usr/lib/browser/plugins usr/lib/pyshared/python2.5 usr/lib/python2.5/site-packages usr/lib/qt4/imports usr/lib/qt4/plugins usr/lib/debug/usr var/lib/dpkg var/lib/apt"
#optional: usr/share/themes  var/lib/dpkg
if test -d /home/var/cache/apt; then
  # keep existing apt cache
  rm -rf /var/cache/apt
  ln -s /home/var/cache/apt /var/cache/apt
else
  dirs="$dirs var/cache/apt"
fi
(cd / && du -sc $dirs)
for d in $dirs; do
    test -L /$d && continue
    echo moving /$d
    rm -rf /home/Miroroot/$d
    mkdir -p /home/Miroroot/$d
    cp -a /$d /home/Miroroot/$d/..
    mv /$d /$d.old
    ln -s /home/Miroroot/$d /$d
    rm -rf /$d.old
done
sync
echo "success"
echo "rootfs after (after a reboot the actual free space will be shown):"
df -h /
And here is the original copy of the script and i safely used it before (copyrights belongs to Thomas Tanner )
Code:
#!/bin/sh
# N900 script to safely free space on rootfs
# (c) 2010 by Thomas Tanner <maemo@tannerlab.com>
# licensed under GPLv3
# version 0.5 (16. May 2010)

if test "`id -u`" -ne 0; then
    echo "Error: This script must be run as root!"
    echo "Please make sure that the package rootsh from extras is installed"
    echo "and execute \"sudo gainroot\" and then \"$0\" in Terminal"
    exit 1
fi

echo rootfs before:
df -h /
# move root stuff to /home
dirs="usr/share/icons usr/share/nokia-maps usr/share/fonts usr/share/locale usr/lib/locale var/lib/apt"
#optional: usr/share/themes  var/lib/dpkg
if test -d /home/var/cache/apt; then
  # keep existing apt cache
  rm -rf /var/cache/apt
  ln -s /home/var/cache/apt /var/cache/apt
else
  dirs="$dirs var/cache/apt"
fi
(cd / && du -sc $dirs)
for d in $dirs; do
    test -L /$d && continue
    echo moving /$d
    rm -rf /home/$d
    mkdir -p /home/$d
    cp -a /$d /home/$d/..
    mv /$d /$d.old
    ln -s /home/$d /$d
    rm -rf /$d.old
done
sync
echo "success"
echo "rootfs after (after a reboot the actual free space will be shown):"
df -h /
#!/bin/sh
# N900 script to safely free space on rootfs
# (c) 2010 by Thomas Tanner <maemo@tannerlab.com>
# licensed under GPLv3
# version 0.5 (16. May 2010)

if test "`id -u`" -ne 0; then
    echo "Error: This script must be run as root!"
    echo "Please make sure that the package rootsh from extras is installed"
    echo "and execute \"sudo gainroot\" and then \"$0\" in Terminal"
    exit 1
fi

echo rootfs before:
df -h /
# move root stuff to /home
dirs="usr/share/icons usr/share/nokia-maps usr/share/fonts usr/share/locale usr/lib/locale var/lib/apt"
#optional: usr/share/themes  var/lib/dpkg
if test -d /home/var/cache/apt; then
  # keep existing apt cache
  rm -rf /var/cache/apt
  ln -s /home/var/cache/apt /var/cache/apt
else
  dirs="$dirs var/cache/apt"
fi
(cd / && du -sc $dirs)
for d in $dirs; do
    test -L /$d && continue
    echo moving /$d
    rm -rf /home/$d
    mkdir -p /home/$d
    cp -a /$d /home/$d/..
    mv /$d /$d.old
    ln -s /home/$d /$d
    rm -rf /$d.old
done
sync
echo "success"
echo "rootfs after (after a reboot the actual free space will be shown):"
df -h /
?

./sifo
Attached Images
 
__________________
[ N900-Crack ] [ The Purge ] [ New Smiles ] [ New icons ] [ ? ]
" Hey ! I've just met you and this is crazy, so install cssu maybe ? "
Please help out keeping Maemo.org alive, and consider donating.
https://www.facebook.com/ZoRk7

Last edited by sifo; 2012-10-13 at 16:06.
 

The Following User Says Thank You to sifo For This Useful Post: