From owner-freebsd-questions Thu May 30 7:52:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from sage-one.net (adsl-65-71-135-137.dsl.crchtx.swbell.net [65.71.135.137]) by hub.freebsd.org (Postfix) with ESMTP id 36F2937B40C for ; Thu, 30 May 2002 07:52:01 -0700 (PDT) Received: from SAGEONE (sageone [192.168.0.5]) by sage-one.net (8.11.6/8.11.6) with SMTP id g4UEpR814155; Thu, 30 May 2002 09:51:29 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20020530095125.01c537a8@mail.sage-one.net> X-Sender: jackstone@mail.sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Thu, 30 May 2002 09:51:25 -0500 To: Jim Durham , "a.s.gruner" From: "Jack L. Stone" Subject: Re: copy a harddrive and run that one Cc: In-Reply-To: References: <20020525171822.A856@encephalon.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 At 12:10 AM 5.30.2002 -0400, Jim Durham wrote: >On Sat, 25 May 2002, a.s.gruner wrote: > >> Hi. >> >> I have a running freebsd 4.6-RC on my IDE harddrive. >> Now i want to switch to an other harddrive, with the same size, but not >> IDE, its a SCSI harddrive. >> My question is very easy. How can i switch my running system, with all >> my installed ports, the updates (i installed 4.0 on the IDE harddrive >> and now i have 4.6RC running), and so on, to the SCSI harddisk ? >> Is there a way to copy the partitions ? >> Or, if not, what is the best way ? Just install a new FreeBSD System on >> my new SCSI device and copy the ports tree and /usr/src from the old IDE >> to the new SCSI (also the /home ), and try to build a new system with >> the sources i copied ? >> Thanks. >> > >If they were both IDE, you could simply put both drives in the >machine and dd the original to the new one > >I *think* this would work OK with IDE to SCSI, but I've never >done it. Let's say you had ad0 and da0 as the two drives. >You would simply do "dd if=ad0 of=da0 bs=8096" . This will >do an "image copy", making the partitions and everything. The >2nd drive *must* be as large as the first. If it's a little bigger, >that's OK , but you'll not use the "extra" part. > >Also, here's something that will work with any drive, but it's a little >tricky. First create 3 directories on the 1st drive's root partition >called slash, newvar and newusr. Run /stand/sysinstall with both drives in >the machine. Then choose "Custom Installation". Run "Partition", choosing >the SCSI drive as the one you want to perform the operations upon. >Usually, you want to choose the whole disk, then type "Q" and say >"Yes" to the boot manager question. Then run "Label" and choose >partitions to match the sizes of your / , /var and /usr partitions on >the old drive. Mount them as /slash, /newvar and /newusr . Be sure >to also make a swap partition. Then type "W" instead of "Q" to leave >the "Label" menu. You will be asked if you want to continue. Say >"Yes" and the new drive will be 'fsck'd' and mounted. Exit SysInstall. > >Now, cd to /slash and do " dump 0 -f - / | restore -r -f - ", >cd to /newvar and do " dump 0 -f - /var | restore -r -f - " and >then cd to /newusr and do " dump 0 -f - /usr | restore -r -f - " . > >If it's easier, you can also use "rsync" from ports to copy >the partitions. You need something that will create special files >correctly. > >Now, edit /slash/etc/fstab so that the devices are correct, remove >the IDE drive, make the SCSI the boot drive and reboot. > >The first option would be far easier, of course, but the drive >sizes need to match, with the SCSI being no smaller. > >Hope this helps. I may have forgotten something because it's been >a while since I did this last. > >Hope this helps, > >Jim Durham "...Now, edit /slash/etc/fstab so that the devices are correct, remove the IDE drive, make the SCSI the boot drive and reboot...." Hi, Jim: An interesting way. Specifically don't you rename "/slash" to "/" and mv the "new' from the other directories too...?? .... our website: http://www.sage-one.net/ Best regards, Jack L. Stone Server Admin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message