2005-05-05 10:37:24

by James Dingwall

[permalink] [raw]
Subject: Bug: 2.6.11.8 msdos.c

Using vanilla 2.6.11.8 I get a "Cannot open initial console" on boot,
2.6.11.7 was fine. I have removed the patches to fs/partitions/msdos.c and
this has fixed my problem. I've read the discussion on this patch but it
doesn't indicate that this problem may occur so there is no suggested
solution. I have attached my .config and my partition layout is below, I
can provide any other information that might be useful. I'm not on the list
so plase Cc, I will follow the thread in the archives too.

James

# fdisk -l /dev/hda

Disk /dev/hda: 30.0 GB, 30020272128 bytes
255 heads, 63 sectors/track, 3649 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1797 14434371 83 Linux
/dev/hda2 1798 3649 14876190 5 Extended
/dev/hda5 1798 1860 506016 0 Empty
/dev/hda6 1861 1892 257008+ 83 Linux
/dev/hda7 1893 1924 257008+ 83 Linux
/dev/hda8 1925 2049 1004031 82 Linux swap / Solaris
/dev/hda9 2050 2112 506016 0 Empty
/dev/hda10 2113 2611 4008186 83 Linux
/dev/hda11 2612 2861 2008093+ 83 Linux


Attachments:
config (26.22 kB)

2005-05-05 16:55:21

by Chris Wright

[permalink] [raw]
Subject: Re: Bug: 2.6.11.8 msdos.c

* James Dingwall ([email protected]) wrote:
> Using vanilla 2.6.11.8 I get a "Cannot open initial console" on boot,
> 2.6.11.7 was fine. I have removed the patches to fs/partitions/msdos.c and
> this has fixed my problem. I've read the discussion on this patch but it
> doesn't indicate that this problem may occur so there is no suggested
> solution. I have attached my .config and my partition layout is below, I
> can provide any other information that might be useful. I'm not on the list
> so plase Cc, I will follow the thread in the archives too.

Thanks for the report James. To be clear, you simply backed out the
following: (I ask partly because this got merged in as part of the i2c
sysfs ChangeSet, odd)

===== fs/partitions/msdos.c 1.26 vs 1.27 =====
--- 1.26/fs/partitions/msdos.c 2004-11-09 12:43:17 -08:00
+++ 1.27/fs/partitions/msdos.c 2005-03-07 20:41:42 -08:00
@@ -114,6 +114,9 @@ parse_extended(struct parsed_partitions
*/
for (i=0; i<4; i++, p++) {
u32 offs, size, next;
+
+ if (SYS_IND(p) == 0)
+ continue;
if (!NR_SECTS(p) || is_extended_partition(p))
continue;

@@ -430,6 +433,8 @@ int msdos_partition(struct parsed_partit
for (slot = 1 ; slot <= 4 ; slot++, p++) {
u32 start = START_SECT(p)*sector_size;
u32 size = NR_SECTS(p)*sector_size;
+ if (SYS_IND(p) == 0)
+ continue;
if (!size)
continue;
if (is_extended_partition(p)) {


> # fdisk -l /dev/hda
>
> Disk /dev/hda: 30.0 GB, 30020272128 bytes
> 255 heads, 63 sectors/track, 3649 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hda1 * 1 1797 14434371 83 Linux
> /dev/hda2 1798 3649 14876190 5 Extended
> /dev/hda5 1798 1860 506016 0 Empty
> /dev/hda6 1861 1892 257008+ 83 Linux
> /dev/hda7 1893 1924 257008+ 83 Linux
> /dev/hda8 1925 2049 1004031 82 Linux swap / Solaris
> /dev/hda9 2050 2112 506016 0 Empty
> /dev/hda10 2113 2611 4008186 83 Linux
> /dev/hda11 2612 2861 2008093+ 83 Linux

2005-05-05 17:38:42

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: Bug: 2.6.11.8 msdos.c

On Thu, May 05, 2005 at 09:54:46AM -0700, Chris Wright wrote:

> * James Dingwall ([email protected]) wrote:
> > Using vanilla 2.6.11.8 I get a "Cannot open initial console" on boot,
> > 2.6.11.7 was fine. I have removed the patches to fs/partitions/msdos.c and
> > this has fixed my problem. I've read the discussion on this patch but it
> > doesn't indicate that this problem may occur so there is no suggested
> > solution. I have attached my .config and my partition layout is below

The solution is to change the type of your /dev/hda[59] to something nonzero.

> > # fdisk -l /dev/hda
> >
> > Disk /dev/hda: 30.0 GB, 30020272128 bytes
> > 255 heads, 63 sectors/track, 3649 cylinders
> > Units = cylinders of 16065 * 512 = 8225280 bytes
> >
> > Device Boot Start End Blocks Id System
> > /dev/hda1 * 1 1797 14434371 83 Linux
> > /dev/hda2 1798 3649 14876190 5 Extended
> > /dev/hda5 1798 1860 506016 0 Empty
> > /dev/hda6 1861 1892 257008+ 83 Linux
> > /dev/hda7 1893 1924 257008+ 83 Linux
> > /dev/hda8 1925 2049 1004031 82 Linux swap / Solaris
> > /dev/hda9 2050 2112 506016 0 Empty
> > /dev/hda10 2113 2611 4008186 83 Linux
> > /dev/hda11 2612 2861 2008093+ 83 Linux

2005-05-06 08:14:04

by James Dingwall

[permalink] [raw]
Subject: RE: Bug: 2.6.11.8 msdos.c

>
> * James Dingwall ([email protected]) wrote:
> > Using vanilla 2.6.11.8 I get a "Cannot open initial
> console" on boot,
> > 2.6.11.7 was fine. I have removed the patches to
> fs/partitions/msdos.c and
> > this has fixed my problem. I've read the discussion on
> this patch but it
> > doesn't indicate that this problem may occur so there is no
> suggested
> > solution. I have attached my .config and my partition
> layout is below, I
> > can provide any other information that might be useful.
> I'm not on the list
> > so plase Cc, I will follow the thread in the archives too.
>
> Thanks for the report James. To be clear, you simply backed out the
> following: (I ask partly because this got merged in as part of the i2c
> sysfs ChangeSet, odd)
>
> ===== fs/partitions/msdos.c 1.26 vs 1.27 =====
> --- 1.26/fs/partitions/msdos.c 2004-11-09 12:43:17 -08:00
> +++ 1.27/fs/partitions/msdos.c 2005-03-07 20:41:42 -08:00
> @@ -114,6 +114,9 @@ parse_extended(struct parsed_partitions
> */
> for (i=0; i<4; i++, p++) {
> u32 offs, size, next;
> +
> + if (SYS_IND(p) == 0)
> + continue;
> if (!NR_SECTS(p) || is_extended_partition(p))
> continue;
>
> @@ -430,6 +433,8 @@ int msdos_partition(struct parsed_partit
> for (slot = 1 ; slot <= 4 ; slot++, p++) {
> u32 start = START_SECT(p)*sector_size;
> u32 size = NR_SECTS(p)*sector_size;
> + if (SYS_IND(p) == 0)
> + continue;
> if (!size)
> continue;
> if (is_extended_partition(p)) {

Yes, this is the patch that I backed out.

> >
> > Disk /dev/hda: 30.0 GB, 30020272128 bytes
> > 255 heads, 63 sectors/track, 3649 cylinders
> > Units = cylinders of 16065 * 512 = 8225280 bytes
> >
> > Device Boot Start End Blocks Id System
> > /dev/hda1 * 1 1797 14434371 83 Linux
> > /dev/hda2 1798 3649 14876190 5 Extended
> > /dev/hda5 1798 1860 506016 0 Empty
> > /dev/hda6 1861 1892 257008+ 83 Linux
> > /dev/hda7 1893 1924 257008+ 83 Linux
> > /dev/hda8 1925 2049 1004031 82
> Linux swap / Solaris
> > /dev/hda9 2050 2112 506016 0 Empty
> > /dev/hda10 2113 2611 4008186 83 Linux
> > /dev/hda11 2612 2861 2008093+ 83 Linux

Andries' hint about changing the partition types to !0 is a fix for the
problem.

Thanks,
James

2005-05-06 13:59:11

by Bill Davidsen

[permalink] [raw]
Subject: Re: Bug: 2.6.11.8 msdos.c

James Dingwall wrote:
>>* James Dingwall ([email protected]) wrote:
>>
>>>Using vanilla 2.6.11.8 I get a "Cannot open initial
>>
>>console" on boot,
>>
>>>2.6.11.7 was fine. I have removed the patches to
>>
>>fs/partitions/msdos.c and
>>
>>>this has fixed my problem. I've read the discussion on
>>
>>this patch but it
>>
>>>doesn't indicate that this problem may occur so there is no
>>
>>suggested
>>
>>>solution. I have attached my .config and my partition
>>
>>layout is below, I
>>
>>>can provide any other information that might be useful.
>>
>>I'm not on the list
>>
>>>so plase Cc, I will follow the thread in the archives too.
>>
>>Thanks for the report James. To be clear, you simply backed out the
>>following: (I ask partly because this got merged in as part of the i2c
>>sysfs ChangeSet, odd)
>>
>>===== fs/partitions/msdos.c 1.26 vs 1.27 =====
>>--- 1.26/fs/partitions/msdos.c 2004-11-09 12:43:17 -08:00
>>+++ 1.27/fs/partitions/msdos.c 2005-03-07 20:41:42 -08:00
>>@@ -114,6 +114,9 @@ parse_extended(struct parsed_partitions
>> */
>> for (i=0; i<4; i++, p++) {
>> u32 offs, size, next;
>>+
>>+ if (SYS_IND(p) == 0)
>>+ continue;
>> if (!NR_SECTS(p) || is_extended_partition(p))
>> continue;
>>
>>@@ -430,6 +433,8 @@ int msdos_partition(struct parsed_partit
>> for (slot = 1 ; slot <= 4 ; slot++, p++) {
>> u32 start = START_SECT(p)*sector_size;
>> u32 size = NR_SECTS(p)*sector_size;
>>+ if (SYS_IND(p) == 0)
>>+ continue;
>> if (!size)
>> continue;
>> if (is_extended_partition(p)) {
>
>
> Yes, this is the patch that I backed out.
>
>
>>>Disk /dev/hda: 30.0 GB, 30020272128 bytes
>>>255 heads, 63 sectors/track, 3649 cylinders
>>>Units = cylinders of 16065 * 512 = 8225280 bytes
>>>
>>> Device Boot Start End Blocks Id System
>>>/dev/hda1 * 1 1797 14434371 83 Linux
>>>/dev/hda2 1798 3649 14876190 5 Extended
>>>/dev/hda5 1798 1860 506016 0 Empty
>>>/dev/hda6 1861 1892 257008+ 83 Linux
>>>/dev/hda7 1893 1924 257008+ 83 Linux
>>>/dev/hda8 1925 2049 1004031 82
>>
>>Linux swap / Solaris
>>
>>>/dev/hda9 2050 2112 506016 0 Empty
>>>/dev/hda10 2113 2611 4008186 83 Linux
>>>/dev/hda11 2612 2861 2008093+ 83 Linux
>
>
> Andries' hint about changing the partition types to !0 is a fix for the
> problem.

What is the reason for the patch in the first place? Obviously it's
intended to do something, or not do something bad, but what's wrong with
a reserved partition?

I looked at the rest of msdos.c and it wasn't blindingly clear what the
original intent was. A partition type of zero is unusual, but it's not
illegal, is it? (as in violates some standard)

--
-bill davidsen ([email protected])
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me

2005-05-06 14:12:10

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: Bug: 2.6.11.8 msdos.c

On Fri, 6 May 2005, Bill Davidsen wrote:

> James Dingwall wrote:
>>> * James Dingwall ([email protected]) wrote:
>>>
>>>> Using vanilla 2.6.11.8 I get a "Cannot open initial
>>>
>>> console" on boot,
>>>
>>>> 2.6.11.7 was fine. I have removed the patches to
>>>
>>> fs/partitions/msdos.c and
>>>
>>>> this has fixed my problem. I've read the discussion on
>>>
>>> this patch but it
>>>
>>>> doesn't indicate that this problem may occur so there is no
>>>
>>> suggested
>>>
>>>> solution. I have attached my .config and my partition
>>>
>>> layout is below, I
>>>
>>>> can provide any other information that might be useful.
>>>
>>> I'm not on the list
>>>
>>>> so plase Cc, I will follow the thread in the archives too.
>>>
>>> Thanks for the report James. To be clear, you simply backed out the
>>> following: (I ask partly because this got merged in as part of the i2c
>>> sysfs ChangeSet, odd)
>>>
>>> ===== fs/partitions/msdos.c 1.26 vs 1.27 =====
>>> --- 1.26/fs/partitions/msdos.c 2004-11-09 12:43:17 -08:00
>>> +++ 1.27/fs/partitions/msdos.c 2005-03-07 20:41:42 -08:00
>>> @@ -114,6 +114,9 @@ parse_extended(struct parsed_partitions
>>> */
>>> for (i=0; i<4; i++, p++) {
>>> u32 offs, size, next;
>>> +
>>> + if (SYS_IND(p) == 0)
>>> + continue;
>>> if (!NR_SECTS(p) || is_extended_partition(p))
>>> continue;
>>>
>>> @@ -430,6 +433,8 @@ int msdos_partition(struct parsed_partit
>>> for (slot = 1 ; slot <= 4 ; slot++, p++) {
>>> u32 start = START_SECT(p)*sector_size;
>>> u32 size = NR_SECTS(p)*sector_size;
>>> + if (SYS_IND(p) == 0)
>>> + continue;
>>> if (!size)
>>> continue;
>>> if (is_extended_partition(p)) {
>>
>>
>> Yes, this is the patch that I backed out.
>>
>>
>>>> Disk /dev/hda: 30.0 GB, 30020272128 bytes
>>>> 255 heads, 63 sectors/track, 3649 cylinders
>>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>>>
>>>> Device Boot Start End Blocks Id System
>>>> /dev/hda1 * 1 1797 14434371 83 Linux
>>>> /dev/hda2 1798 3649 14876190 5 Extended
>>>> /dev/hda5 1798 1860 506016 0 Empty
>>>> /dev/hda6 1861 1892 257008+ 83 Linux
>>>> /dev/hda7 1893 1924 257008+ 83 Linux
>>>> /dev/hda8 1925 2049 1004031 82
>>>
>>> Linux swap / Solaris
>>>
>>>> /dev/hda9 2050 2112 506016 0 Empty
>>>> /dev/hda10 2113 2611 4008186 83 Linux
>>>> /dev/hda11 2612 2861 2008093+ 83 Linux
>>
>>
>> Andries' hint about changing the partition types to !0 is a fix for the
>> problem.
>
> What is the reason for the patch in the first place? Obviously it's
> intended to do something, or not do something bad, but what's wrong with
> a reserved partition?
>
> I looked at the rest of msdos.c and it wasn't blindingly clear what the
> original intent was. A partition type of zero is unusual, but it's not
> illegal, is it? (as in violates some standard)

Can't the problem be fixed by just using Linux fdisk to put in the
correct ID? Unlike MS-DOS fdisk, the Linux fdisk can modify things
without destroying everything else on the drive.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.11 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.

2005-05-09 17:40:03

by Bill Davidsen

[permalink] [raw]
Subject: Re: Bug: 2.6.11.8 msdos.c

Richard B. Johnson wrote:
> On Fri, 6 May 2005, Bill Davidsen wrote:
>
>> James Dingwall wrote:

>>> Andries' hint about changing the partition types to !0 is a fix for the
>>> problem.
>>
>>
>> What is the reason for the patch in the first place? Obviously it's
>> intended to do something, or not do something bad, but what's wrong with
>> a reserved partition?
>>
>> I looked at the rest of msdos.c and it wasn't blindingly clear what the
>> original intent was. A partition type of zero is unusual, but it's not
>> illegal, is it? (as in violates some standard)
>
>
> Can't the problem be fixed by just using Linux fdisk to put in the
> correct ID? Unlike MS-DOS fdisk, the Linux fdisk can modify things
> without destroying everything else on the drive.

Yes, that works. My question was why a zero was considered a bad value
instead of "reserved." Not that I disagree, I just don't see the reason.

--
-bill davidsen ([email protected])
"The secret to procrastination is to put things off until the
last possible moment - but no longer" -me

2005-05-09 20:40:28

by Bodo Eggert

[permalink] [raw]
Subject: Re: Bug: 2.6.11.8 msdos.c

Bill Davidsen <[email protected]> wrote:
> Richard B. Johnson wrote:
>> On Fri, 6 May 2005, Bill Davidsen wrote:

>>> I looked at the rest of msdos.c and it wasn't blindingly clear what the
>>> original intent was. A partition type of zero is unusual, but it's not
>>> illegal, is it? (as in violates some standard)

>> Can't the problem be fixed by just using Linux fdisk to put in the
>> correct ID? Unlike MS-DOS fdisk, the Linux fdisk can modify things
>> without destroying everything else on the drive.
>
> Yes, that works. My question was why a zero was considered a bad value
> instead of "reserved." Not that I disagree, I just don't see the reason.

The values in the other fields are asumed to be ignored if the ID is 0.
Therefore, some people store their company name there, which, interpreted
as a partition address, results e.g. in overlapping partitions.

If there is a automounter, this bogus partition will be mounted, and if
it happens to look like having a valid filesystem, this will result in
data corruption or crashes.
--
Fun things to slip into your budget
Does that line item say 'Personal Massage System' Oops, it's supposed to be
'Message'. Go ahead and sign the authorization, Boss; I'll correct it later.
(Iike Hell I will)