From owner-freebsd-questions Fri Nov 15 8:52:46 2002 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 9C5EA37B401 for ; Fri, 15 Nov 2002 08:52:43 -0800 (PST) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9412943E42 for ; Fri, 15 Nov 2002 08:52:42 -0800 (PST) (envelope-from hymette@wanadoo.fr) Received: from mel-rta10.wanadoo.fr (193.252.19.193) by mel-rto4.wanadoo.fr (6.5.007) id 3DA24D32016F5D75; Fri, 15 Nov 2002 17:52:37 +0100 Received: from wanadoo.fr (80.13.39.236) by mel-rta10.wanadoo.fr (6.5.007) id 3DD0D46B002A2EB3; Fri, 15 Nov 2002 17:52:37 +0100 Message-ID: <3DD5284E.3080708@wanadoo.fr> Date: Fri, 15 Nov 2002 18:01:02 +0100 From: hymette@wanadoo.fr User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021108 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jerry McAllister Cc: freebsd-questions Subject: Re: How to backup a disk ? References: <200211151558.gAFFwE325204@clunix.cl.msu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Thank you for this note. Actually as I had a previous version of FreeBSD on the small disk but not the same partitions I thought that I could use: # cd big-disk-partition # pax -rwX . /mnt/small-disk-folder to copy each of my partitions, and then edit the fstab on the small disk properly. This would avoid me the disklabel steps. But would it work ? My intention is not to backup the whole system on a regular basis, instead I 'd like to have the small disk to serve as repair tool in case of crash with one partiton dedicated to backup documents. What do you think ? Jerry McAllister wrote: >First, I am presuming there is nothing you want to save on the small disk >(or you have already preserved it somewhere). > >While booted to FreeBSD >Used fdisk(8) to create one large FreeBSD slice on the small disk. > fdisk -IB da1 (or ad1 or whatever device the disk is) >will slice the disk and put a standard boot sector on it. >Then use disklabel(8) to initialize the slice and add boot blocks > disklabel -w -r -B da1s1 (or ad1s1 or whaever) >Then use disklabel to edit the partition table on the slice >Look at what you already have to figure out appropriate sizes. > disklabel -e -r da1s1 (ad1s1 or watever) > add the partitions as needed. Note the size is in 512 byte blocks > Put '*' in for offset for all but partition a: and c: so disklabel > will calculate offset for you. For a: and c: put in '0'. > Take the defaults for fsize (1024) bsize (8192) and bps/cg unless you > really want to play with that. > Omit the comments at the end of the line after #. > Partition c: is the whole slice and is type 'unused' > partition b: will probably be swap and is type 'swap' > The remaining partitions will be files systems and type '4.2BSD' >Finally, run newfs on the newly created partitions, something like: > newfs -b 8192 -f 1024 /dev/rda1s1a (or Rad1s1a or whatever) > "" "" "" "" "" e > etc > Don't newfs the swap partition or the c: partition > >Make mount points for the new partitions > cd / > mkdir newpa > mkdir newpe > etc > >Edit fstab to add entries for the new partitions and mount them >/dev/da1s1a /newpa ufs rw 2 2 >/dev/da1s1e /newpe ufs rw 2 2 > etc > >mount -a > >or just manually mount them > >mount /dev/da1s1a /newpa >mount /dev/da1s1e /newpe > etc > >Now you can dump restore > cd /newpa > dump 0af - / | restore rf - > cd /newpe > dump 0af - /prev_e_mount_pt | restore rf - > etc > >Now, shutdown your system, swap the drives and reboot. >If you made the partitions identical (in name eg a,b,e,f,etc, not size) >and edited /etc/fstab before dumping root then it should all come up >with running on the new smaller disk and with the old large disk >mounted on the /newpa, /newpe, etc mount points. > >Note that everything but the dump /restore can be done ahead of time. >If you are really worried about losing some thing, you will want to >do the dump/restore part in single user mode. >So, after getting all the partitions made and editing /etc/fstab. >Shutdown/reboot, come up in single user mode. >Then do > fsck -p > mount -u / > mount -a or maybe mount -a -t ufs,nonfs if you have nfs mounts in fstab > swapon -a >Then do the dump/restore operations as indicated above. >Then, shut down, sap drives and reboot. > >////jerry > > > >>Thank you in advance. >> >> >> > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message