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!
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've run out of space on my gentoo installed partition which specifically holds /var
I intend to move the folder into the maind drive under /
I have already created a folder in the main drive called /my/var into which ive copied all the files.
I was wondering if there is a was of mount /my/var as /var (as far as the computer can tell) so that it may give me time to delete the old partition on which /var originally resides so that i can create a new large partition onto which i will copy the /var back.
I have tried to use mount --bind /var /myvar
but doing an ls /var still points to the contents of the old folder.
Whenever I do fiddly stuff like that, I like to boot up a LiveCD. I'm not enough of a Linux expert to know when messing with /var or /tmp will break the OS out from under me. With a LiveCD, I'd just be messing with some non-OS files.
My latest experimentation has been with diskless net-booting. It's almost creepy, being able to shut down the client computer entirely and still have access to its OS files on the server.
Remember that you need to unmount /var before moving it around. Really, trying to do this stuff on a "live" system seems a bit foolhardy to me. I'd personally boot up a LiveCD like Knoppix to do this stuff.
But assuming you can mess with /var in a live system without breaking it, here are the steps you'll need to do:
Note that the existing /var folder should be empty (you use an empty directory to mark a mountpoint for another partition). Using "mv" to rename it rather than deleting it outright is merely an overly paranoid precaution.
The "ln -s" statement creates the symlink the correct way. The statement shown above has it the wrong way around. The example I give creates a new link in the position "/var", pointed at "/my/var".
Thanks gang, yes, a live CD is a much better idea. I did as you described and worked perfectly... hope 5 gb is enough for /var! lol if not then i'll resize (another new and heartstopping experience)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.