1st sector on a disk vs 1st sector on a partition

0

I am on Intelx86 platform. I have make my entire disk a Solaris partition.

Below are the slice information in that Solaris partition

partition> p
Current partition table (original):
Total disk cylinders available: 6524 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm      68 - 1141        8.23GB    (1074/0/0)  17253810
  1       swap    wu       1 -   67      525.56MB    (67/0/0)     1076355
  2     backup    wm       0 - 6523       49.98GB    (6524/0/0) 104808060
  3 unassigned    wm       0               0         (0/0/0)            0
  4 unassigned    wm       0               0         (0/0/0)            0
  5 unassigned    wm       0               0         (0/0/0)            0
  6 unassigned    wm       0               0         (0/0/0)            0
  7       home    wm    1142 - 6522       41.22GB    (5381/0/0)  86445765
  8       boot    wu       0 -    0        7.84MB    (1/0/0)        16065
  9 unassigned    wm       0               0         (0/0/0)            0

My question would be

  1. When you make a whole partition out of the disk, does the 1st sector in the partition = 1st sector in the disk?

  2. Does the 1st sector (under the boot slice number 8) listed in the partition table above = 1st sector in the disk?

Noob

Posted 2015-10-18T06:14:54.157

Reputation: 1 145

Solaris on x86 conforms to PC disk conventions, and therefore uses the MS-DOS partition table in the MBR. FWIW I was a developer on the team that first ported SunOS 20 years ago to x86. – sawdust – 2015-10-19T00:43:42.490

@sawdust good to hear that! so i would believe that the MBR = 1st sector of disk, and the solaris VTOC is in the fdisk primary partition - yea ? – Noob – 2015-10-19T11:26:40.873

@sawdust - are you also able to advise why oracle doc is installing the bootblock on s0 instead of s8/s2 for x86 partition ? (http://docs.oracle.com/cd/E19253-01/817-5093/disksxadd-45774/index.html)

– Noob – 2015-10-19T11:28:40.443

"...solaris VTOC is in the fdisk primary partition - yea ?" -- Yes. I don't recall those other details. After the first x86 releases (Solaris 2.3 and 2.4), most disk utilities were reassigned to another group at another site (Boulder CO). I don't recall a disk layout like you show, IIRC for the initial versions, we used logical partitions for slices. They have had a lot of time to change this. – sawdust – 2015-10-21T00:18:50.650

Answers

1

  1. Typically, no. Typically, the first sector is reserved as the MBR, and then partitions start after that. Actually, the first partition often starts after the first entire data unit (I don't recall if that data unit is a cylinder or a track/head) is complete. So, out of your first entire data unit, only the first sector is used; the rest is typically wasted. That is how GAG seems to have enough space to store graphics; it just uses some of the extra sectors of that data unit.

Actual example from a Linux system I have access to:

Command (m for help): p

Disk /dev/xvda: 2664 MB, 2664990720 bytes 255 heads, 63 sectors/track, 324 cylinders, total 5205060 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x55137354

Device Boot      Start         End      Blocks   Id  System

/dev/xvda1 63 257039 128488+ 83 Linux /dev/xvda2 257040 5188994 2465977+ 5 Extended /dev/xvda5 257103 4176899 1959898+ 82 Linux swap / Solaris /dev/xvda6 4176963 5188994 506016 83 Linux

Notice that partition one starts on sector 63. After the first 63 sectors (numbered 0 through 62), the next sector (63) is on a new track/head.

I will add that I stress the word "typically". It is possible, at least with some operating systems, to place a filesystem volume to start at the beginning of the disk, and to not have an MBR define partition boundaries. That setup does not seem to be nearly as common, though.

  1. I'm not that certain about Solaris output. x86 MBR usually just has 4 partitions, unless you have an extended partition. You have 5 partitions, so it is conceivable that fdisk is showing you the boot stuff in addition to 4 regular partitions. However, I also see that partition 2 overlaps with the cylinders reported by other partitions, which is generally a "no-no". So I'm not quite sure what to make of this. Usually, I find that partitions are reported based on their sector boundaries, or maybe their CHS (Cylinders, Heads, and Sectors) boundaries. The output you showed seems to be showing just the cylinder boundaries. If you want clarity, I would try another disk partitioner. OpenBSD's is good (you can boot the smaller CD image, and proceed to the point where it runs fdisk, and press "p" to print the partition table).

TOOGAM

Posted 2015-10-18T06:14:54.157

Reputation: 12 651

1

  • 1: No, under x86, you use a partition table (either MBR/fdisk or EFI) and inside one of them a vtoc label. The first sector of the single vtoc partition doesn't include the MBR/EFI table. The first sector of the vtoc slice 2 might not be the same as the first sector of the fdisk partition.

  • 2: No. On Solaris for x86, Slice 8 sector 0 is the first sector usable by Solaris slices, not the first one of the whole disk.

jlliagre

Posted 2015-10-18T06:14:54.157

Reputation: 12 469

>

  • can you elaborate further what you mean by "Similarily, the first sector of the vtoc slice 2 is not the same as the first sector of the fdisk partition" - i would have thought the 1st sector of a fdisk partition = 1st sector of slice 2, since slice 2 = represent the whole partition.
  • < – Noob – 2015-10-18T13:02:56.213

    I mean there are two cylinders outside the slice span area. Whether these cylinders are before, after or wherever regarding the usable disk space is as far as I know unspecified. – jlliagre – 2015-10-18T13:16:19.810

    >

  • do you mean that the partition command which allow us to slice up the x86 partition does not factor into the 2 cylinders, and whether this 2 cylinder are at the front or the back of the partition is unknown.
  • < – Noob – 2015-10-19T11:22:12.627

    These two cylinders cannot store slice data. It should be quite easy to check where they are located but I have no system right now to test though. – jlliagre – 2015-10-19T13:12:01.247