mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Fail to register logical partition because it overlaps with the extended partition
@ 2023-12-04 15:04 Victor BERTIN
  2023-12-05 10:34 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Victor BERTIN @ 2023-12-04 15:04 UTC (permalink / raw)
  To: barebox

Hello All,

We are using Barebox v2022.12.0 on a MSC SM2S-IMX8MP SoM.

We witness an error happening when registering the first logical partition of our extended partition :
ERROR: New partition mmc2.4 (0x46600400-0xc68003ff) on mmc2 overlaps with partition mmc2.3 (0x46600200-0x466005ff), not creating it
ERROR: mmc2: Failed to register partition 4 on mmc2 (-22)

However, Linux does not complain and all partitions are properly registered :
[root@imx8-evo:~]# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk2      179:0    0 14.6G  0 disk
|-mmcblk2p1  179:1    0   66M  0 part
|-mmcblk2p2  179:2    0    1G  0 part /
|-mmcblk2p3  179:3    0   34M  0 part /rwdisk/systemrw
|-mmcblk2p4  179:4    0    1K  0 part
|-mmcblk2p5  179:5    0    2G  0 part /rwdisk/app
|-mmcblk2p6  179:6    0  130M  0 part /var/log
`-mmcblk2p7  179:7    0   32M  0 part /rwdisk/conf
mmcblk2boot0 179:32   0    4M  1 disk
mmcblk2boot1 179:64   0    4M  1 disk

Since 84ea37e4580cabc2a49edc4e2c62b45a752771fc, extended partitions are registered with a size of 2 sectors. Our extended partition still manages to overlap with the first logical partition that it contains.
A simple trick is to reduce the registration size to 1 sector, however we are not sure of the side effects of such change.

Any idea why such issue could happen ?

Thanks in advance for your help,

Victor Bertin

Witekio GmbH is registered in Frankfurt. Registered office: Am Wartfeld 7 - 61169 Friedberg. Registered company number: HRB 95432. VAT number DE287400071
This message contains confidential information and is intended only for the individual(s) addressed in the message. If you aren't the named addressee, you should not disseminate, distribute, or copy this e-mail.

We continuously commit to comply with the applicable data protection laws and ensure fair and transparent processing of your personal data. Please read our privacy statement including an information notice and data protection policy for detailed information on our website.



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

* Re: Fail to register logical partition because it overlaps with the extended partition
  2023-12-04 15:04 Fail to register logical partition because it overlaps with the extended partition Victor BERTIN
@ 2023-12-05 10:34 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-12-05 10:34 UTC (permalink / raw)
  To: Victor BERTIN; +Cc: barebox

Hi Victor,

On Mon, Dec 04, 2023 at 03:04:37PM +0000, Victor BERTIN wrote:
> Hello All,
> 
> We are using Barebox v2022.12.0 on a MSC SM2S-IMX8MP SoM.
> 
> We witness an error happening when registering the first logical partition of our extended partition :
> ERROR: New partition mmc2.4 (0x46600400-0xc68003ff) on mmc2 overlaps with partition mmc2.3 (0x46600200-0x466005ff), not creating it
> ERROR: mmc2: Failed to register partition 4 on mmc2 (-22)
> 
> However, Linux does not complain and all partitions are properly registered :
> [root@imx8-evo:~]# lsblk
> NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
> mmcblk2      179:0    0 14.6G  0 disk
> |-mmcblk2p1  179:1    0   66M  0 part
> |-mmcblk2p2  179:2    0    1G  0 part /
> |-mmcblk2p3  179:3    0   34M  0 part /rwdisk/systemrw
> |-mmcblk2p4  179:4    0    1K  0 part
> |-mmcblk2p5  179:5    0    2G  0 part /rwdisk/app
> |-mmcblk2p6  179:6    0  130M  0 part /var/log
> `-mmcblk2p7  179:7    0   32M  0 part /rwdisk/conf
> mmcblk2boot0 179:32   0    4M  1 disk
> mmcblk2boot1 179:64   0    4M  1 disk
> 
> Since 84ea37e4580cabc2a49edc4e2c62b45a752771fc, extended partitions
> are registered with a size of 2 sectors. Our extended partition still
> manages to overlap with the first logical partition that it contains.
> A simple trick is to reduce the registration size to 1 sector, however
> we are not sure of the side effects of such change.

I don't think this has any side effects. In the end an extended
partition is just a container for logical partitions and should not be
used directly anyway.

I just realized we do not check if the logical partitions actually fit
into the extended partition. It might be better do handle the logical
partitions as children of the extended partition, but I am currently not
very familiar with the code. Anyway, until we are there feel free to
send a patch changing the size of an extended partition to 1 sector.

> 
> Any idea why such issue could happen ?

I am not sure if Linux checks for overlapping partitions at all. From
looking at the code I'd say no.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-12-05 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 15:04 Fail to register logical partition because it overlaps with the extended partition Victor BERTIN
2023-12-05 10:34 ` Sascha Hauer

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