LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Root partition is full, what now? (https://www.linuxquestions.org/questions/linux-newbie-8/root-partition-is-full-what-now-306889/)

Joe Soap 03-28-2005 01:52 AM

Root partition is full, what now?
 
G'day Folks,

My root partition (6 G) is full. I'm in the process of deleting unnecessary files, but I would also like to move /usr, /home, /var, etc. to other disks in my machine. However, I do not know how to do this without potentially screwing up my set-up.

Can somebody tell me how to move these directories without losing any links, configuration or data? Can I just do a straightforward mv or not?

Thanks
Joe

z9_87 03-28-2005 02:05 AM

lol, wow I was just asking myself, what happens when my root partition becomes full? It's got 600MB left and while it may last a while I will need to make it bigger or move stuff sonner or later. On top of the same quesiont as of what to do when it's full as asked above, but why isn't it made bigger in the first place?

scuzzman 03-28-2005 02:35 AM

No - what you'll need to do is install another disk and partition it. then, using a LiveCD, tar up your /usr, and untar it to that partition that was created. Delete the /usr directory, then recreate it on your disk and in your /etc/fstab (so it's mounted on boot) and point it to the proper mount point.
If you need more help doing this, reply.

Psycho(Clan) 03-28-2005 02:40 AM

Server
 
Do you know what i must do when my server says Attempted to kill init at startup i can't login nothing works it will stop during the startup some1 help me????

scuzzman 03-28-2005 02:42 AM

Re: Server
 
Quote:

Originally posted by Psycho(Clan)
Do you know what i must do when my server says Attempted to kill init at startup i can't login nothing works it will stop during the startup some1 help me????
Please do not hijack threads. Your issue is being looked at in this thread and that's where it shall remain. It will be answered when someone comes along that is capable of answering it. Please, until then, remain patient.

Psycho(Clan) 03-28-2005 02:45 AM

Re: Re: Server
 
Quote:

Originally posted by scuzzman
Please do not hijack threads. Your issue is being looked at in this thread and that's where it shall remain. It will be answered when someone comes along that is capable of answering it. Please, until then, remain patient.
Ok if you say so but my server will not work untill then but ty for your info!

Itzac 03-28-2005 03:09 AM

You don't actually need to tar anything up.

Just create and format the partitions you want to move stuff to.

Next mount these. Now you have to copy the necessary files over. This is the tricky bit. You need to use the following copy command or stuff will screw up.

Code:

%cp -pRP /usr/* /mnt/new_usr/
as an example to copy the contents of /usr to the partition mounted at /mnt/new_usr. You'll need to run this as root. The -p flag tells cp to preserve permissions. The -R flag tells cp to copy directories recursively, and to do 'the right thing' with links and FIFOs and stuff. If you use -r instead of -R, there's no guarantee that links and such will be properly copied. The -R in theory asserts -P, but repetition never hurt anyone.

Finally, modify your fstab to mount the partition at boot, delete everything inside of /usr or whichever directory you're doing this with, and remount the new partition to the appropriate directory.

I just used this very procedure to move /usr to a different partition and It seems to have work perfectly.

Joe Soap 03-28-2005 03:46 AM

Thanks Itzac, scuzzman. I'll try your advice.

Thanks
Joe

PS: Damn fast replies :)

Joe Soap 03-28-2005 05:46 AM

Guys, a little more help here, please.

I've formatted a partition (/mnt/hda5) and I want to use this as my new /var partition. Itzac, according to your instructions, I should mount this as /mnt/hda5 and copy /var to it with the copy command you showed above, etc.

But how do I then address the new partition as /var? Some clarification would be much appreciated.

Thanks
Joe

scuzzman 03-28-2005 06:06 AM

What you'll want to do is this:
Mount it as /mnt/hda5
copy the data:
Code:

cp -pRP /var/* /mnt/hda5/
Now, delete /var/*
Code:

rm -rf /var/*
And just to be sure:
Code:

ls -aR /var
(should return nothing)
Now, unmount /mnt/hda5, and remount it on /var
then, change /etc/fstab to show the new drive mounted on /var

Note: be careful, but not paranoid, as as long as the data stays in place, it can be fixed with a Live CD (ie: if something doesnt get mounted right)

Orkie 03-28-2005 06:31 AM

I'm sure you already worked it out but just in case you didn't those commands should be run as root.

Joe Soap 03-28-2005 09:53 AM

Thanks scuzzman, much appreciated. /var has been successfully transferred to the new partition :)

Joe Soap 03-28-2005 12:19 PM

Dang, ran into a little snag...

I moved /usr and /home in the manner described above, changed fstab and rebooted. Now kdm won't start because it cannot find a shared library - libX11.so.6. However, this lib is in /usr/X11R6/lib/

I'm guessing that it won't be too difficult to fix - maybe just a symlink? Problem is, I don't know where to point the symlink to...

Any help will be appreciated.

Thanks
joe

Itzac 03-28-2005 01:13 PM

Is it possible the cp command copied the /usr part of the original paths to the new partition? That would make the path of any file in /usr look like /usr/usr/include/... The other possibility is that there's something wrong with your fstab, so that /usr isn't being properly mounted. Post it if you're not sure.

Also, did you navigate to the file in question or did you use locate to find it. The locate program keeps an index of the files in your filesystem, so the results it returns might not reflect the current state of the disk. Run updatedb as root to be sure.

Orkie 03-28-2005 01:13 PM

Check to make sure that /usr/X11R6/lib/ appears in /etc/ld.so.conf. This file is where the dynamic linker looks where it should find shared libraries such as this.


All times are GMT -5. The time now is 11:30 PM.