Re: bsdlabel offset



On Thu, Mar 20, 2008 at 04:38:00PM +0100, Adam Pordzik wrote:

Jerry McAllister wrote:
On Fri, Mar 14, 2008 at 11:40:55AM +0100, Tektonaut wrote:

Hi,

following bsdllabel output caught my attention:

# size offset fstype [fsize bsize bps/cpg]
a: 2097152 0 4.2BSD 2048 16384 28552
b: 4194304 2097152 swap
c: 312576642 0 unused 0 0 # "raw" part,
don't edit
d: 33554432 6291456 4.2BSD 2048 16384 28552
...

I created this disk with sade or sysinstall. What I'm not sure
about is that partition 'a' has an offset of 0. With an 8k big
/boot/boot I would guess offset should be 16block large.

But since the disk is booting, some boot1 loader ist located at
sector 0 (from the beginning of this slice). How is it assured,
that the first block will never be overwritten? Where is boot1
located, where boot2?

Comparing the first sector with boot and boot1 differs already
at the first char. (and there were no updates so far)

That sector 0 lies outside of the slice block 0. What you are
seeing is not an absolute disk offset, but the offset in to the slice.

Right, and sector 0 of the bsd-partition (label) begins where
the bsd-partition- starts. Since offset of ads1a is zero, sector 0
ad0s1a is the same as sector 0 of ad0s1.

So my problem was to understand how there can be any room for
boot1+2, if the filesystem start right there. My fault was to assume,
that the ufs-superblock begins at first sector. (see below)

It is possible to create it otherwise but isn't done that
way by default. Nowdays, actually a whole track is held
out, instead of just sector 0 and that is where some of the
fancier MBRs such as GRUB get their extra space to work.
But, the standard FreeBSD MBR sticks to the official standard
of just one sector - which is why it is so plain vanilla.

Since I have no real use for a DOS/MBR-partitiontable, I'd like to
partitionate a "dangerously dedicated" layout. How would I do
this in a safe way?

I found the answer to my question in sys/ufs/ffs/fh.h: UFS leaves
some sectors free up to the superblock. Dependening on xxxxxxxxx
that can be 0k, 8k, 32k, 64k or even 256k.

Yup.

Dangerously dedicated just means skipping making a slice and BSDlabeling
the ad0 or da0 address rather than ad0s1 or da0s1.

It is safe as long as the disk must never be looked at by anything
other than FreeBSD.

////jerry


Adam

--


_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: bsdlabel offset
    ... I created this disk with sade or sysinstall. ... /boot/boot I would guess offset should be 16block large. ... Comparing the first sector with boot and boot1 differs already ... That sector 0 lies outside of the slice block 0. ...
    (freebsd-questions)
  • Re: SortMerge avoids thrashing (was: Baileys "two pass" FFT algorithm question)
    ... of size that match the backing store to assure locality of reference. ... For RAM backed by disk, the key thing which takes the most time is ... you need to localize sector reads within that one ... Sweeps your RAM once when you load original data from disk. ...
    (comp.programming)
  • Re: XP Pro Recovery Errors
    ... it turns out that the boot sector, sector 0, of my HDD failed to "read, write, or remove write-protection." ... Hard drives, when they have a problem with a sector, mark it as "pending". ... So if you do something to write to the disk, and write sector zero, ...
    (microsoft.public.windowsxp.general)
  • Re: FUD about CGD and GBDE
    ... > a sector that has been rewritten. ... zone, otherwise it would expose the remaining sectors is the zone. ... contents and regular data written to the disk by the user. ... > possible to determine this fairly quickly using traffic analysis. ...
    (freebsd-hackers)
  • Re: Hard Drive Issues
    ... I'm assuming that particular sector on the drive is dying, ... Looks like you disk is on its way out, from the look of the above ... bsdlabel and newfs the new disk the way you want it. ... Ignore all the stuff above where it displays the partition information. ...
    (freebsd-questions)