From owner-freebsd-questions Tue Jun 12 10:43:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tethys.valhalla.net (tethys.valhalla.net [195.26.32.112]) by hub.freebsd.org (Postfix) with ESMTP id 8012837B407 for ; Tue, 12 Jun 2001 10:43:25 -0700 (PDT) (envelope-from mark.drayton@4thwave.co.uk) Received: by tethys.valhalla.net (Postfix, from userid 500) id 63887340CA; Tue, 12 Jun 2001 18:43:24 +0100 (BST) Date: Tue, 12 Jun 2001 18:43:24 +0100 From: Mark Drayton To: freebsd-questions@freebsd.org Subject: Re: How to Restore /var Tree? Message-ID: <20010612184324.A11577@tethys.valhalla.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <5CD46247635BD511B6B100A0CC3F0239259F88@ldcmsx01.lc.ca.gov> <200106121724.NAA01883@scraemondaemon.my.domain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106121724.NAA01883@scraemondaemon.my.domain>; from ipthomas_77@yahoo.com on Tue, Jun 12, 2001 at 01:24:26PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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