On Wed, Jun 04, 2008 at 06:28:58PM -0400, Luke Scharf wrote: > 2. The number s2 is arbitrary. If it were s0, then there would at > least be the beginning of the list. If it were s3, it would be at > the end of a 2-bit list, which could be explained historically. > If it were s7, it would be at the end of the list. But, no, it's > s2. Why? > 3. None of the grey-haired Solaris gurus that I've talked to have > ever been able to explain why.
This appears to be convention on (some?) BSDs from before Solaris existed. Best story I've heard is that it dates from before the time when modifiable (or at least *easily* modifiable) slices didn't exist. No hopping into 'format' or using 'fmthard'. Instead, your disk came with an entry in 'format.dat' with several fixed slices. To give some flexibility, certain slices were arranged around common use cases. a and b consumed an "early" part of the disk, in a pattern often usable as "root" and "swap". c consumed everything, so you could use that for the whole disk instead. d,e,f,g consumed the "later" part of the disk for /var,/usr,etc. h consumed the exact area that f and g did. So you could use the entire disk with any of: a,b,d,e,f,g a,b,d,e,h c without having to change the label. I speculate that then utilities were written that used c/2 for information about the entire disk and people thought keeping the convention going was good. > 4. Can you use s2 when the disk-label is corrupted? You can't use any slices when the disk label is corrupted. The 'sd' driver won't allow you access to them unless it's happy with the label. Trying with 'dd' will give you an I/O error. > If it's the > whole disk, maybe you can. If it's an entry in the disklabel, > maybe you can't. I seem to remember that I can write to s2 in > order to fix a borked label, but that makes no sense, and I don't > believe it. Maybe I'm loosing my mind. But, then again, my point > is that the s2 thing makes me loose my mind. :-) s2 is special only by convention, not by code. The sd driver can create a label without a label existing (and therefore without any slices present). You can later use access to block 0 (via any slice) to corrupt (...er *modify*) that label, but that's not a feature of s2. s0 would do it as well with the way most disks are labled (because it also contains cylinder 0/block 0.) > Using c0t0d0 to refer to the whole device (which works in some cases, > such as zpool create) makes a lot of sense. If it's a slice, it really > should be a slice. Historically that wasn't done, and it only works today if the application is handling it specifically or if you have an EFI label. -- Darren _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss