Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2000 18:30:36 +0400 (MSD)
From:      "Aleksandr A.Babaylov" <babolo@links.ru>
To:        intmktg@CAM.ORG (Marc Tardif)
Cc:        babolo@links.ru, dcs@newsguy.com, freebsd-hackers@FreeBSD.ORG, freebsd-fs@FreeBSD.ORG
Subject:   Re: device naming convention
Message-ID:  <200009191430.SAA26861@aaz.links.ru>
In-Reply-To: <Pine.LNX.4.10.10009182355360.6707-100000@Gloria.CAM.ORG> from "Marc Tardif" at "Sep 18, 0 11:59:14 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Marc Tardif writes:
> > What is slices content?
> > s1 - almost right FreeBSD label
> > s2 - not a right FreeBSD label but similar enough to label.
> > s3 - no label or similar at all.
> > How to do such a content that screw the system?
> > This is my way for this test:
> >  - shorten s2 to 3 cilinder.
> >  - disklabel -w -r wd0s2 fd360
> >  - restore s2 size.
> I don't understand this last part, probably because I don't have much
> experience with labelling and partitioning. Please excuse my questions if
> they seem basic, but I am fairly new to disks:
> - how can s2 be "similar enough to label" if it is recognised
>   as "sysid 0,(unused)" by fdisk?
sorry, content of s2 ...
No, s2 has some bits at the begin that FreeBSD interpretes
as label.
"sysid 0,(unused)" has no sense - every sysid cant stop
slice from been evaluated for label on it.

> - how did you create s2 exactly, in order to make it "similar
>   enough to label" yet remain unused?
in case I write about steps were:
 - fdisk -u wd0
   create 3 slices of equal lenght 76 cylinders
   s1 - suid 165, s2 - suid 0, s3 - suid 165.
 - reboot
 - label s1 - I dont remember exact way, nothing special I believe.
 - fdisk -u wd0
   change slice s2 with suid 0 and 3 cylinders (3*660 blocks) in size
 - disklabel -w -r wd0s2 fd360
 - disklabel -e wd0s2
   delete b:, mark a: unused and mark c: 4.2BSD
 - fdisk -u wd0
   change size of s2 to 76 tracks.
 - reboot
Now s2 has invalid (broken) label (or some bits that are similar
to label)

> - how did you create s3 and s4 exactly?
s3 above, s4 is suid 0 start 0 size 0

> - why is s3 not similar at all if it is recognised as a
>   FreeBSD slice by fdisk?
s3 has some scrap that is not recognized by FreeBSD as "label"
Again - sysid has no sense if not used in boot process or another
system, FreeBSD seek every slice for label independantly of sysid.

> - what do you mean by shortening s2 to 3 cylinders? Do you
>   mean s2 should start at the third cylinder?
After first fdisk I change s2 size only, not any other s2 parameter

> - is there any reason you chose to label wd0s2 as fd360?
It is the easyest way to write something to s2 that is similar
to label. fd360 is first type in my /etc/disktypes

> - how should s2 size be restored? maybe:
>   dd of=/dev/wd0s2 if=/dev/null bs=660b?
No. change size wia fdisk

> > How can you guarantee that occasionally some
> > bits in slice do not fraud FreeBSD
> > if used for arbitrary bits?
> > Do not use slice begin at all.
> I also didn't quite understand what is wrong with using the slice begin.
> Your octal dump showed how the first 017343 bytes were not nulls, but why?
> Is there a fixed number of bytes that should be skipped, or should this
> number be system dependent and tested manually?
If you use slice in such a way that in label area occur something
that can be treated by OS as a FreeBSD label,
then protection of label and boot area occur.
label area IMHO 1K, boot area in any case ends before 32 block
(first suberblock copy in ufs)
As far as I understand (but I am not hard in this)
just keep 4 bytes (addresses 0376, 00377, 00776, 00777) is sufficient

> To avoid using the slice begin, could the first label be defined at a
> proper offset to skip the slice begin?
If NOT use FreeBSD label? How?
If use FreeBSD label? just use FreeBSD partitions inside
slice (M$ partiton)? May be.
But I have example of misbehave such a conctruction in 2.2.X.
Not tested in 4.1. Are you interested?
3.X not interesting at all.

-- 
@BABOLO      http://links.ru/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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