Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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?
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.
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.
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!
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.
%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.
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.
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.