Code: Select all
su
cp -rp /var /home/export/var
rm -rf /var
ln -sf /home/export/var /var
edit:
maybe i should explain
server had 3GB partition set as it's root drive
the other 247GB was pretty much all /home, apart from a partition for /tmp and a couple of others, i can't remember, and i can't be arsed to go df -u
so, anyway, where was i? oh yeh, root partition, the hosted site crashed. function errors on index. so i go grab index, look at the specified line number, trace back, find nothing, put a couple of debug echos in the function, upload the edited file. it fails, but overwrites the current copy with a zero byte file!
right, so i try again, on another couple of file
oops, same deal. rewritten, as empty files
some google search gives me a spurious link to mysql
so i restart mysql
it crashes, telling me no, fu, there's no diskspace for me to restart
finally i check the disk structure, and find that the root partition has something like 24kb free space
the fix?
evreything i searched for suggested a reinstall, partitioning the disk realistically. would have meant the rest of the services on the server would be lost, probably for a couple of days at least, until i had worked out how to do a net-install properly
i give up, rest of the server works ok, screw it
conscience get's me, so i carry on looking for an easy answer
found the above commands and thought fuck it, what is there to lose, and used them (rm -rf /var was scary)
they moved the main of my debian etch to a folder inside /home and / has plenty of running room now. server is back up and running nice and fast (of course i had to reinstall forums cos of the files i had mangled). everything smells rosy
disclaimer: if this fucks up your server for you, sorry, but it worked for me on debian etch. a reboot was required for mysql to recognise and use the /var symlink created tho