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.
First you could see what is using /var in one way or the other with;
Code:
lsof +D /var/
then you will need to kill those processes.Do this in the run level 1.Name your new partition /var but mount it when you have copied everything from the old /var.Your new partition should be mounted in a /whatever and you should copy contest of the old /var there.Then unmount old /var and /whatever and mount new /var.
Do it from a liveCD. You'll be missing some logs, so it might be worthwhile doing the copy again (also from the liveCD) to ensure you have everthing. Clean up fstab while you're at it.
As you say it's a separate partition, you can clean up the old anytime after that.
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558
Original Poster
Rep:
Thanks Junior Hacker.
I followed the post you suggested and it it worked up to #7.
I was logged in and did an 'su' to get into root.
When I tried to execute the 'rm' command as in #7 I got the following:
rm: cannot remove diectory '/var': Device or resource busy.
I rebooted and went to failsafe move, retried the command in runmode 5 and it didn't work there so I tried runmode 1 and that also didn't work. I did a 'ps -ef' and even in failsafe mode I see a whole lot of processes running and I'm sure that some are accessing the /var filesystem.
Is there anyway around this?
How can I boot into runmode 1? Would that resolve the issue and not start up these processes at boot time?
Using Suse 11.0
As root or sudo, or single user mode:
1: #mkdir /mnt/newhome
2: #fdisk -l (to find device name of partition)
3: #mount -t ext3 /dev/???? /mnt/newhome (replace check marks in /dev/xxxx as per output of fdisk -l command)
4: #cd /home
5: #cp -ax * /mnt/newhome
6: #cd /
7: #rm -fr /home
8: #umount /mnt/newhome
9: #mv /mnt/newhome /home
10: #vim /etc/fstab (edit /etc/fstab with favorite editor if not vim, and add line below with proper /dev/xxxx)
11: /dev/???? /home ext3 defaults 1 2
12: re-boot
Maybe the drives/partitions need to be unmounted to move /var, which means you might want to try from another running Linux or live CD that will allow writing to a drive.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.