bug-parted
[Top][All Lists]
Advanced

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

Re: parted Error: Unable to align partition


From: Andrew Clausen
Subject: Re: parted Error: Unable to align partition
Date: Thu, 26 Oct 2000 17:44:49 +1100

address@hidden wrote:
> 
>   I get the following error message from parted
>  
> |--------------------------------------------------------------------------------
>  |(bash) parted /dev/hda
>  |Using /dev/hda
>  |Warning: The operating system thinks the geometry on /dev/hda is 525/128/63.
>  |You should check that this matches the BIOS geometry before using this 
> program.
>  |(parted) print
>  |Warning: The partition table on /dev/hda is inconsistent.  There are many
>  |reasons why this might be the case.  Often, the reason is that Linux 
> detected
>  |the BIOS geometry incorrectly.  However, this does not appear to be the case
>  |here.
>  |Ignore Cancel ? Ignore
>  |Error: Unable to align partition.
>  |(parted) cp 1 /dev/hde 2
>  |Error: Unable to align partition.

The problem is: your partitions don't start at the beginning of
cylinder boundaries.  Parted can't manipulate partition tables like
this (yet).

However, if you want to copy a partition, you don't have to use
the partition table (!).

Eg:

        # parted /dev/hda1 cp /dev/hde 2
 
|--------------------------------------------------------------------------------
> 
>    I am using:
>    -----------
>       Debian 2.0 with ( libc 2.0.7, Kernel 2.033 )
> 
>       tried parted versions:
>        from   parted_1.2.8
>        up to  parted_1.4.0_pre2 (the error message shown above is the one
>                                  of version 1.4.0_pre2 )
> 
>          ./configure  --without-readline --disable-nls --disable-shared
>           I had to comment in libparted/device.c:233 ff
>            [ BLKSSZGET is unknown to kernel 2.033 )
>            
> |----------------------------------------------------------------------
>            |/*
>            |if (_get_linux_version() < 0x203)    /* BLKSSZGET is broken < 
> 2.3.x */
>            |
>            |        return 512;
>            |/*
>            |if (ioctl (dev->fd, BLKSSZGET, &sector_size))
>            |        return 512;
>            |        */
>            
> |----------------------------------------------------------------------
> 
>     # fdisk /dev/hda
>     : x
>     : p
>     : q
> 
>      results in:  (commented)
>    |------------------------------------------------------------
>    |Disk /dev/hda: 128 heads, 63 sectors, 525 cylinders
>    |
>    |Nr AF  Hd Sec  Cyl  Hd Sec  Cyl   Start    Size ID
>    | 1 00   1   1    0 127  63  267      63 2161089 06
>                                             ^^^^^^^=(267+1)*63*128- 63
>    | 2 00   0   1  268 127  63  280 2161152  104832 82
>                                              ^^^^^^ = 128 *63*(280-268+1)
>    | 3 80   0   1  281 127  63  523 2265984 1967616 83
>            ^^^^^^^^^^^^^^^^^^^^^^^^ phys    ^^^^^^^ logical size
>                                             128 *63*(524-281+2) =1967616
>                                 ^^^^WRONG = 128 *63*(523-281+1) =1959552
>    |Partition 3 has different physical/logical endings:
>    |     phys=(523, 127, 63) logical=(524, 127, 63)
>    | 4 00   0   0    0   0   0    0       0       0 00
>    |------------------------------------------------------------
> 
>     I attached the partition table
>     (dd if=/dev/hda of=parttable bs=512 count=1)
> 
>    a) The disk itself has 525 Cylinders (= Cylinder 0-524)
>      --> it should be  possible to correct/resize the number this error
>          in the partition table.
>          (which space is really used by the OS ?
>           if physical:  lower logical space
>           if logical :  increase number of heads
> ???  is there a tool which allows savly to correct the
>      partition table while using this partition ?

Parted can do this, and there is also a program called gpart (see
the parted docs for URLs, etc.).  The reason why Parted can't handle
your problem is the partition isn't aligned to cylinder boundaries.
 
>    b) I only want to copy the first partition.
>        So partition 3 should not be affected.
> ???    --> why can parted not ignore this error ?

Because of metadata allocation issues...  it's a difficult problem,
but I think I'll be able to hack around it ;-)  Not enough time now,
though :-(

Andrew Clausen



reply via email to

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