From owner-freebsd-questions@FreeBSD.ORG Thu Mar 24 20:05:11 2005 Return-Path: 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 3426016A4CE for ; Thu, 24 Mar 2005 20:05:11 +0000 (GMT) Received: from mxsf28.cluster1.charter.net (mxsf28.cluster1.charter.net [209.225.28.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41CF343D48 for ; Thu, 24 Mar 2005 20:05:10 +0000 (GMT) (envelope-from pathiaki@pathiaki.com) Received: from mxip14.cluster1.charter.net (mxip14a.cluster1.charter.net [209.225.28.144])j2OK58tK011377 for ; Thu, 24 Mar 2005 15:05:08 -0500 Received: from cpe-68-184-36-187.ma.charter.com (HELO pc4.atlantisservices.com) (68.184.36.187) by mxip14.cluster1.charter.net with ESMTP; 24 Mar 2005 15:05:07 -0500 X-Ironport-AV: i="3.91,119,1110171600"; d="scan'208"; a="66187698:sNHT14520448" From: "Paul J. Pathiakis" To: freebsd-questions@freebsd.org, bob@a1poweruser.com Date: Thu, 24 Mar 2005 15:05:07 -0500 User-Agent: KMail/1.7.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503241505.07562.pathiaki@pathiaki.com> Subject: Re: What's an easy way to replace a drive? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2005 20:05:11 -0000 Hi, In the worse case scenario, you want to move a system drive. (If it's not a system drive, you get less steps.) This is for the NOVICE, I therefore suggest the sysinstall gui to do the lifting: (No, I use bsdlabel, fdisk, etc, but this is more simplistic and generates ease-of-use methodology.) 1) connect the drive to the system. (NOTE: if you are trying to do a system disk and you aren't familiar with bsdlabel, fdisk, etc., connect a single disk to the machine and boot the distro CD.) 2) use sysinstall to partition the drive correctly. (Tools are fdisk and bsdlabel.) Make sure you write an MBR and/or boot blocks to the drive. When creating the partitions, typically, make them look similar to the original. /, /usr, /var. (NOTE: if you have another drive connected to the system, sysinstall will try to create d: as the first partition on the new drive when you want it to be a: . That's why I suggest keeping only the new drive connected for now. Getting real familiar with bsdlabel and fdisk can get you around this as you mature as a system administrator.) 3) Write all the changes out to the drive from the partition editor. It will label the drive partitions and then newfs. (It will prompt you with: Are you sure you want to do this now? ) 4) At this point, you can shutdown and connect the system drive and bring up the system into single user mode on the initial drive. Create mount points like: /root2, /var2, /usr2 and mount the NEW drives partitions to them. Do a: mount -a to make sure all partitons on the system drive are mounted. 5) Now, use dump and restore to move everything over. This will, typically, be much faster than dd on a non-full drive. DD has to read everything. This method just moves the info on the disk. for example: cd /root2; dump 0af - / | restore xf - .... .... change permissions on . ? (or something like it) y cd /var2; dump 0af - /var | restore xf - etc. If you just want a simple method of backing up partitions to a file: (I use the mount points here for simplicity, /home could be replaced by /dev/ad0s1f or such.) cd ; dump 0af - /home | gzip > home.dump.gz dump 0af - /usr | gzip > usr.dump.gz without gzip... dump 0af home.dump /home later to restore, cd < new location > gunzip < //home.dump.gz | restore xf - without gzip.... restore xf //home.dump I tried to make this simple. P. On Thursday 24 March 2005 14:08, bob@a1poweruser.com wrote: > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Anthony > Atkielski > Sent: Thursday, March 24, 2005 1:58 PM > To: freebsd-questions@freebsd.org > Subject: Re: What's an easy way to replace a drive? > > Gary Smithe writes: > > May not be the best answer, but if the drive's data is still > > intact > > > (i.e. readable) and the replacement will be identical, maybe try > > DD or > > > similar from a bootable "rescue" cd, like freesbie? If not that, > > then > > > you may be able to copy the data between the 2 drives using same > > said > > > bootable CD after creating the partitions. > > Is it possible to dd the entire contents of one drive into a single > file > on another drive (assuming the latter drive is big enough)? If so, > I > could save time by just copying the drive wholesale to a huge file > on > another drive, replacing it, then copying everything back. Not sure > if > "whole drive" would include content outside the FS, though (?). > > -- > Anthony > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"