Hi all, I want to move /var /tmp and swap to partitions on a second disc. Swap and /tmp is easy, but how do I move the contents of /var without screwing up any permissions? If I just do mv * /var will it mess anything up? Thanks Hans
On Sat, 1 Nov 2003, H du Plooy wrote:
I want to move /var /tmp and swap to partitions on a second disc. Swap and /tmp is easy, but how do I move the contents of /var without screwing up any permissions? If I just do mv * /var will it mess anything up?
mv * /var shall put all from your current dir into var [which you may not be able to do as non-root]. Is this what you wanted to do? May be a better thing to try would be to boot off rescue system, create a new partition on your second/new disc, create a tar of existing /var man tar [to be more sure for preserving attribs/permissions etc. Hope you are not actively using ACLs] tar cvpf var.tar /var should to do the trick. After this has moved, do a ... tar xvf var.tar in your var directory. In the simplest case, using a rescue system and doing an mv properly would work. rohit ********************************************************* Disclaimer This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. ********************************************************* Visit us at http://www.mahindrabt.com
On Saturday 01 November 2003 06:16, H du Plooy wrote:
Hi all,
I want to move /var /tmp and swap to partitions on a second disc. Swap and /tmp is easy, but how do I move the contents of /var without screwing up any permissions? If I just do
mv * /var
Try this. Mount your new var partition Go into single user mode as root cd / var cf - /var | (cd /newvar; tar xf -) umount both partitions mount /newvar as /var Do whatever you like with your new partition :-) brian -- Brian Jackson http://www.BrianJacksonPhoto.com http://www.ActionAthletics.com http://www.sportsshooter.com/brian
On Sat, 01 Nov 2003 16:16:49 +0200
H du Plooy
I want to move /var /tmp and swap to partitions on a second disc. Swap and /tmp is easy, but how do I move the contents of /var without screwing up any permissions?
I used F6 in MC when I did that. Charles -- "World domination. Fast" (By Linus Torvalds)
The Saturday 2003-11-01 at 16:16 +0200, H du Plooy wrote:
I want to move /var /tmp and swap to partitions on a second disc.
Read the partitioning chapter in the admin book. There is also a howto, hard disk upgrade or some thing that applies to your question exactly.
Swap and /tmp is easy,
SuSE 7.1 had problems if /tmp was separate, because some yast scripts moved files creating hardlinks of them; this doesn't work across partition, so they failed. I suppose this has been ironed out, but you should be aware of that possibility. -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
let's just generalize this to moving an active directory to another file
system. /var is problematical because it contains logs, spools, utmp,
wtmp and other important active files. Most Unix systems maintain /var
as a separate file system for this reason. In any case, the best way to
move /var and other active directories is to first allocate the
partition for the new file system, using either the SuSE partitioner, or
some other product. Once this is done, you can shut down to single user
mode. (I recommend booting the rescue for moving /var). Then mount the
new file system somewhere (eg /mnt). Then using the recursive copy, (eg.
cp -R), copy the contents of the old /var to the new /var.
Then the next thing I do is to rename the old /var and create a new
empty /var directory. Then update /etc/fstab to mount the new partition
on /var. By renaming the old /var, you will still have access to the old
contents.
The reason to shut down to single user mode is that many of the files in
/var are used by daemons, and both utmp and wtmp are writen to by
/sbin/init as well as by login, telnet and other login programs.
- --
Jerry Feldman
Thanks to all who replied. Operation was successfull. I moved both /var and /tmp and swap to the second disc and it made a nice difference! Thanks Hans
participants (6)
-
brian jackson
-
Carlos E. R.
-
Charles Philip Chan
-
H du Plooy
-
Jerry Feldman
-
Rohit