The group told me once that I shouldn't ever have to reformat, made me think to ask first.<br><br>I'm experimenting with some shell scripting and butting my head on 100% root too often. Think the 10GB I allocated is just too low. What I'm not sure about is how to redo it without reinstalling. Currently I'm running 10G root, 250mb boot, 4GB swap. 485 GB home. I'll have to shrink the home, but that will be fine. I suspect...(blink), sorry, thinking about this as I go. Clearly I have to shrink home, so I'm backing it up now, but can I mount more then one device to the same mount point? I wonder if maybe I could just mount more space to root.<br>
<br>Well, I guess, I'm asking for advice on the most efficient manner to increase root. Fundamentally, I don't particularly understand why my shell script is causing root to run out of space either. It's a 6G laptop and the files it compresses are sitting on the home partition. To help illustrate, here's the contents. <br>
<br>@fozzie:~/Dropbox/bin/scripts$ df -h<br>Filesystem Size Used Avail Use% Mounted on<br>/dev/sda1 9.2G 4.8G 4.0G 55% /<br>none 2.9G 336K 2.9G 1% /dev<br>none 2.9G 216K 2.9G 1% /dev/shm<br>
none 2.9G 344K 2.9G 1% /var/run<br>/dev/sda4 446G 120G 303G 29% /home<br><br><br>!/bin/sh<br><br>Z="compress" gz="gzip" bz="bzip2"<br>Zout="/tmp/bestcompress.$$.Z"<br>
gzout="/tmp/bestcompress.$$.gz"<br>bzout="/tmp/bestcompress.$$.bz"<br>skipcompressed=1<br><br>if [ "$1" = "-a" ] ; then<br> skipcompressed=0 ; shift<br>fi<br><br>if [ $# -eq 0 ]; then<br>
echo "Usage: $0 [-a] file or files to optimally compress" >&2; exit 1<br>fi<br><br>trap "/bin/rm -f $Zout $gzout $bzout" EXIT<br><br>for name<br>do<br> if [ ! -f "$name" ] ; then<br>
echo "$0: file $name not found. Skipped." >&2<br> continue<br> fi<br> <br> if [ "$(echo $name | egrep '(\.Z$|\.gz$|\.bz2$)')" != "" ] ; then<br> if [ $skipcompressed -eq 1 ] ; then<br>
echo "Skipped file ${name}: it's already compressed."<br> continue<br> else<br> echo "warning: trying to 2x compress $name"<br> fi<br> fi<br> <br>
$Z < "$name" > $Zout &<br> $gz < "$name" > $gzout & <br> $bz < "$name" > $bzout &<br><br> wait # run compressions in paralell for speed. wait until all are done<br>
<br> smallest="$(ls -l "$name" $Zout $gzout $bzout | \<br> awk '{print $5"="NR}' | sort -n | cut -d= -f2 | head -1)"<br><br> case "$smallest" in<br> 1) echo "No space savings by compressing $name. Left as is."<br>
;;<br> 2) echo Best compression is with compress. File renamed ${name}.Z<br> mv $Zout "${name}.Z" ; rm -f "$name"<br> ;;<br> 3) echo Best compression is with gzip. File renamed ${name}.gz<br>
mv $gzout "${name}.gz" ; rm -f "$name"<br> ;;<br> 4) echo Best compression is with bzip2. File renamed ${name}.bz2<br> mv $bzout "${name}.bz2" ; rm -f "$name"<br>
esac<br><br>done<br>exit 0<br>