mpope
11-13-2001, 01:58 PM
Hello,
I am having a problem with a new server that I setup, and will pay someone to help me fix it. Here's the problem. I'm running out of disk space on the root partition. I have 1gig as the partition size, however I believe /usr is mounted on it, which is causing the problems.
The easy fix would be to move /usr to the /home (ie.. "/home/usr") directory and then sym link it back to /usr. Unfortunately I tried this, and it didn't work. :(
Here are the commands I used:
mkdir /home/usr
chmod 1777 /home/usr
ln -s /home/usr /usr
cd /usr
cp * -R /home/usr/
(I found the above in one of tim greer's posts, and I think it should work).
If someone has any suggestions for me, it would be great. If you think it is going to be very involved, I will cough up some cash for you. Please respond asap, as my root partition is 97% used.
Thanks!
cperciva
11-13-2001, 02:30 PM
I can help you here, but just to make sure I know where you're starting from, could you show me the output of `df` and `ls -l /`?
mpope
11-13-2001, 02:36 PM
Sure:
df
Filesystem 1k-blocks Used Available Use% mount
/dev/rd/c0d0p1 1011928 925276 35248 97% /
/dev/hda1 59107604 28 56105000 1% /backup
/dev/rd/c0d0p7 26391660 5242244 19808796 21% /home
/dev/rd/c0d0p5 7060276 83220 6618408 2% /var
ls -l /
drwxr-xr-x 22 root root 4096 Nov 12 04:13 ./
drwxr-xr-x 22 root root 4096 Nov 12 04:13 ../
drwxr-xr-x 3 root root 4096 Nov 10 22:57 backup/
drwxr-xr-x 2 root root 4096 Nov 8 20:50 bin/
drwxr-xr-x 2 root root 4096 Nov 12 09:53 boot/
drwxr-xr-x 14 root root 81920 Nov 9 02:23 dev/
drwxr-xr-x 40 root root 4096 Nov 13 08:27 etc/
-rw-r--r-- 1 root root 3 Nov 12 13:38 fsckoptions
drwxr-xr-x 112 root root 4096 Nov 13 04:06 home/
drwxr-xr-x 2 root root 4096 Jun 21 11:32 initrd/
drwxr-xr-x 7 root root 4096 Nov 8 20:49 lib/
drwxr-xr-x 2 root root 16384 Nov 8 12:23 lost+found/
drwxrwxrwx 2 root root 4096 Nov 13 09:37 mail/
drwxr-xr-x 2 root root 0 Nov 8 20:56 misc/
drwxr-xr-x 4 root root 4096 May 23 2000 mnt/
drwxr-xr-x 3 root root 4096 Nov 13 04:14 opt/
dr-xr-xr-x 106 root root 0 Nov 8 12:55 proc/
drwxr-xr-x 10 root root 4096 Nov 13 04:09 root/
drwxr-xr-x 3 root root 4096 Nov 9 02:26 sbin/
drwx------ 3 root root 4096 Nov 12 11:01 scripts/
lrwxrwxrwx 1 root root 9 Nov 12 04:13 tmp -> /home/tmp/
drwx------ 2 root root 4096 Nov 13 10:07 update/
drwxr-xr-x 18 root root 4096 Nov 9 02:12 usr/
drwxr-xr-x 23 root root 4096 Nov 10 23:23 var/
hmmm.. this board makes the output hard to read... but you get the idea.
Thanks!
cperciva
11-13-2001, 02:53 PM
Ok, assuming that /usr is the big space-consumer here (`du -sx` should show /usr taking up more space than other directories) you probably want to:
rm -rf /home/usr
cp -Rp /usr /home/usr
mv /usr /usr.old
ln -s /home/usr /usr
*reboot now*
rm -rf /usr.old
To explain:
rm -rf /home/usr makes sure that there isn't anything where you're going to be putting the /usr directory
cp -Rp /usr /home/usr copies the /usr hierarchy into /home/usr while preserving permissions
mv /usr /usr.old moves /usr out of the way so that you can create a symlink while not removing any possibly open files. (if you just delete /usr now you could run into problems with libraries.)
ln -s /home/usr /usr creates a symlink.
rebooting will make sure that there aren't any open files from the old hierarchy, after which you can safely rm -rf /usr.old to free up the disk space.
creid
11-13-2001, 04:14 PM
Did you install Linux?
Or did the Dedicated company?
Chris
mpope
11-13-2001, 05:57 PM
I installed it. I tried to put in a /usr partition, however diskdruid would not let me. (Because I needed a /backup partition on hda)
Looking back, I should have increased the / partition by a couple of gigs, but hindsight is 20/20 ...
I haven't been able to implement your suggestions... I'll probably get around to it in an hour. I'll keep you posted!
<edit> I'm going to wait untill later tonight to implement this, b/c this is a live server. I'll let you know later how it goes. </edit>
Thanks!
Chicken
11-13-2001, 08:51 PM
Originally posted by mpope hmmm.. this board makes the output hard to read... but you get the idea.
I fixed some of the formatting, though it screwed up the top part (DOH), but it is better than before.
mpope
11-14-2001, 05:07 AM
Hey, thanks chicken!
cperciva - thanks for your help. It worked like a charm! I now only have 25% of the root partion being used.
-mpope
hennaboy
12-21-2001, 05:55 AM
Oh tha mans a genuis!
Great thread guys i just got my partition down from 81% to 7%
Happy holidays!!!