Renaming / Chaging Filesystems
I ran out of space in my /var parition.
I created a new partition called /varnew and is is in the fstab file. I copied everything from /var into the /varnew filesystem. Now I would like to get rid of /var and rename /varnew to /var. I'm a newbie and don't know how to go about resolving this issue. Any help and some detailed instructions would be greatly appreciated. Thanks Suse 11.0 |
How did you "copy"? Linking structure and ownership etc under /var is very important.
|
Thanks for your reply.
I copied from /var to /varnew with the cp command preserving all the attribuites. |
Just wondering if anyone has any idea how to resolve this issue/
|
First you could see what is using /var in one way or the other with;
Code:
lsof +D /var/ Or you could create a symlink to free space with; Quote:
|
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. |
In this thread I show how to do similar with /home.
|
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.
|
All times are GMT -5. The time now is 04:55 AM. |