From owner-freebsd-questions@FreeBSD.ORG Fri Jan 6 04:30:35 2006 Return-Path: X-Original-To: freebsd-questions@www.freebsd.org Delivered-To: freebsd-questions@www.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB84F16A41F for ; Fri, 6 Jan 2006 04:30:34 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from skippyii.compar.com (www.compar.com [216.208.38.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67E0743D45 for ; Fri, 6 Jan 2006 04:30:34 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from hermes (CPE00062566c7bb-CM0011e6ede298.cpe.net.cable.rogers.com [70.28.254.189]) by skippyii.compar.com (8.13.1/8.13.1) with ESMTP id k064WqwP008638; Thu, 5 Jan 2006 23:32:53 -0500 (EST) (envelope-from matt@gsicomp.on.ca) Message-ID: <00ec01c6127a$0fb75120$1200a8c0@gsicomp.on.ca> From: "Matt Emmerton" To: "Darren David" , References: <43BDEF82.4060100@3x3x3.org> Date: Thu, 5 Jan 2006 23:31:26 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Cc: brett Subject: Re: Need help switching between two FreeBSD boot drives X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 04:30:35 -0000 > hi all- > > i've got one i've been tearing my hair out over here, and even after > finding some information out there, i'm still totally lost. this may > take a while to explain, so please bear with me. > > I've got 2 80GB SATA drives in my FreeBSD machine, which are mapped as > /dev/ad4 and /dev/ad6. I've got 5_STABLE installed on 1 drive, and my > plan is to get a working install of 6_STABLE on the other drive, so i > can take my time to work out the kinks with the upgrade on the 2nd drive > (it hasn't been straighforward) and be able to switch back to my working > 5_STABLE machine as needed. That's the plan, anyway. > > So I followed the general instructions here: > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/book.html#NEW-HUGE-DISK > > to clone drive 1 over to drive 2. very cool, no problems, i can pick > either drive in the bootloader and boot up there. so all is well and > good until i boot into drive 2 and start the upgrade process. I realize > the /dev/ad4 and /dev/ad6 are not exactly fixed. It seems almost > arbitrary which drive ends up mapped as /dev/ad6 and /dev/ad4, and this > caused me to nearly munge all of the data on the working 5_STABLE > install before i caught myself. If i boot into drive 1 at boot time, > everything ends up being mounted at /dev/ad6. If i mount into drive 2 at > boot time, the same thing happens. Mind you, i /did/ check /etc/fstab to > ensure that all was well, but i ended up with a weird situation where, > say, / would be /dev/ad4s1a and all of the other mountpoints were at > /dev/ad6*. ugh. confusing! > > I found this page, which explains the problem /somewhat/: > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install-steps.html > > but to be completely honest, the concept didn't stick. What i need help > with, since these drives are exactly the same size and make, is how i > can do the following: > > 1) determine the relationship between Drive 1/Drive 2 and ad4/ad6 > 2) determine exactly which physical drive i am working on at any given > time, since the /dev node mappings seem to be malleable Drive 0/Drive 1 always refer to the same devices, as FreeBSD ignores the BIOS mappings (which may change, as outlined in the above docs). These drive numbers are assigned based on physical controller/device numbering and addressing, and thus won't change unless you physically change device IDs or move cables around. However, once booted, FreeBSD, however, may assign different controller/disk IDs to the physical devices, depending on what order the devices are detected. Usually this is static, but in some cases, it is not. > 3) enable an environment where i can safely and surely boot into either > drive and know for a fact that the right partitions are mounted ( all of > the data on all of the partitions aside from / is mirrored, so it's > practically impossible to tell which drive is which ) Compile custom kernels on both systems that contain "options ATA_STATIC_ID". This will force the FreeBSD device names to always map to the same physical controller/drive number. > 4) (bonus points) My bootloader shows the following on boot: > > F1: FreeBSD > F2: FreeBSD > F5: Drive 1 > > a) I've only got 1 FreeBSD install on this drive, so what is F2? It just > beeps at me when i try it F2 represents a slice (in DOS terms, partition) on Drive 0 that is marked bootable. The reason you get a beep is because there is no boot loader on that slice. > b) I assume that "F5: Drive 1" means that the drive i'm staring at the > options for is Drive 2, adn that selecting F5 will toggle to Drive 1? Drivers are numbered from 0. So F1/F2 refer to bootable slices on Drive 0. Regards, -- Matt Emmerton