Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Mar 2005 03:47:14 -0800
From:      "Loren M. Lang" <lorenl@alzatex.com>
To:        Carl J <carlj1752@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Location of disklabel
Message-ID:  <20050313114714.GK18080@alzatex.com>
In-Reply-To: <BAY15-F3104AEE621B396B212CFE8B8520@phx.gbl>
References:  <BAY15-F3104AEE621B396B212CFE8B8520@phx.gbl>

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

--P7Tqkd/m/Jnohiaz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 10, 2005 at 04:32:30PM -0500, Carl J wrote:
> Hi all! To all your FS guru's outthere, I desperately need
> to know where the disklabel is stored (since my disk is in trouble!)
>=20
> Situation:
>=20
>   My /dev/ad0s1 has 2 partitions: "a" (FS) followed by "b" (swap).
>   By using "disklabel -r", I see my "a" and "b" indeed
>   take up the entire slice.
>=20
> My desperate question:
>=20
>   Where, then, is the "disklabel" stored?

The second sector of the slice that the disklabel is partitioning.  For
example, a disklabel on your first slice would be stored in the second
sector of /dev/ad0s1.  The command dd if=3D/dev/ad0s1 skip=3D1 | hexdump
will give you a hexdump of the disklabel.  Since the 'a' partition of
the disklabel normally starts at the beginning of the slice that the
disklabel is in, it is identical to reading from the slice directly,
just a little shorter.  Also, the 'c' partition always covers the entire
slice so it is identical assuming the disklabel isn't messed up.

>=20
>   Somewhere in the partition table? The Master Boot Record?
>   The reserved cylinder #0?

No, msdos partition table that creates what are called slices in the bsd
world reside in the last few byte of the Master boot record, but this
has nothing to do with the disklabel that is stored in the slice.  And
normally the only thing you will find in cylinder 0 is the master boot
record which is the very first sector of the hard disk.

>=20
>   Or is it stored somewhere inside /dev/ad0s1a ??
>   (if that's the case, does that mean the UFS1
>   intentionally left some space unused, for this purpose?
>   And if so, is it always at a fixed location within a UFS1 slice?)

Actually, since the 'a' partition is the same as the beginning of the
slice it's in, the ufs filesystem always skips the first 16 sectors of
whatever partition it's in.

>=20
>   What if in my slice, I have SWAP first, and then UFS1,
>   then does that mean the SWAP Format also reserves
>   some unused space for the disklabel to go???
>=20
> Sorry if the question is stupid. I just somehow couldn't
> logically see where it would be stored, and yet be compatible
> with having other OS on the same drive... etc.
>=20
> Thanks!
>=20
> - Carl
>=20
>=20
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o=
rg"

--=20
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2
=20

--P7Tqkd/m/Jnohiaz
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCNChCbTXoRwEYo9IRAvV7AJ9t3C5wWemxwS7J0T06tCDPXz/98wCfdPPr
O9x6EpbC3GfSO9IBhWKH3bk=
=m4kk
-----END PGP SIGNATURE-----

--P7Tqkd/m/Jnohiaz--



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