[Novalug] questions on re-assining /var and /tmp
Jon LaBadie
novalugml@jgcomp.com
Wed Nov 25 22:45:56 EST 2009
On Wed, Nov 25, 2009 at 09:19:08PM -0500, Bonnie Dalzell wrote:
>
> when I set this current harddisk up i made assignments of / /var and
> /tmp to separate partitions. I gave them much to much room and I would
> like to reassign /var /tmp to the / partition. Other than going through
> with a reinstall of the system from a CD, is there a straightforward way
> to reassign these?
>
The basic idea is to edit /etc/fstab and "comment out" the two
lines corresponding to /var and /tmp. Both these dir's already
exist in the (/) root file system. So when you boot the next
time, the root filesystem will start to be used for /tmp and /var.
HOWEVER, while you probably do not need the data currently in /tmp,
you will certainly need the data in /var. So you will have to copy
it over to the real /var directory. This will not be able to be
done on a booted system.
So shutdown and reboot from some live cd. Make some dirs to mount
the HD partitions, perhaps /r, /v, and /t for root, var and tmp.
Mount the file systems -- var and tmp on /v and /t could be mounted
read-only.
Copy all under /v to /r/var and if you want the current /tmp data,
all under /t to /r/tmp.
This would be a good time to edit the fstab file, it is now under
/r/etc/fstab. Creating a copy before editing would not be a bad
idea.
Do a sync or three to flush any cached data out to /r, and unmount
the three file systems.
Shutdown and reboot the real system.
I'm sure a lively discussion could be started as to what cmd(s)
to use to effect the filesystem copy. ;)
Jon
--
Jon H. LaBadie jon@jgcomp.com
JG Computing
12027 Creekbend Drive (703) 787-0884
Reston, VA 20194 (703) 787-0922 (fax)
More information about the Novalug
mailing list