Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2009 19:49:37 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        PJ <af.gourmet@videotron.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: moving a disk
Message-ID:  <20090824174937.GA43410@slackbox.xs4all.nl>
In-Reply-To: <4A92B6C4.8070309@videotron.ca>
References:  <4A929241.5060406@videotron.ca> <4A92B6C4.8070309@videotron.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.

Did you prepare the disk as explained in the handbook (=A716.3 "Adding Disk=
s")?
I get the impression that you didn't. And that can have caused the problem.=
=20

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<ENTER>

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 looks
for either the active slice or the first slice with the freebsd type.

> > 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 probl=
em
seems to be that it cannot locate the rest... Read the chapter "The FreeBSD
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 <UNUSED>
> > Parrtition 4 give the cylinder, heads, sectors, blocks stuff

Why did you install on partition 4? Normally one would use parition 1.

> > 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 <UNUSED>; 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 act=
ive
(flag 80). Is it? If not you can use the -a flag of fdisk to update the act=
ive
partition.  I think you should use something like 'fdisk -u -a -4 ad0'. Look
at the fdisk manual page to see what this does. I'm not sure if this is the
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 partition
type, without starting over. In theory you can set the type by fiddling some
bits in the partition table, but that is probably harder than it sounds. Ma=
ybe
sysinstall can do it, but I haven't tried.

Next time you want to install FreeBSD on a disk, read =A716.3 "Adding Disks=
" of
the FreeBSD handbook first, and follow the steps laid out there! That would
create and active a single partition which would almost certainly have avoi=
ded
this problem.

> I also note that the other functioning FBSD 7.2 has partitions 2-4 as
> <UNUSED> 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 fd=
isk
does). So the disk ad0 can have partitions 1--4: ad0s1--ad0s4. In older Fre=
eBSD
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 labe=
led
pieces a--g: ad0s1a--ad0s1g. This is what the bsdlabel(8) program does. And=
 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.=20

Roland
--=20
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)

--SUOF0GtieIMvvwua
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iEYEARECAAYFAkqS0rEACgkQEnfvsMMhpyVsBACfVzrXWPi7xGM2/ILrdmO1k/DE
HIwAoJbcxH+PKRPibHbo+T2JEeHmoYs/
=PyKb
-----END PGP SIGNATURE-----

--SUOF0GtieIMvvwua--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090824174937.GA43410>