bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems when there are unallocated space in the beginning of an extende


From: Håkon Løvdal
Subject: Problems when there are unallocated space in the beginning of an extended partition?
Date: Tue, 11 Jan 2005 22:48:55 +0100
User-agent: Internet Messaging Program (IMP) 3.1

Hi list.

Summary
=======

I suspect that parted maybe does some incorrect calculations
when there are unallocated space in the beginning of an
extended partition.


Introduction
============

A few days ago Rico sent a mail asking for help to undelete
a FAT32 partition that he had deleted unwillingly while
deleting some linux partitions. I have exchanged some mails
with him and helped him finding the start/end cylinders for
the deleted partitions. Recreating them/finding the FAT32
partition remains, but I assume we will manage that.

However, while working with this I noticed that there was some
errors in the partition tables for the logical partitions.

I cannot say for sure that parted is the guilty one because I
do not know how the partition table was initially, but since
parted was used to delete some of the partitions, it is at
least a suspect :)

Also I am not sure that this is due to the unallocated space in
front, but that would at least provide a plausible explanation.


Details
=======

The disk has the following layout:

                Disk /dev/hde (CHS=15017/255/63)

                   +------------------------+
                 0 |          hde1          |  20003 Mb
              2549 |                        |
     + - - - - - - +------------------------+
     .        2550 |                        |
     .             |       freespace        |  29996 Mb
     .        6373 |                        |
     .             +------------------------+
     .        6374 |          hde5          |  20003 Mb
     .        8923 |                        |
  h d e 2          +------------------------+
     .        8924 |          hde6          |  19995 Mb
     .       11472 |                        |
     .             +------------------------+
     .       11473 |                        |
     .             |          hde7          |  27800 Mb
     .       15016 |                        |
     + - - - - - - +------------------------+


The full printout of the physical tables on the disk is the following:
(also attached as a file since wrapping probably will destroy it)

################################################################################
#                                                                      
       #
#           Partition table printout for /dev/hde (CHS=15017/255/63)   
       #
#             generated 2005-01-07 10:40 by printpar version 1.1.3     
       #
#                                                                      
       #
################################################################################

        Partition table at Master Boot Record (CHS=0/0/1) offset 0x1BE
+--------+--------+---------------+------+---------------+----------+----------+
| parti- |        |     Start     |      |      End      | Relative
|Number of |
| tion   |bootable|Head Cyl Sector|System|Head Cyl Sector|Start Sect|
Sectors  |
+--------+--------+---------------+------+---------------+----------+----------+
|  hde1  |  0x80  |   1     0   1 | 0x0C | 254  1023  63 |       63 |
40965687 |
|  hde2  |  0x00  | 254  1023  63 | 0x0F | 254  1023  63 | 40965750 |
200282355 |
|  hde3  |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
|  hde4  |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
+--------+--------+---------------+------+---------------+----------+----------+

        Drive table at sector CHS=2550/0/1 offset 0x1BE
+--------+--------+---------------+------+---------------+----------+----------+
| parti- |        |     Start     |      |      End      | Relative
|Number of |
| tion   |bootable|Head Cyl Sector|System|Head Cyl Sector|Start Sect|
Sectors  |
+--------+--------+---------------+------+---------------+----------+----------+
|  hde5  |  0x00  | 254  1023  63 | 0x0C | 254  1023  63 | 61432560 |
40965750 |
|        |  0x00  | 254  1023  63 | 0x05 | 254  1023  63 | 102398372 |
40949623 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
+--------+--------+---------------+------+---------------+----------+----------+

        Drive table at sector CHS=8924/0/63 offset 0x1BE
+--------+--------+---------------+------+---------------+----------+----------+
| parti- |        |     Start     |      |      End      | Relative
|Number of |
| tion   |bootable|Head Cyl Sector|System|Head Cyl Sector|Start Sect|
Sectors  |
+--------+--------+---------------+------+---------------+----------+----------+
|  hde6  |  0x00  | 254  1023  63 | 0x0C | 254  1023  63 |        1 |
40949622 |
|        |  0x00  | 254  1023  63 | 0x05 | 254  1023  63 | 143348057 |
56934298 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
+--------+--------+---------------+------+---------------+----------+----------+

        Drive table at sector CHS=11473/0/63 offset 0x1BE
+--------+--------+---------------+------+---------------+----------+----------+
| parti- |        |     Start     |      |      End      | Relative
|Number of |
| tion   |bootable|Head Cyl Sector|System|Head Cyl Sector|Start Sect|
Sectors  |
+--------+--------+---------------+------+---------------+----------+----------+
|  hde7  |  0x00  | 254  1023  63 | 0x0C | 254  1023  63 |        1 |
56934297 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
|        |     0  |   0     0   0 |    0 |   0     0   0 |        0 |  
     0 |
+--------+--------+---------------+------+---------------+----------+----------+


All the tables except MBR are not like expected.

The primary hde2 partition matches a whole number of cylinders
(like it should). The physical first and the logical partitions
match a whole number of cylinders minus one head (like they
should) with the exception of hde5 where the number of sectors,
40965750, is wrong because it should have been 63 sectors lower,
i.e. 40965687.

hde1:   40965687 + 63 =  40965750 =  2550 * 255 * 63
hde2:                   200282355 = 12467 * 255 * 63
hde5:   40965750 +  0 =  40965750 =  2550 * 255 * 63 !!!
hde6:   40949622 + 63 =  40949685 =  2549 * 255 * 63
hde7:   56934297 + 63 =  56934360 =  3544 * 255 * 63

The unallocated space in front of hde5 is 
6373 - 2550 + 1 = 3824 cylinders which
equals 3824 * 255 * 63 = 61432560 sectors.

That gives an expected relative start sector of
61432560 + 63 = 61432623 for hde5, but the table shows that
it has a RSS of just 61432560, so hde5 starts on head 0
(instead of 1) on its first cylinder.

Notice that the table that defines hde5 lies at the very
beginning of the extended partition (on the start of cylinder
2550) and not at the start of the first cylinder of the space
that hde5 occupies (i.e. cylinder 6374).

Could this be the cause? Do we have an error here?


Then for the tables for hde6 and hde7 they are skewed by 63
sectors, and the tables are not placed on cylinder boundaries
(CHS=8924/0/63 and CHS=11473/0/63) and hde6 and hde7 then gets
an unusual relative start sector value of 1.

I do not know if this is another error or just errors caused
by the hde5 partition.


Comments? Rico mentioned that he had used an old rescue disk
from around 2001. I guess it would be useful to get the exact
version number for parted. Could you supply us with that Rico?


BR Håkon Løvdal

Attachment: partition_table_hde.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]