Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2001 18:43:24 +0100
From:      Mark Drayton <mark.drayton@4thwave.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to Restore /var Tree?
Message-ID:  <20010612184324.A11577@tethys.valhalla.net>
In-Reply-To: <200106121724.NAA01883@scraemondaemon.my.domain>; from ipthomas_77@yahoo.com on Tue, Jun 12, 2001 at 01:24:26PM -0400
References:  <5CD46247635BD511B6B100A0CC3F0239259F88@ldcmsx01.lc.ca.gov> <200106121724.NAA01883@scraemondaemon.my.domain>

next in thread | previous in thread | raw e-mail | index | archive | help
Ian P. Thomas (ipthomas_77@yahoo.com) wrote:
> In the last episode, Drew Tomlinson stated...
> > 
> > I made a major "booboo".  In an attempt to move my /var file system
> > (is this the right term?) I deleted it.  This 4.3 machine was built
> > recently and I hadn't implemented a backup strategy yet.  So, is
> > there a way to rebuild the default /var file system from source
> > without rebuilding the entire system or doing it all by hand?  I
> > might do it by hand but I don't know what the layout is and I don't
> > have another machine to look at.  Any advice or suggestions other
> > than not to delete /var in the first place and do backups?  :)
> 
> There is a directory called mtree that has the generic layout of all
> the base file systems.  I think it's in /etc.

Please note I haven't tried this in the root directory - I tried it in a
subdirectory and it seemed to work fine. YMMV etc.

mkdir /var
cd /var
mtree -du -f /etc/mtree/BSD.var.dist

This will recreate all the directories in /var, complete with proper
ownerships and permissions from a specification stored in /etc/mtree.
Obviously it won't restore your data...

Cheers,

-- 

Mark Drayton

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010612184324.A11577>