[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving /var



On Mon, Aug 27, 2001 at 08:09:15PM -0700, Jason Majors wrote:
> I currently have /var on hdc, but want to move it to sda. I've tried mounting
> the new partition as var2, copying the files, changing fstab, then rebooting,
> but lots of programs complain. I'd guess it has something to do with the state
> of var at the time of the copy, vs at the time of shutdown/boot. That method
> works well for home, usr, etc.
> Is there a good way to do this for var? other than reinstalling?
> Thanks.
> Jason

Definitely go into single user mode first (telint 1).  You don't want
processes writing to log files, spool files, etc... while you do the
migration.  When you're finished, your new partition should be mounted
as "/var /dev/sda?" or programs will certainly complain.

  1.  Go Single User
  2.  mount -t <ext2> /mnt /dev/sdaX
  3.  Copy files via your favorite method ("cp -a /var /mnt" should work).
  4.  umount /mnt
  5.  umount /var
  6.  Edit fstab to point /var at /dev/sdaX
  7.  mount /var (now on the new disk)
  8.  exit (go back to multi-user mode)
  
When moving partitions it's important to use a method that preserves
permissions.  Otherwise all hell can break loose... When your
comfortable with the transfer, reclaim the original /var for some other
use.

-- 
Eric G. Miller <egm2@jps.net>



Reply to: