From owner-freebsd-questions Fri Apr 30 9:12: 8 1999 Delivered-To: freebsd-questions@freebsd.org Received: from voyager.fisicc-ufm.edu (ip-46-094.guate.net [200.12.46.94]) by hub.freebsd.org (Postfix) with ESMTP id 6E3631526D for ; Fri, 30 Apr 1999 09:08:25 -0700 (PDT) (envelope-from obonilla@voyager.fisicc-ufm.edu) Received: (from obonilla@localhost) by voyager.fisicc-ufm.edu (8.9.3/8.9.3) id KAA01751; Fri, 30 Apr 1999 10:07:42 -0600 (CST) (envelope-from obonilla) Date: Fri, 30 Apr 1999 10:07:42 -0600 From: Oscar Bonilla To: Graeme Tait Cc: freebsd-questions@FreeBSD.ORG, info@boatbooks.com Subject: Re: Moving OS to a new disk Message-ID: <19990430100742.B648@fisicc-ufm.edu> References: <19990430175241.A22708@relay.ucb.crimea.ua> <3729F55A.7E06@echidna.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <3729F55A.7E06@echidna.com>; from Graeme Tait on Fri, Apr 30, 1999 at 11:24:26AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Apr 30, 1999 at 11:24:26AM -0700, Graeme Tait wrote: > I have a system (2.2.8S/CAM) in which the primary hard drive has become > flaky (it powers itself down periodically). This drive contains all the > OS. > > I have a second identical drive, and my thought to ease replacement is to > install the second drive as da1 (SCSI ID 1; the existing drive is da0/ID > 0), partition it identically, and transfer everything from the old drive. > I'd then remove the old drive, and jumper the new drive as SCSI ID 0 and > have it appear as da0. > perfect. > > Do I need to change the disklabel on the new drive or do anything else in > changing the SCSI ID - that is, is the device name embedded in the label, > etc.? > all you need to do after you've copied the filesystems is install the boot blocks. you should use disklabel for that. > > What is the best way to make a literal copy of the old drive on the new? > I've found that tar doesn't copy all the device nodes properly (it says > "minor number too large; not dumped" for many devices). I'm assuming I > would temporarily mount the new drive as say /new and so the root > filesystem would have to be transferred to /new , etc. > > tar is just the wrong tool for that. use dump(8) and restore(8). here's what i would do: 1. configure the drive blah blah and make it appear as da1 2. use fdisk to partition the drive (check out the -f option) 3. use disklabel to make the slices 4. newfs for all the new slices 5. mkidr /mnt/root /mnt/usr /mnt/var etc 6. (cd /mnt/root; dump 0f - / | restore rf -) (cd /mnt/usr; dump 0f - /usr | restore rf -) etc 7. umount all the stuff in /mnt 8. disklabel again to transfer the boot blocks (/boot/boot1 and /boot/boot2) 9. swap drives and reboot. 10. email the list again if it doesn't work (i might have missed a step :) regards, -Oscar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message