View previous topic :: View next topic |
Author |
Message |
ferp2 Tux's lil' helper
Joined: 13 Aug 2002 Posts: 104
|
Posted: Thu Sep 16, 2004 5:48 pm Post subject: SOLVED: No space left on root partition |
|
|
When I installed Gentoo nearly 2 years ago, I never thought my partitioning scheme would come back to bite me. Now everytime I want to install a program I'm wondering if I'll get the familiar "Not enough space on this disk".
Here's a look at the hard disk usage:
Quote: | ->> df -mh /
Filesystem Size Used Avail Use% Mounted on
/dev/hda6 1.9G 1.9G 53M 98% /
->> df -mh /var/
Filesystem Size Used Avail Use% Mounted on
/dev/hda7 863M 211M 652M 25% /var
->> df -mh /usr/local
Filesystem Size Used Avail Use% Mounted on
/dev/hda8 2.4G 35M 2.4G 2% /usr/local
df -mh /home/
Filesystem Size Used Avail Use% Mounted on
/dev/hda9 1.9G 309M 1.6G 17% /home
|
As you can see I've run out of space on the root partition, while in the meantime I have tons of space on /usr/local.
I'm wondering if there's a simple way to combine the root partition and the /usr/local partition together.
Any suggestions would be greatly appreciated.
Last edited by ferp2 on Thu Sep 16, 2004 11:02 pm; edited 1 time in total |
|
Back to top |
|
|
Tsonn Guru
Joined: 03 Jun 2004 Posts: 550
|
Posted: Thu Sep 16, 2004 6:02 pm Post subject: |
|
|
Well, assuming your partitions are layed out on disk in th obvious way, they have hda7 directly inbetween them. So there's no way to combine them without recreating that, too.
I would suggest scrapping the idea of having a /usr/local partition; just copy the files that are on it into hda6/usr/local. Then you have a 2.4Gb partition which you can use to relieve the load on the root partition. One way to do this would be to use it to hold the entire /usr directory.
If you have a kernel which support mount --bind you could be more specific and use it to hold a selection of folders from hda6... _________________ If your question was answered, please edit the first post and add [SOLVED] to the title. Thanks! |
|
Back to top |
|
|
ferp2 Tux's lil' helper
Joined: 13 Aug 2002 Posts: 104
|
Posted: Thu Sep 16, 2004 10:05 pm Post subject: |
|
|
OK, I went ahead and did the following to free up space on the root partition.
I'm in single-user mode for all of this:
Code: | mkdir /usr/new_local
cd /usr/local
cp -ax * /usr/new_local
umount /dev/hda8 /usr/local
mkdir /mnt/new_usr
mount /dev/hda8 /mnt/new_usr
cd /mnt/new_usr
rm -rf *
cd /usr
cp -ax * /mnt/new_usr
cd /
mv /usr /usr.old
ln -s /mnt/new_usr /usr
cd /mnt/new_usr
mv new_local local
|
Then I did the following in fstab:
Code: | vim /etc/fstab
/dev/hda8 /mnt/new_usr ................................
|
I did a reboot and everything seems fine, except for the following when logging in:
-bash : /usr/bin/whoami : No such file or directory
-bash : [: =: unary operator expected
I did a little searching around in the forums and found that a number of symbolic links found in /usr/bin are no longer linking properly to /bin as follows:
->> ls -l /usr/bin/who*
lrwxrwxrwx 1 root root 13 Sep 16 16:17 /usr/bin/who -> ../../bin/who
lrwxrwxrwx 1 root root 16 Sep 16 16:18 /usr/bin/whoami -> ../../bin/whoami
If I do:
->> cd /usr/bin
->> ls ../../bin/whoami
ls: ../../bin/whoami: No such file or directory
OTOH if I do:
->> cd /usr/bin
->> ls ../../../bin/whoami
../../../bin/whoami
So it works but I have to go up 3 directories instead of 2.
This is strange. If I do:
cd /usr (/usr is now a symbolic link to /mnt/new_usr)
Then if I do
ls ../
I get the contents of /mnt.
Does anybody know how to correct this?
Thanks |
|
Back to top |
|
|
einheitlix Tux's lil' helper
Joined: 03 Aug 2004 Posts: 144 Location: Saarbrücken, Germany
|
Posted: Thu Sep 16, 2004 10:21 pm Post subject: |
|
|
Of course, as your /usr is actually /mnt/new_usr, so your /usr/bin is actually /mnt/new_usr/bin, thus you have to go up three directories instead of only two.
I can think of several solutions for this, but the cleanest and easiest one would be if you didn't make the mountpoint at /mnt/new_usr and have a symbolic link from /usr to /mnt/new_usr, but rather simply make the mountpoint at /usr directly. And you could erase the directory /mnt/new_usr, because it would be useless then.
In other words:
Code: |
umount /mnt/new_usr
rm -rf /mnt/new_usr
rm -f /usr
mkdir /usr
mount -t auto /dev/hda8 /usr
|
And change in your fstab:
Code: |
emacs /etc/fstab
/dev/hda8 /usr ................................
|
Why make it complicated when it can be done simply? |
|
Back to top |
|
|
Tsonn Guru
Joined: 03 Jun 2004 Posts: 550
|
Posted: Thu Sep 16, 2004 10:23 pm Post subject: |
|
|
Hmm. Why not mount /dev/hda8 directly on /usr? _________________ If your question was answered, please edit the first post and add [SOLVED] to the title. Thanks! |
|
Back to top |
|
|
ferp2 Tux's lil' helper
Joined: 13 Aug 2002 Posts: 104
|
Posted: Thu Sep 16, 2004 11:04 pm Post subject: |
|
|
Thanks, it's always nice to have someone point out the solution that's staring me in the face. |
|
Back to top |
|
|
|