Date: Fri, 15 Nov 2002 18:01:02 +0100 From: hymette@wanadoo.fr To: Jerry McAllister <jerrymc@clunix.cl.msu.edu> Cc: freebsd-questions <freebsd-questions@FreeBSD.ORG> Subject: Re: How to backup a disk ? Message-ID: <3DD5284E.3080708@wanadoo.fr> References: <200211151558.gAFFwE325204@clunix.cl.msu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DD5284E.3080708>