From owner-freebsd-questions@FreeBSD.ORG Mon Aug 24 18:40:07 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5CAA1065691 for ; Mon, 24 Aug 2009 18:40:07 +0000 (UTC) (envelope-from tajudd@gmail.com) Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.211.202]) by mx1.freebsd.org (Postfix) with ESMTP id 9F09D8FC08 for ; Mon, 24 Aug 2009 18:40:07 +0000 (UTC) Received: by ywh40 with SMTP id 40so3656083ywh.14 for ; Mon, 24 Aug 2009 11:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Od2tdjTnVDLUPXTos7GIL5qQ24JIEFHwQyrubkdD+Dw=; b=tBwR+dgh0LEsgsGK8lctSK778Q7SA4eb+stpjknf8hH1XivcNh+C6NkCIa+Gdf6O30 +nY20KhQfA5yTeSodxnmZsQbJN1IX88q7pN4F3KfyULwRAMdZ6sxwnnUJEPcUx/PMbt6 DYyFBJtrw8oEoHZKVmmPhmulqfPDTwc/wC/2c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=XZvR4O8K9rZAi/P70LXb9J8fKcthhOZYCbrEQcQsYFBOODZ4I6DaMWYD/fUcvx2nLH qCfjwMez26ehh1X/sNAKR9L1pPgdcJeFcZoBReyylVt29J2QCPQvKm7MSfg0C3kWGOyc 5ZpC1mmnA/k2gn2y5C03/RoSnpNfq0z4RdaNs= MIME-Version: 1.0 Received: by 10.101.50.17 with SMTP id c17mr4895157ank.125.1251139206688; Mon, 24 Aug 2009 11:40:06 -0700 (PDT) In-Reply-To: <20090824174937.GA43410@slackbox.xs4all.nl> References: <4A929241.5060406@videotron.ca> <4A92B6C4.8070309@videotron.ca> <20090824174937.GA43410@slackbox.xs4all.nl> Date: Mon, 24 Aug 2009 12:40:06 -0600 Message-ID: From: Tim Judd To: Roland Smith Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: PJ , freebsd-questions@freebsd.org Subject: Re: moving a disk 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: Mon, 24 Aug 2009 18:40:08 -0000 On 8/24/09, Roland Smith wrote: > On Mon, Aug 24, 2009 at 11:50:28AM -0400, PJ wrote: >> PJ wrote: >> > I am trying to move a 7.2 installation to another computer where it is >> > to be the only OS acting as a server for the lan. >> > On bootup I get the message: >> > Using drive 0, partition 3. >> > And there it hangs. > > Probably because the boot code can't find the 3rd stage loader... It is > strange that it is trying partition 3 instead of partition 4. 0-based. OpenBSD when set to install and use all of a disk, sets it to the last primary partition (1-based =3D 4, 0-based =3D 3). > > Did you prepare the disk as explained in the handbook (=A716.3 "Adding > Disks")? > I get the impression that you didn't. And that can have caused the proble= m. > > Try booting again, and press any key to interrupt the boot process to get= to > the boot prompt. You should see something like: > > >> FreeBSD/i386 BOOT > Default: 0:ad(0,a)/boot/loader > boot: > > At this boot prompt, type > > 0:ad(0,4,a)/boot/loader > > This will try to boot from the 4th partition. See boot(8). N.B. the boot > manpage uses the term 'slice' for partitions. By default the boot code lo= oks > for either the active slice or the first slice with the freebsd type. This drive still is likely having OpenBSD bootblocks in the MBR and track. I don't expect OpenBSD to boot FreeBSD. > >> > I have tried to rewrite the mbr but that did absolutely nothing. > > That is not surprising, The mbr is only part of the boot process. The > problem > seems to be that it cannot locate the rest... Read the chapter "The FreeB= SD > Booting Process" from the FreeBSD Handbook. And see > http://en.wikipedia.org/wiki/Master_boot_record > > This will provide insight into how FreeBSD actually boots. It is a bit of= a > convoluted process due to historical restrictions of the PC > architecture. Reading the manual pages for fdisk(8), boot(8) and loader(8= ) > might also prove enlightening. > >> > fik ad0 returns: >> > partitions 1,2,3 are >> > Parrtition 4 give the cylinder, heads, sectors, blocks stuff > > Why did you install on partition 4? Normally one would use parition 1. and sysinstall would use (0-based =3D 0, 1-based =3D 1) the first partition= too. > >> > What should I do? And what information do I need to supply or look for >> > to solve this. > > See below. > >> > I'd rathernot go through another installation even if this is farly >> > elementary. > > With any luck you don't have to. > >> > Oh, yes... all my former problems were definitely software related as = I >> > have checked and double, triple checked my HDDs and cannot find any >> > problems therewith. > >> here is what I have found in looking at the disk when it's mounted >> on another FBSD system through an USB interface: >> it is mounted on /dev/ad0 >> fdisk ad0 ---> returns partitions 1,2,3 as ; partition 4 is >> marked for sysid 166 OpenBSD (this seems to be left over from an >> installation that was never completed) > > It should be type 165 for FreeBSD! _Or_ partition 4 should be marked as > active > (flag 80). Is it? If not you can use the -a flag of fdisk to update the > active > partition. I think you should use something like 'fdisk -u -a -4 ad0'. L= ook > at the fdisk manual page to see what this does. I'm not sure if this is t= he > right invocation. I have never dealt with this problem. > > Setting the active partition _should_ be enough. If that doesn't work, > you're in > trouble. As far as I know there is no easy way to just change the partiti= on > type, without starting over. In theory you can set the type by fiddling s= ome > bits in the partition table, but that is probably harder than it sounds. > Maybe > sysinstall can do it, but I haven't tried. > > Next time you want to install FreeBSD on a disk, read =A716.3 "Adding Dis= ks" > of > the FreeBSD handbook first, and follow the steps laid out there! That wou= ld > create and active a single partition which would almost certainly have > avoided > this problem. > >> I also note that the other functioning FBSD 7.2 has partitions 2-4 as >> and partition 1 has the cylinder parameters. >> >> I get the impression that I should use the disklabel editor to change >> all that but am not familiar with it and am not sure how to use it. > > No. The disklabel works at a lower level. > > Historically PC harddisks can be divided into 4 partitions (This is what > fdisk > does). So the disk ad0 can have partitions 1--4: ad0s1--ad0s4. In older > FreeBSD > literature these are called slices, hence the 's' in the partition name. > > FreeBSD can subdivide a partition in labeled sections. These sections are > labeled with a letter, so partition ad0s1 can be divided (in 7.x) into > labeled > pieces a--g: ad0s1a--ad0s1g. This is what the bsdlabel(8) program does. A= nd > it > is usually on these subdivisions that filesystems are created with newfs(= 8). > >> Is there a way to fix this thingy? > > Make sure that partition 4 is the active partition. That should fix it. > > Roland > -- > R.F.Smith http://www.xs4all.nl/~rsmith/ > [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] > pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) > HTH