linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Odd partition overlapping problem
@ 2001-11-13 14:45 ` Robert A H Holmberg
  2001-11-13 15:08   ` Richard B. Johnson
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Robert A H Holmberg @ 2001-11-13 14:45 UTC (permalink / raw)
  To: linux-kernel

Hi,
I have a dual-boot setup with win98 and linux. I primarily use linux, but
I want to keep windows around for some inportant productivity
applications, mostly games.  My partition table is as follows:

<snip>
[root@localhost documents]# fdisk /dev/hda

The number of cylinders for this disk is set to 3736.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

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

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       523   4200966    c  Win95 FAT32 (LBA)
/dev/hda2           524       525     16065   83  Linux
/dev/hda3           526      2647  17044965   83  Linux
/dev/hda4          2648      3736   8747392+   5  Extended
/dev/hda5          2648      2713    530113+  82  Linux swap
/dev/hda6          2714      3736   8217216    c  Win95 FAT32 (LBA)

Command (m for help):
</snip>

/dev/hda3 is my linux root partition (hda2 is /boot)  and hda6 is D: in
windows. Somehow, that I can't figure out hda3 overlaps hda6. I see this
by writing some data to hda3, booting to windows and finding out that my
D: is no longer considered "formatted". If I format D: and boot back to
linux, some of my files that I just wrote are corrupted. Since fdisk shows
no overlap and there is tha swap partition between these two partitions, I
can't figure out how this happens (other than, that somewhere there is a
bug and these two partitions DO overlap) and more importantly, for me, how
to stop this from happening without reinstalling my whole system.

My question is, can anyone here give me any ideas of how to debug this
problem? I use Linux 2.4.14 and reiserfs on hda3. I partitioned the drive
with linux fdisk, since I don't trust dos fdisk. My fdisk version is
2.10s .

Please cc to me, I'm not on the list,

Robert Holmberg


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Odd partition overlapping problem
  2001-11-13 14:45 ` Odd partition overlapping problem Robert A H Holmberg
@ 2001-11-13 15:08   ` Richard B. Johnson
  2001-11-13 22:48     ` [Probably OT] " Robert Holmberg
  2001-11-13 22:51   ` [Probably OT] " Robert Holmberg
  2001-11-14 11:08   ` Guest section DW
  2 siblings, 1 reply; 7+ messages in thread
From: Richard B. Johnson @ 2001-11-13 15:08 UTC (permalink / raw)
  To: Robert A H Holmberg; +Cc: linux-kernel

On Tue, 13 Nov 2001, Robert A H Holmberg wrote:

> Hi,
> I have a dual-boot setup with win98 and linux. I primarily use linux, but
> I want to keep windows around for some inportant productivity
> applications, mostly games.  My partition table is as follows:
> 
> <snip>
> [root@localhost documents]# fdisk /dev/hda
> 
> The number of cylinders for this disk is set to 3736.
> There is nothing wrong with that, but this is larger than 1024,
> and could in certain setups cause problems with:
> 1) software that runs at boot time (e.g., old versions of LILO)
> 2) booting and partitioning software from other OSs
>    (e.g., DOS FDISK, OS/2 FDISK)
> 
> Command (m for help): p
> 
> Disk /dev/hda: 255 heads, 63 sectors, 3736 cylinders
> Units = cylinders of 16065 * 512 bytes
> 
>    Device Boot    Start       End    Blocks   Id  System
> /dev/hda1   *         1       523   4200966    c  Win95 FAT32 (LBA)
> /dev/hda2           524       525     16065   83  Linux
> /dev/hda3           526      2647  17044965   83  Linux
> /dev/hda4          2648      3736   8747392+   5  Extended
> /dev/hda5          2648      2713    530113+  82  Linux swap
> /dev/hda6          2714      3736   8217216    c  Win95 FAT32 (LBA)
> 
> Command (m for help):
> </snip>
[SNIPPED...]

The extended partition goes from 2648 to 3736. The first part of
this extended partition from 2648 to 2713 is swap. The second part
of 2714 to 3736 is the FAT32 partition. It looks as though M$ tries
to use the swap area, ignoring the 82 code for Linux swap. This
may be why the M$ partition gets trashed. To test this theory,
disable swap on this drive (comment it out in /etc/fstab). Re-do
the M$ partition and see if it remains clean. If it remains
clean, then do a `mkswap` from Linux. Reboot to M$ and verify that
the last partition is now corrupt. This will show that M$ is
trying to use the swap area. If it is, re-fdisk the extended
partition to put Linux swap at the end instead of the beginning.

This should work around the M$ bug.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Probably OT] Re: Odd partition overlapping problem
  2001-11-13 15:08   ` Richard B. Johnson
@ 2001-11-13 22:48     ` Robert Holmberg
  2001-11-14 15:02       ` [OT] " Robert Holmberg
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Holmberg @ 2001-11-13 22:48 UTC (permalink / raw)
  To: linux-kernel

On Tue, 2001-11-13 at 10:08, Richard B. Johnson wrote:
> >    Device Boot    Start       End    Blocks   Id  System
> > /dev/hda1   *         1       523   4200966    c  Win95 FAT32 (LBA)
> > /dev/hda2           524       525     16065   83  Linux
> > /dev/hda3           526      2647  17044965   83  Linux
> > /dev/hda4          2648      3736   8747392+   5  Extended
> > /dev/hda5          2648      2713    530113+  82  Linux swap
> > /dev/hda6          2714      3736   8217216    c  Win95 FAT32 (LBA)
> The extended partition goes from 2648 to 3736. The first part of
> this extended partition from 2648 to 2713 is swap. The second part
> of 2714 to 3736 is the FAT32 partition. It looks as though M$ tries
> to use the swap area, ignoring the 82 code for Linux swap. This
> may be why the M$ partition gets trashed. To test this theory,
> disable swap on this drive (comment it out in /etc/fstab). Re-do
> the M$ partition and see if it remains clean. If it remains
> clean, then do a `mkswap` from Linux. Reboot to M$ and verify that
> the last partition is now corrupt. This will show that M$ is
> trying to use the swap area. If it is, re-fdisk the extended
> partition to put Linux swap at the end instead of the beginning.

Yes, well, the problem is more serious than that, since formatting the
windows partition will write unwanted stuff to my main linux partition
as well. This partition is 17GB, but less than 3GB is used. Unless
reiserfs writes stuff all over the place, there shouldn't be data
anywhere near the end of this partition. 

Anyway, I don't want to kill off random files on my linux partition if
there is some other way to test this.

BTW, sfdisk -l -x /dev/hda says:

Disk /dev/hda: 3736 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from
0

   Device Boot Start     End   #cyls   #blocks   Id  System
/dev/hda1   *      0+    522     523-  4200966    c  Win95 FAT32 (LBA)
/dev/hda2        523     524       2     16065   83  Linux
/dev/hda3        525    2646    2122  17044965   83  Linux
/dev/hda4       2647    3735    1089   8747392+   5  Extended

/dev/hda5       2647+   2712      66-   530113+  82  Linux swap
    -           2713    3735    1023   8217247+   5  Extended
    -           2647    2646       0         0    0  Empty
    -           2647    2646       0         0    0  Empty

/dev/hda6       2713+   3735    1023-  8217216    c  Win95 FAT32 (LBA)
    -           2713    2712       0         0    0  Empty
    -           2713    2712       0         0    0  Empty
    -           2713    2712       0         0    0  Empty

cc to me, I'm not on the list.

Robert


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Probably OT] Re: Odd partition overlapping problem
  2001-11-13 14:45 ` Odd partition overlapping problem Robert A H Holmberg
  2001-11-13 15:08   ` Richard B. Johnson
@ 2001-11-13 22:51   ` Robert Holmberg
  2001-11-14 11:08   ` Guest section DW
  2 siblings, 0 replies; 7+ messages in thread
From: Robert Holmberg @ 2001-11-13 22:51 UTC (permalink / raw)
  To: linux-kernel

On Tue, 2001-11-13 at 09:56, Tontsan Botti Account wrote:
> The problem is most likely the LBA partition format. Win98 sees
> the disk somehow diffrently. I had the same prob with my laptop. 
> After changing the type to non LBA one it worked for me..

Alright, I'll try this. Thanks.

Please cc to me, I'm not on the list,

Robert


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OT] Odd partition overlapping problem
  2001-11-14 15:02       ` [OT] " Robert Holmberg
@ 2001-11-14 11:02         ` Guest section DW
  0 siblings, 0 replies; 7+ messages in thread
From: Guest section DW @ 2001-11-14 11:02 UTC (permalink / raw)
  To: Robert Holmberg, linux-kernel

On Wed, Nov 14, 2001 at 10:02:59AM -0500, Robert Holmberg wrote:

> It seems my hda 6 is overlapping my hda4.
> 
> Partition table: 
> Device 	  Boot    Start       End    Blocks   Id  System
> /dev/hda1   *         1       523   4200966    c  Win95 FAT32 (LBA)
> /dev/hda2           524       525     16065   83  Linux
> /dev/hda3           526      2647  17044965   83  Linux
> /dev/hda4          2648      3736   8747392+   5  Extended
> /dev/hda5          2648      2713    530113+  82  Linux swap
> /dev/hda6          2714      3736   8217216    c  Win95 FAT32 (LBA)

There is nothing wrong with this partition table,
from a Linux point of view.

But lots of things may be wrong in the Windows - Linux cooperation.

Windows has its own data independent of the partition table.
So, if you change the partition table Windows may still use
the original partitioning.

Something else that may be bad: type 5 becomes type f when LBA
should be used. Since you are past cylinder 1024 you do not
want the CHS data to be used.

Something else that may be bad: DOS/Windows expects that type 5/f is
their own. At least the first partition in an extended should
be a DOS/Windows one, otherwise some programs will be unhappy.

Etc.

Try first f instead of 5, that is the easiest change.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Odd partition overlapping problem
  2001-11-13 14:45 ` Odd partition overlapping problem Robert A H Holmberg
  2001-11-13 15:08   ` Richard B. Johnson
  2001-11-13 22:51   ` [Probably OT] " Robert Holmberg
@ 2001-11-14 11:08   ` Guest section DW
  2 siblings, 0 replies; 7+ messages in thread
From: Guest section DW @ 2001-11-14 11:08 UTC (permalink / raw)
  To: Robert A H Holmberg, linux-kernel

On Tue, Nov 13, 2001 at 04:45:35PM +0200, Robert A H Holmberg wrote:

> I partitioned the drive with linux fdisk, since I don't trust dos fdisk.

But Linux fdisk and DOS FDISK do not have precisely the same function.
Linux fdisk only writes the partition table. DOS FDISK also writes
boot sector information. Generally, you should use the fdisk type
program belonging to OS X before installing OS X.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OT] Odd partition overlapping problem
  2001-11-13 22:48     ` [Probably OT] " Robert Holmberg
@ 2001-11-14 15:02       ` Robert Holmberg
  2001-11-14 11:02         ` Guest section DW
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Holmberg @ 2001-11-14 15:02 UTC (permalink / raw)
  To: linux-kernel

On Wed, 2001-11-14 at 02:48, Andrew Ebling wrote:
> Did you by any chance format/partition the disk using Linux Mandrake
> 7.1/7.2 at some point in the past?  I had a similar problem and
> eventually traced it back to a bug in the Mandrake installer which
> creates overlapping partitions.  I realised after running defrag in
> windows, which quite happily defragmented the first 200MB of my Linux
> partition!

Ouch. I used Mandrake 8.0... It seems my hda 6 os overlapping my hda4.
If I delete my extended partition, restart to windows and use dos fdisk
to create a new d:, there is the risk of this d: overwriting something
more important than my evolution install. I'm going to try this anyway.
I can always set up a swap *file* instead.

Partition table: 
Device 	  Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       523   4200966    c  Win95 FAT32 (LBA)
/dev/hda2           524       525     16065   83  Linux
/dev/hda3           526      2647  17044965   83  Linux
/dev/hda4          2648      3736   8747392+   5  Extended
/dev/hda5          2648      2713    530113+  82  Linux swap
/dev/hda6          2714      3736   8217216    c  Win95 FAT32 (LBA)

Please cc to me, I'm not on the list.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-11-14 11:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20011113165624.A28398@cyclone.neutech.fi>
2001-11-13 14:45 ` Odd partition overlapping problem Robert A H Holmberg
2001-11-13 15:08   ` Richard B. Johnson
2001-11-13 22:48     ` [Probably OT] " Robert Holmberg
2001-11-14 15:02       ` [OT] " Robert Holmberg
2001-11-14 11:02         ` Guest section DW
2001-11-13 22:51   ` [Probably OT] " Robert Holmberg
2001-11-14 11:08   ` Guest section DW

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).