qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Bug 1910586] [NEW] SD card size constraint conceptually wrong
@ 2021-01-07 19:24 -
  2021-01-07 22:13 ` Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: - @ 2021-01-07 19:24 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

The patch discussed here:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
introduces an artificial size constraint for SD cards
that has no relation to reality.

I'm trying to use an _actual_ **physical** SD card,
and qemu tells me its size is "invalid".

Something here appears to be conceptually wrong.

--------------------------------------------------
# fdisk -l /dev/sdg
Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
Disk model: USB  SD Reader  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7a0c8bb0

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
/dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
# qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
qemu-system-aarch64: Invalid SD card size: 14.8 GiB
SD card size has to be a power of 2, e.g. 16 GiB.
You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
(note that this will lose data if you make the image smaller than it currently is).
--------------------------------------------------

The same invocation with a dump of the actual image
resized to match qemu's odd expectations works fine.


This is on QEMU 5.2.0, as evidenced by the following:
--------------------------------------------------
# qemu-system-aarch64 -version
QEMU emulator version 5.2.0
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
--------------------------------------------------

Is there a simple workaround that disables this rather
arbitrary constraint?

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  New

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

* Re: [Bug 1910586] [NEW] SD card size constraint conceptually wrong
  2021-01-07 19:24 [Bug 1910586] [NEW] SD card size constraint conceptually wrong -
@ 2021-01-07 22:13 ` Philippe Mathieu-Daudé
  2021-01-07 22:13   ` Philippe Mathieu-Daudé
  2021-01-08 18:31 ` [Bug 1910586] " -
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-07 22:13 UTC (permalink / raw)
  To: Bug 1910586, qemu-devel; +Cc: Qemu-block

On 1/7/21 8:24 PM, - wrote:
> Public bug reported:
> 
> The patch discussed here:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
> introduces an artificial size constraint for SD cards
> that has no relation to reality.
> 
> I'm trying to use an _actual_ **physical** SD card,
> and qemu tells me its size is "invalid".
> 
> Something here appears to be conceptually wrong.
> 
> --------------------------------------------------
> # fdisk -l /dev/sdg
> Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
> Disk model: USB  SD Reader  
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x7a0c8bb0
> 
> Device     Boot  Start      End  Sectors  Size Id Type
> /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
> /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
> # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
> qemu-system-aarch64: Invalid SD card size: 14.8 GiB
> SD card size has to be a power of 2, e.g. 16 GiB.

Your physical card likely is 16GiB. The firmware running
on it is free to reserve some amount to replace broken
blocks. In your case ~7%.

We choose to restrict the model to the physical layer to
simplify the design and avoid to deal with security issues.

Patches to improve the model by better matching the real
world are always welcomed!

> You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
> (note that this will lose data if you make the image smaller than it currently is).

Indeed, we can remove this warning for block devices.

> --------------------------------------------------
> 
> The same invocation with a dump of the actual image
> resized to match qemu's odd expectations works fine.
> 
> 
> This is on QEMU 5.2.0, as evidenced by the following:
> --------------------------------------------------
> # qemu-system-aarch64 -version
> QEMU emulator version 5.2.0
> Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
> --------------------------------------------------
> 
> Is there a simple workaround that disables this rather
> arbitrary constraint?

No, but you can send a patch :)

Regards,

Phil.


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

* Re: [Bug 1910586] [NEW] SD card size constraint conceptually wrong
  2021-01-07 22:13 ` Philippe Mathieu-Daudé
@ 2021-01-07 22:13   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-07 22:13 UTC (permalink / raw)
  To: qemu-devel

On 1/7/21 8:24 PM, - wrote:
> Public bug reported:
> 
> The patch discussed here:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
> introduces an artificial size constraint for SD cards
> that has no relation to reality.
> 
> I'm trying to use an _actual_ **physical** SD card,
> and qemu tells me its size is "invalid".
> 
> Something here appears to be conceptually wrong.
> 
> --------------------------------------------------
> # fdisk -l /dev/sdg
> Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
> Disk model: USB  SD Reader  
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x7a0c8bb0
> 
> Device     Boot  Start      End  Sectors  Size Id Type
> /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
> /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
> # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
> qemu-system-aarch64: Invalid SD card size: 14.8 GiB
> SD card size has to be a power of 2, e.g. 16 GiB.

Your physical card likely is 16GiB. The firmware running
on it is free to reserve some amount to replace broken
blocks. In your case ~7%.

We choose to restrict the model to the physical layer to
simplify the design and avoid to deal with security issues.

Patches to improve the model by better matching the real
world are always welcomed!

> You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
> (note that this will lose data if you make the image smaller than it currently is).

Indeed, we can remove this warning for block devices.

> --------------------------------------------------
> 
> The same invocation with a dump of the actual image
> resized to match qemu's odd expectations works fine.
> 
> 
> This is on QEMU 5.2.0, as evidenced by the following:
> --------------------------------------------------
> # qemu-system-aarch64 -version
> QEMU emulator version 5.2.0
> Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
> --------------------------------------------------
> 
> Is there a simple workaround that disables this rather
> arbitrary constraint?

No, but you can send a patch :)

Regards,

Phil.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  New

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

* [Bug 1910586] Re: SD card size constraint conceptually wrong
  2021-01-07 19:24 [Bug 1910586] [NEW] SD card size constraint conceptually wrong -
  2021-01-07 22:13 ` Philippe Mathieu-Daudé
@ 2021-01-08 18:31 ` -
  2021-02-20  0:07 ` Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: - @ 2021-01-08 18:31 UTC (permalink / raw)
  To: qemu-devel

> Indeed, we can remove this warning for block devices.

Couldn't you simply remove the entire size check logic for block
devices?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  New

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

* [Bug 1910586] Re: SD card size constraint conceptually wrong
  2021-01-07 19:24 [Bug 1910586] [NEW] SD card size constraint conceptually wrong -
  2021-01-07 22:13 ` Philippe Mathieu-Daudé
  2021-01-08 18:31 ` [Bug 1910586] " -
@ 2021-02-20  0:07 ` Philippe Mathieu-Daudé
  2021-05-12 11:08 ` Thomas Huth
  2021-05-14 12:33 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-20  0:07 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  Confirmed

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

* [Bug 1910586] Re: SD card size constraint conceptually wrong
  2021-01-07 19:24 [Bug 1910586] [NEW] SD card size constraint conceptually wrong -
                   ` (2 preceding siblings ...)
  2021-02-20  0:07 ` Philippe Mathieu-Daudé
@ 2021-05-12 11:08 ` Thomas Huth
  2021-05-14 11:50   ` -
  2021-05-14 12:33 ` Philippe Mathieu-Daudé
  4 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2021-05-12 11:08 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently moving its bug tracking to another system.
For this we need to know which bugs are still valid and which could be
closed already. Thus we are setting the bug state to "Incomplete" now.

If the bug has already been fixed in the latest upstream version of QEMU,
then please close this ticket as "Fix released".

If it is not fixed yet and you think that this bug report here is still
valid, then you have two options:

1) If you already have an account on gitlab.com, please open a new ticket
for this problem in our new tracker here:

    https://gitlab.com/qemu-project/qemu/-/issues

and then close this ticket here on Launchpad (or let it expire auto-
matically after 60 days). Please mention the URL of this bug ticket on
Launchpad in the new ticket on GitLab.

2) If you don't have an account on gitlab.com and don't intend to get
one, but still would like to keep this ticket opened, then please switch
the state back to "New" or "Confirmed" within the next 60 days (other-
wise it will get closed as "Expired"). We will then eventually migrate
the ticket automatically to the new system (but you won't be the reporter
of the bug in the new system and thus you won't get notified on changes
anymore).

Thank you and sorry for the inconvenience.


** Changed in: qemu
       Status: Confirmed => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  Incomplete

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

* Re: [Bug 1910586] Re: SD card size constraint conceptually wrong
  2021-05-12 11:08 ` Thomas Huth
@ 2021-05-14 11:50   ` -
  0 siblings, 0 replies; 8+ messages in thread
From: - @ 2021-05-14 11:50 UTC (permalink / raw)
  To: qemu-devel

On Wed, May 12, 2021 at 11:08:09AM -0000, Thomas Huth wrote:
> 
> If it is not fixed yet and you think that this bug report here is still
> valid, then you have two options:

Actually, you seem to have forgotten a third option: I simply don't care
enough, especially after the patronizing response to my original report,
to bother.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  Incomplete

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

* [Bug 1910586] Re: SD card size constraint conceptually wrong
  2021-01-07 19:24 [Bug 1910586] [NEW] SD card size constraint conceptually wrong -
                   ` (3 preceding siblings ...)
  2021-05-12 11:08 ` Thomas Huth
@ 2021-05-14 12:33 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-14 12:33 UTC (permalink / raw)
  To: qemu-devel

This is an automated cleanup. This bug report has been moved to QEMU's
new bug tracker on gitlab.com and thus gets marked as 'invalid' now.
Please continue with the discussion here:

 https://gitlab.com/qemu-project/qemu/-/issues/297


** Changed in: qemu
       Status: Incomplete => Confirmed

** Changed in: qemu
       Status: Confirmed => Invalid

** Bug watch added: gitlab.com/qemu-project/qemu/-/issues #297
   https://gitlab.com/qemu-project/qemu/-/issues/297

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1910586

Title:
  SD card size constraint conceptually wrong

Status in QEMU:
  Invalid

Bug description:
  The patch discussed here:
  https://www.mail-archive.com/qemu-devel@nongnu.org/msg720833.html
  introduces an artificial size constraint for SD cards
  that has no relation to reality.

  I'm trying to use an _actual_ **physical** SD card,
  and qemu tells me its size is "invalid".

  Something here appears to be conceptually wrong.

  --------------------------------------------------
  # fdisk -l /dev/sdg
  Disk /dev/sdg: 14.84 GiB, 15931539456 bytes, 31116288 sectors
  Disk model: USB  SD Reader  
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x7a0c8bb0

  Device     Boot  Start      End  Sectors  Size Id Type
  /dev/sdg1         2048   524287   522240  255M  c W95 FAT32 (LBA)
  /dev/sdg2       524288 31116287 30592000 14.6G 83 Linux
  # qemu-system-aarch64 -M raspi3 -m 1G -kernel vmlinuz-5.4.79-v8 -dtb bcm2837-rpi-3-b-plus.dtb -append console=ttyAMA0\ root=/dev/mmcblk0p2\ rw -nographic -serial mon:stdio -drive file=/dev/sdg,format=raw
  qemu-system-aarch64: Invalid SD card size: 14.8 GiB
  SD card size has to be a power of 2, e.g. 16 GiB.
  You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
  (note that this will lose data if you make the image smaller than it currently is).
  --------------------------------------------------

  The same invocation with a dump of the actual image
  resized to match qemu's odd expectations works fine.

  
  This is on QEMU 5.2.0, as evidenced by the following:
  --------------------------------------------------
  # qemu-system-aarch64 -version
  QEMU emulator version 5.2.0
  Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
  --------------------------------------------------

  Is there a simple workaround that disables this rather
  arbitrary constraint?

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1910586/+subscriptions


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

end of thread, other threads:[~2021-05-14 12:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07 19:24 [Bug 1910586] [NEW] SD card size constraint conceptually wrong -
2021-01-07 22:13 ` Philippe Mathieu-Daudé
2021-01-07 22:13   ` Philippe Mathieu-Daudé
2021-01-08 18:31 ` [Bug 1910586] " -
2021-02-20  0:07 ` Philippe Mathieu-Daudé
2021-05-12 11:08 ` Thomas Huth
2021-05-14 11:50   ` -
2021-05-14 12:33 ` Philippe Mathieu-Daudé

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).