public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* fdisk: reorder (cmd) bug with logical partitions.
@ 2013-05-21 22:04 Gerardo Exequiel Pozzi
  2013-07-01 14:49 ` Gerardo Exequiel Pozzi
  0 siblings, 1 reply; 2+ messages in thread
From: Gerardo Exequiel Pozzi @ 2013-05-21 22:04 UTC (permalink / raw)
  To: util-linux, Davidlohr Bueso

[-- Attachment #1: Type: text/plain, Size: 5466 bytes --]

Hello


The reorder cmd (x->f) does not work propertly. A fdisk session example
for better description is attached.

See how the last partion "coco9" that should be "coco6" after re-order,
keeps with the same name, but with start-sector and end-sector with
incorrect values and outside the upper limit of the extended "coco4" and
the disk "coco" itself.


Good luck!


$ uname -a
Linux exequiel 3.8.13-64 #1 SMP PREEMPT Fri May 17 18:52:27 ART 2013
x86_64 GNU/Linux
$ cat pepe
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=     2048, size=   131072, Id=83, bootable
/dev/sda2 : start=   133120, size= 41943040, Id=83
/dev/sda3 : start= 42076160, size= 41943040, Id=83
/dev/sda4 : start= 84019200, size=3823009968, Id= 5
/dev/sda5 : start= 84021248, size=  8388608, Id=82
/dev/sda6 : start= 92411904, size=  8388608, Id=83
/dev/sda7 : start=100802560, size=  8388608, Id=83
/dev/sda8 : start=109193216, size=  8388608, Id=83
/dev/sda9 : start=117583872, size=  8388608, Id=83
/dev/sda10: start=125974528, size=1258291200, Id=83
/dev/sda11: start=1384267776, size=2097152000, Id=83
/dev/sda12: start=3481421824, size=425607344, Id=83
$ truncate --size 2000398934016 coco
$ sfdisk coco < pepe
<...>
$ fdisk coco
Welcome to fdisk (util-linux 2.23).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk coco: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
 coco1   *        2048      133119       65536   83  Linux
 coco2          133120    42076159    20971520   83  Linux
 coco3        42076160    84019199    20971520   83  Linux
 coco4        84019200  3907029167  1911504984    5  Extended
 coco5        84021248    92409855     4194304   82  Linux swap / Solaris
 coco6        92411904   100800511     4194304   83  Linux
 coco7       100802560   109191167     4194304   83  Linux
 coco8       109193216   117581823     4194304   83  Linux
 coco9       117583872   125972479     4194304   83  Linux
 coco10      125974528  1384265727   629145600   83  Linux
 coco11     1384267776  3481419775  1048576000   83  Linux
 coco12     3481421824  3907029167   212803672   83  Linux

Command (m for help): d
Partition number (1-12, default 12): 9
Partition 9 is deleted

Command (m for help): d
Partition number (1-11, default 11): 8
Partition 8 is deleted

Command (m for help): d
Partition number (1-10, default 10): 7
Partition 7 is deleted

Command (m for help): d
Partition number (1-9, default 9): 6
Partition 6 is deleted

Command (m for help): p

<...>

Device Boot      Start         End      Blocks   Id  System
 coco1   *        2048      133119       65536   83  Linux
 coco2          133120    42076159    20971520   83  Linux
 coco3        42076160    84019199    20971520   83  Linux
 coco4        84019200  3907029167  1911504984    5  Extended
 coco5        84021248    92409855     4194304   82  Linux swap / Solaris
 coco6       125974528  1384265727   629145600   83  Linux
 coco7      1384267776  3481419775  1048576000   83  Linux
 coco8      3481421824  3907029167   212803672   83  Linux

Command (m for help): n
All primary partitions are in use
Adding logical partition 9
First sector (92411904-3907029167, default 92411904):
Using default value 92411904
Last sector, +sectors or +size{K,M,G} (92411904-125972479, default
125972479):
Using default value 125972479
Partition 9 of type Linux and of size 16 GiB is set

Command (m for help): p

<...>

Device Boot      Start         End      Blocks   Id  System
 coco1   *        2048      133119       65536   83  Linux
 coco2          133120    42076159    20971520   83  Linux
 coco3        42076160    84019199    20971520   83  Linux
 coco4        84019200  3907029167  1911504984    5  Extended
 coco5        84021248    92409855     4194304   82  Linux swap / Solaris
 coco6       125974528  1384265727   629145600   83  Linux
 coco7      1384267776  3481419775  1048576000   83  Linux
 coco8      3481421824  3907029167   212803672   83  Linux
 coco9        92411904   125972479    16780288   83  Linux

Partition table entries are not in disk order

Command (m for help): x

Expert command (m for help): f
Done.

Expert command (m for help): r

Command (m for help): p

<...>

Device Boot      Start         End      Blocks   Id  System
 coco1   *        2048      133119       65536   83  Linux
 coco2          133120    42076159    20971520   83  Linux
 coco3        42076160    84019199    20971520   83  Linux
 coco4        84019200  3907029167  1911504984    5  Extended
 coco5        84021248    92409855     4194304   82  Linux swap / Solaris
 coco6       125974528  1384265727   629145600   83  Linux
 coco7      1384267776  3481419775  1048576000   83  Linux
 coco8      3481421824  3907029167   212803672   83  Linux
 coco9      4387379200  4420939775    16780288   83  Linux

Command (m for help): v
Logical partition 9 not entirely in partition 4
Remaining 12282 unallocated 512-byte sectors




-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 555 bytes --]

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

* Re: fdisk: reorder (cmd) bug with logical partitions.
  2013-05-21 22:04 fdisk: reorder (cmd) bug with logical partitions Gerardo Exequiel Pozzi
@ 2013-07-01 14:49 ` Gerardo Exequiel Pozzi
  0 siblings, 0 replies; 2+ messages in thread
From: Gerardo Exequiel Pozzi @ 2013-07-01 14:49 UTC (permalink / raw)
  To: util-linux, Karel Zak

[-- Attachment #1: Type: text/plain, Size: 5897 bytes --]

Looks like this message was ignored. Resending as remainder.


On 05/21/2013 07:04 PM, Gerardo Exequiel Pozzi wrote:
> Hello
> 
> 
> The reorder cmd (x->f) does not work propertly. A fdisk session example
> for better description is attached.
> 
> See how the last partion "coco9" that should be "coco6" after re-order,
> keeps with the same name, but with start-sector and end-sector with
> incorrect values and outside the upper limit of the extended "coco4" and
> the disk "coco" itself.
> 
> 
> Good luck!
> 
> 
> $ uname -a
> Linux exequiel 3.8.13-64 #1 SMP PREEMPT Fri May 17 18:52:27 ART 2013
> x86_64 GNU/Linux
> $ cat pepe
> # partition table of /dev/sda
> unit: sectors
> 
> /dev/sda1 : start=     2048, size=   131072, Id=83, bootable
> /dev/sda2 : start=   133120, size= 41943040, Id=83
> /dev/sda3 : start= 42076160, size= 41943040, Id=83
> /dev/sda4 : start= 84019200, size=3823009968, Id= 5
> /dev/sda5 : start= 84021248, size=  8388608, Id=82
> /dev/sda6 : start= 92411904, size=  8388608, Id=83
> /dev/sda7 : start=100802560, size=  8388608, Id=83
> /dev/sda8 : start=109193216, size=  8388608, Id=83
> /dev/sda9 : start=117583872, size=  8388608, Id=83
> /dev/sda10: start=125974528, size=1258291200, Id=83
> /dev/sda11: start=1384267776, size=2097152000, Id=83
> /dev/sda12: start=3481421824, size=425607344, Id=83
> $ truncate --size 2000398934016 coco
> $ sfdisk coco < pepe
> <...>
> $ fdisk coco
> Welcome to fdisk (util-linux 2.23).
> 
> Changes will remain in memory only, until you decide to write them.
> Be careful before using the write command.
> 
> 
> Command (m for help): p
> 
> Disk coco: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk label type: dos
> Disk identifier: 0x00000000
> 
> Device Boot      Start         End      Blocks   Id  System
>  coco1   *        2048      133119       65536   83  Linux
>  coco2          133120    42076159    20971520   83  Linux
>  coco3        42076160    84019199    20971520   83  Linux
>  coco4        84019200  3907029167  1911504984    5  Extended
>  coco5        84021248    92409855     4194304   82  Linux swap / Solaris
>  coco6        92411904   100800511     4194304   83  Linux
>  coco7       100802560   109191167     4194304   83  Linux
>  coco8       109193216   117581823     4194304   83  Linux
>  coco9       117583872   125972479     4194304   83  Linux
>  coco10      125974528  1384265727   629145600   83  Linux
>  coco11     1384267776  3481419775  1048576000   83  Linux
>  coco12     3481421824  3907029167   212803672   83  Linux
> 
> Command (m for help): d
> Partition number (1-12, default 12): 9
> Partition 9 is deleted
> 
> Command (m for help): d
> Partition number (1-11, default 11): 8
> Partition 8 is deleted
> 
> Command (m for help): d
> Partition number (1-10, default 10): 7
> Partition 7 is deleted
> 
> Command (m for help): d
> Partition number (1-9, default 9): 6
> Partition 6 is deleted
> 
> Command (m for help): p
> 
> <...>
> 
> Device Boot      Start         End      Blocks   Id  System
>  coco1   *        2048      133119       65536   83  Linux
>  coco2          133120    42076159    20971520   83  Linux
>  coco3        42076160    84019199    20971520   83  Linux
>  coco4        84019200  3907029167  1911504984    5  Extended
>  coco5        84021248    92409855     4194304   82  Linux swap / Solaris
>  coco6       125974528  1384265727   629145600   83  Linux
>  coco7      1384267776  3481419775  1048576000   83  Linux
>  coco8      3481421824  3907029167   212803672   83  Linux
> 
> Command (m for help): n
> All primary partitions are in use
> Adding logical partition 9
> First sector (92411904-3907029167, default 92411904):
> Using default value 92411904
> Last sector, +sectors or +size{K,M,G} (92411904-125972479, default
> 125972479):
> Using default value 125972479
> Partition 9 of type Linux and of size 16 GiB is set
> 
> Command (m for help): p
> 
> <...>
> 
> Device Boot      Start         End      Blocks   Id  System
>  coco1   *        2048      133119       65536   83  Linux
>  coco2          133120    42076159    20971520   83  Linux
>  coco3        42076160    84019199    20971520   83  Linux
>  coco4        84019200  3907029167  1911504984    5  Extended
>  coco5        84021248    92409855     4194304   82  Linux swap / Solaris
>  coco6       125974528  1384265727   629145600   83  Linux
>  coco7      1384267776  3481419775  1048576000   83  Linux
>  coco8      3481421824  3907029167   212803672   83  Linux
>  coco9        92411904   125972479    16780288   83  Linux
> 
> Partition table entries are not in disk order
> 
> Command (m for help): x
> 
> Expert command (m for help): f
> Done.
> 
> Expert command (m for help): r
> 
> Command (m for help): p
> 
> <...>
> 
> Device Boot      Start         End      Blocks   Id  System
>  coco1   *        2048      133119       65536   83  Linux
>  coco2          133120    42076159    20971520   83  Linux
>  coco3        42076160    84019199    20971520   83  Linux
>  coco4        84019200  3907029167  1911504984    5  Extended
>  coco5        84021248    92409855     4194304   82  Linux swap / Solaris
>  coco6       125974528  1384265727   629145600   83  Linux
>  coco7      1384267776  3481419775  1048576000   83  Linux
>  coco8      3481421824  3907029167   212803672   83  Linux
>  coco9      4387379200  4420939775    16780288   83  Linux
> 
> Command (m for help): v
> Logical partition 9 not entirely in partition 4
> Remaining 12282 unallocated 512-byte sectors
> 
> 
> 
> 


-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 555 bytes --]

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

end of thread, other threads:[~2013-07-01 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21 22:04 fdisk: reorder (cmd) bug with logical partitions Gerardo Exequiel Pozzi
2013-07-01 14:49 ` Gerardo Exequiel Pozzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox