LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-09-2009, 01:18 PM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558

Rep: Reputation: 34
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
 
Old 01-09-2009, 01:28 PM   #2
qlockheed
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
How did you "copy"? Linking structure and ownership etc under /var is very important.
 
Old 01-09-2009, 04:36 PM   #3
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
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: Reputation: 34
Thanks for your reply.

I copied from /var to /varnew with the cp command preserving all the attribuites.
 
Old 01-10-2009, 05:58 PM   #4
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
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: Reputation: 34
Just wondering if anyone has any idea how to resolve this issue/
 
Old 01-10-2009, 06:50 PM   #5
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
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.

Or you could create a symlink to free space with;
Quote:
ln -s /var /varnew
then old /var will be on the /varnew.
 
Old 01-10-2009, 06:52 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 01-10-2009, 07:51 PM   #7
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
In this thread I show how to do similar with /home.
 
Old 01-11-2009, 04:48 PM   #8
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
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: Reputation: 34
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
 
Old 01-11-2009, 06:21 PM   #9
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming Zmyrgel Linux - General 1 08-06-2006 07:59 AM
windows filesystems vs. linux filesystems irfanhab General 8 05-25-2004 07:21 AM
chaging directory names to lower case andy753421 Linux - General 2 05-11-2004 02:12 PM
renaming to lowercase locazor Linux - Software 1 01-02-2004 08:29 AM
chaging localhost.locadomain spyghost Linux - Software 2 11-01-2003 03:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration