Re: 9G disk, >4 partitions, and lose95

Mike A. Harris (mharris@ican.net)
Wed, 21 Oct 1998 18:12:01 -0400 (EDT)


On Tue, 20 Oct 1998 kwrohrer@ce.mediaone.net wrote:

>This sounds just like:
>
># fdisk /dev/hdb
>fdisk> t
>fdisk-t> 2
>fdisk-t (L for list)> 5
>Error: you can't change a partition to an extended partition.
>
>Unless "sfdisk" is a "standard" program so new it's not in RH5.1, or
>"sfdisk" is just static-linked fdisk and its command-line invocation
>is more lax than it's menu-and-prompt version.
>
>> If anyone's already working on kernel support for lose95/98's "big"
>> extended partitions, please let me know, otherwse I'll start poking
>> around. It's starting to become a FAQ in the newsgroups (with no
>> good answers!), now that you can get a 9G SCSI drive for <$500 on a
>> good day, and a >8G IDE drive for less yet... I think we really,
>> really need this in 2.2, if not 2.2.0, otherwise there goes a good
>> chunk of our losedows non-combatibility...
>>
>>
>> Hmm. Can you be more explicit? What support are you looking for
>> that is not there already?
>When lose95's fdisk makes a big extended partition be "type 0xf",

Windows 95's "big extended partition" that you speak of is not an
extended partition. An "extended" partition is not an
OS-specific partition with a filesystem, it is an OS independant
logical partitioning scheme. Windows 95's FDISK starts up
offering "Large Disk Support", if you choose "yes" to this, then
any partitions or logical drives that you create in an
extended partition with Windows 95's FDISK will be of type FAT32
which is 0x0f.

So for example, to create both FAT32 and linux partitions:

>From a clean unpartitioned drive, fire up a W95 boot disk and run
FDISK, answer yes to the "Large disk support". Create a primary
partition of the size that you wish, and it will be created as
FAT32. Then you can create EXTENDED partition. Then if you wish
to have any more FAT32 partitions as logical drives inside this
extended partition, choose "Create Logical partition in extended
partition". When it asks you for the size, be sure to not choose
all available space if you wish to create other logical
partitions in Linux or '95.

So, lets say your PRIMARY FAT32 partition (/dev/hda1) is 2G.
Then your extended partition would be the remainder of the disk
and would be created as 7G (on your 9G drive). Inside this
extended partition you wish to create a second FAT32 partition of
2G size, so you choose create logical partition in extended
partition from the menu of W95 FDISK and choose 2G for it's size.
Then you save and exit. You can format the FAT32 partitions with
W95's FORMAT program now if you wish, but it isn't absolutely
necessary.

Now you boot into Linux, and run any Linux fdisk program.
Assuming the standard "fdisk" program, you would enter "n" for
new partition, and I believe "l" to create a logical drive in an
extended partition. Then enter the size or number of cylinders
you wish, and continue this process until all ext2 logical
partitions have been created in the extended partition. Be sure
to change the partition ID of any swap partitions to type 82 for
swap space.

Use "w" to write the new partition table, and then shutdown and
reboot. The FAT32 drives are available in both W95 as C: and D:,
and assuming you made one FAT32 and 2 Linux partitions in the
extended partition, the partitions are ALL available in Linux as:

/dev/hda1 fat32
/dev/hda2 <extended partiton>
<partitions inside extended partition>
/dev/hda5 fat32
/dev/hda6 ext2
/dev/hda7 swap

To mount these drives in Linux, you use type "ext2" for the ext2
partitions, and "vfat" for the fat32 partitions. Your kernel has
to be built with vfat support in order to read Windows 95
partitions at all, and it must be a kernel >= 2.0.34, or a recent
devel kernel. Alternatively the vfat support may be compiled as
a module.

>linux doesn't recognize it as an extended partition (kernel problem),
>nor does linux fdisk (userspace problem). When I edit the partition
>table to make that a "type 0x5", lose95 crashes early and often, and
>I can't fix lose95, so it's Linux that needs to become aware of the
>new extended partition type so it (and its fdisk program) can see and
>edit partitions inside the new-type extended partition.

Just follow the instructions that I gave above and you should be
ok no problem. Linux is not broken, nor is W95 (at least not in
this case).

>It should be just a matter of accepting 0xf as an extended partition

But 0x0f is *NOT* an extended partition. 0x0f is a partition of
type FAT32. You may NOT create partitions inside this. If for
some reason you _do_, then you've created a messed up
partitioning scheme that should not and will not work. The fact
that it may work under 95 is probably because the partition table
entries are ok, and the boot sector and FAT is probably fine
under Windows, whereas there is probably some disk corruption
that is either in unused space, or is not apparent for some
reason.

If you use Norton Utilities to fix *ANY* drives in Windows 95
whatsoever, do *NOT* use Norton Utilities version 8.0 or less for
DOS or you *WILL* destroy your data period. ONLY use Norton
Utils for Windows 95, as they understand FAT32 whereas the DOS
versions do not, and interpret it as FAT16 and hose it.

>type (easy), and figuring out and going along with whatever Microsoft
>changed that led it to change the type ID (maybe harder).

Here is my partition table:

Device Boot Begin Start End Blocks Id System
/dev/hda1 1 1 196 1574338+ 1b Unknown
/dev/hda2 197 197 324 1028160 83 Linux native
/dev/hda3 * 325 325 524 1606500 5 Extended
/dev/hda5 325 325 329 40131 82 Linux swap
/dev/hda6 * 330 330 524 1566306 83 Linux native

As you can see, partition 1 is listed as Unknown, which is FAT32.
It works fine in Linux no problem when mounted as VFAT. The
extended partition is of type 0x05, and contains a swap and an
ext2 partition.

So please try to repartition your disk as I described above and
it should work. If not, then perhaps I do not understand your
problem fully. If that is the case, feel free to write me
privately and I'll try and help out. I've got a considerable
amount of experience with wicked partitioning schemes and also a
lot of experience recovering disk problems with sector editing
utils such as DISKEDIT, and debugfs, etc... I'm more than
willing to try and help out.

Take care,
TTYL

--
Mike A. Harris  -  Computer Consultant  -  Linux advocate

Linux software galore: http://freshmeat.net

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/