Pixel writes:
 > Jeff Sheinberg <[EMAIL PROTECTED]> writes:
 > 
 > > When the grub shell modifies the MBR for the `hide' or
 > > `unhide' command it does not issue a `BLKRRPART ioctl()',
 > > unlike fdisk which does issue `BLKRRPART ioctl()' when, eg,
 > > only the partition type is modified.
 > >
 > > The `BLKRRPART ioctl()' should be issued by the grub shell in
 > > this case, since the kernel's view of the partition tables
 > > may need to be changed, and the kernel needs to be notified
 > > of this.
 >
 > ?? the kernel doesn't give a damn about the partition types[1],
                 ^^^^^^^^^^^^^^^^^^^
 > even less about the hideness of a partition!
 >
 > [1] in fact it does care, but only to know if it is a
 > ``strange'' partition (extended parts, remapped one (like
 > 0x55))
 >
[snip]

    The following typescript shows that the kernel's view of the
    partition tables does in fact change, just by changing the
    partition type,

    30 jsroot ~ # uname -sr
    Linux 2.2.13

    31 jsroot ~ # cat /proc/partitions | grep sdb
       8    16    4233600 sdb
       8    17          1 sdb1
       8    18     827347 sdb2
       8    19     819315 sdb3
       8    20     819315 sdb4
       8    21     128457 sdb5
       8    22     819283 sdb6
       8    23     819283 sdb7
       8    24      40960 sdb8
       8    25     196608 sdb9
       8    26     589779 sdb10

    32 jsroot ~ # fdisk /dev/sdb

    Command (m for help): p

    Disk /dev/sdb: 255 heads, 63 sectors, 527 cylinders
    Units = cylinders of 16065 * 512 bytes

       Device Boot    Start       End    Blocks   Id  System
    /dev/sdb1             1       220   1767118+   5  Extended
    /dev/sdb2           221       323    827347+  a5  BSD/386
    /dev/sdb3           324       425    819315   83  Linux
    /dev/sdb4           426       527    819315   b9  Unknown
    /dev/sdb5             1        16    128457   82  Linux swap
    /dev/sdb6            17       118    819283+  83  Linux
    /dev/sdb7           119       220    819283+  83  Linux

    Command (m for help): t 2
    Partition number (1-7): 2
    Hex code (type L to list codes): b5
    Changed system type of partition 2 to b5 (Unknown)

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    WARNING: If you have created or modified any DOS 6.x
    partitions, please see the fdisk manual page for additional
    information.
    Syncing disks.

    33 jsroot ~ # cat /proc/partitions | grep sdb
       8    16    4233600 sdb
       8    17          1 sdb1
       8    18     827347 sdb2
       8    19     819315 sdb3
       8    20     819315 sdb4
       8    21     128457 sdb5
       8    22     819283 sdb6
       8    23     819283 sdb7

    34 jsroot ~ # 

There were 10 partitions on /dev/sdb before I changed the
partition type of /dev/sdb2 from `a5' BSD/386 to `b5' Unknown, ie,
hidden.  After hiding /dev/sdb2, there are now only 7 partitions.

-- 
Jeff Sheinberg  <[EMAIL PROTECTED]>

Reply via email to