From owner-freebsd-questions@FreeBSD.ORG Tue Jul 5 17:12:13 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E22B16A41C for ; Tue, 5 Jul 2005 17:12:13 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out4.blueyonder.co.uk (smtp-out4.blueyonder.co.uk [195.188.213.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1202443D48 for ; Tue, 5 Jul 2005 17:12:12 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [82.41.37.55] ([82.41.37.55]) by smtp-out4.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Tue, 5 Jul 2005 18:12:53 +0100 Message-ID: <42CABF6A.7010400@dial.pipex.com> Date: Tue, 05 Jul 2005 18:12:10 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.8) Gecko/20050530 X-Accept-Language: en, en-us, pl MIME-Version: 1.0 To: Jerry McAllister , gjbailey@gmail.com References: <200507051436.j65EaAnM021408@clunix.cl.msu.edu> In-Reply-To: <200507051436.j65EaAnM021408@clunix.cl.msu.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Jul 2005 17:12:53.0881 (UTC) FILETIME=[C7DE0690:01C58184] Cc: freebsd-questions Subject: Re: Dump & Restore to smaller partition X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 17:12:13 -0000 Jerry McAllister wrote: >>Hello, >> >>Does anyone know if the dump and restore method for >>moving a partition to a new disk requires the destination >>partition to be as big or bigger that the source? >> >> > >It will need to be big enough to contain all the data. >It the old file system had a lot of empty (unused) space then >the new one can be smaller by about the amount of space >that was unused.. > > > >>>From my understanding, the whole partition, including >>blank space will be dumped and restored. If this is the >>case then the destination will need to be at least as big. >> >> > >Only the files (directories are also files) get dumped. It >does not dump the filesystem as it was newfs-ed. Rather it >makes a list of all the files & directories by inode number and >then dumps each along with all ownership, permission, flag and >link information. > > > >>My situation is as follows: >>I have a 30GB usr partition with about 10GB of data in it. >>I want to move this data (flags and all!) to a new 20GB >>usr partition. >> >>Will dump/restore do this? .. or what should i use? >> >> > >No problem. > >After making the new partition with disklabel and making a filesystem >out of it with newfs. Presuming your old 30 GB filesystem is mounted >as /fsa and the new 20 GB filesystem is mounted as /fsb, > > dump 0af /fsa/fsa.dump /fsa > cd /fsb > restore rf /fsa/fsa.dump > >should work just fine - although it makes me nervous to put the >dump file in the same filesystem you are dumping. Since it makes >the inode list before it starts dumping and creating the dump file, >it should work. It just feels weird. So, if you have some other >place to put a 10 GB dump file, then go ahead and use it instead. > > Just do it with pipes: dump -0af - /fsa | (cd /fsb; restore -rf -) Obviously /fsb must be mounted when you do this. If you feel paranoid and don't mind it taking longer dump -0af - /fsa | (cd /fsb; restore -ivf -) will do the restore in interactive mode, allowing you to quit if you make a mistake e.g. you see the cd failed. It would also let you select only a subset of files to restore. Specifying -b 64 to dump and restore might make it go quicker. And if this is a mounted UFS2 partition then dump should also take -L so it makes a checkpoint. --Alex