LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to move /var to other partition? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-move-var-to-other-partition-929692/)

sluge 02-16-2012 07:15 AM

how to move /var to other partition?
 
Hello! I tryed to move my /var to other partiton. (/dev/md0)
So, I
1) mkdir /newvar
2) mount /dev/md40 /newvar
3) cp -Rax /var /newvar
4) mv /var /oldvar
4) change fstab to mount /var to /dev/md40

So, after reboot I'got errors:
Calling the system activity data collector (sadc): Cannot open /var/log/sa/sa11: Permission denide

System logger [FAILED]

And system run at 1 runlevel, why?

bigrigdriver 02-16-2012 05:15 PM

Quote:

I tryed to move my /var to other partiton. (/dev/md0)
Quote:

2) mount /dev/md40 /newvar
Quote:

4) change fstab to mount /var to /dev/md40
So, which is the correct partition; /dev/md0 or /dev/md40?

sluge 02-16-2012 10:55 PM

Quote:

Originally Posted by bigrigdriver (Post 4604481)
So, which is the correct partition; /dev/md0 or /dev/md40?


sorry, it is md40

GlennsPref 02-22-2012 03:42 AM

I've found it difficult to move /var while the system is running with /var mounted.

What I have done is,

copy /var... to the new partition.

reboot using a live distro, like arch-linux, gparted or slax (I use gparted live cd (allows "make active boot" per HDD)).

edit the "/etc/fstab", changing the address of the relevant line (my system has multiple partitions, /var is one of them).

reboot.

then you may remove the data from the old /var "partition".

If it is just a directory, you'd be best off, doing a re-install with partitioning in mind.

Cheers, Glenn


All times are GMT -5. The time now is 03:31 AM.