← Back to team overview

curtin-dev team mailing list archive

[Merge] ~dbungert/curtin:lp-2035034-sectors into curtin:master

 

Dan Bungert has proposed merging ~dbungert/curtin:lp-2035034-sectors into curtin:master.

Commit message:
storage_config: handle partitions on 4k disk

In LP: #2035034, a user reported that the layout of existing
partitions was showing as 1/8th the correct size.  Update storage_config
to no longer hard-code a 512 byte sector and read the value instead.



Requested reviews:
  curtin developers (curtin-dev)
Related bugs:
  Bug #2035034 in ubuntu-desktop-installer: "Installer fails to recognize correct partition sizes, likely sector size confusion"
  https://bugs.launchpad.net/ubuntu-desktop-installer/+bug/2035034

For more details, see:
https://code.launchpad.net/~dbungert/curtin/+git/curtin/+merge/451298
-- 
Your team curtin developers is requested to review the proposed merge of ~dbungert/curtin:lp-2035034-sectors into curtin:master.
diff --git a/curtin/storage_config.py b/curtin/storage_config.py
index d5092dd..af7b6f3 100644
--- a/curtin/storage_config.py
+++ b/curtin/storage_config.py
@@ -792,15 +792,19 @@ class BlockdevParser(ProbertParser):
             else:
                 part = attrs
 
-            # sectors 512B sector units in both attrs and ptable
-            offset_val = int(part['start']) * 512
+            # sector units are used in both attrs and ptable
+            parent_attrs = parent_blockdev.get('attrs', {})
+            logical_sector_size = int(
+                parent_attrs.get('queue/logical_block_size', 512)
+            )
+
+            offset_val = int(part['start']) * logical_sector_size
             if offset_val > 0:
                 entry['offset'] = offset_val
 
-            # ptable size field is in sectors
             entry['size'] = int(part['size'])
             if ptable:
-                entry['size'] *= 512
+                entry['size'] *= logical_sector_size
 
             if blockdev_data.get('ID_PART_TABLE_TYPE') == 'gpt':
                 part_uuid = blockdev_data.get('ID_PART_ENTRY_UUID')
diff --git a/tests/data/probert_storage_4ksectors.json b/tests/data/probert_storage_4ksectors.json
new file mode 100644
index 0000000..5394c8d
--- /dev/null
+++ b/tests/data/probert_storage_4ksectors.json
@@ -0,0 +1,986 @@
+{
+    "multipath": {},
+    "dasd": {},
+    "raid": {},
+    "bcache": {
+        "backing": {},
+        "caching": {}
+    },
+    "zfs": {
+        "zpools": {}
+    },
+    "lvm": {},
+    "mount": [
+        {
+            "target": "/",
+            "source": "/cow",
+            "fstype": "overlay",
+            "options": "rw,relatime,lowerdir=/standard.live.squashfs:/standard.squashfs,upperdir=/cow/upper,workdir=/cow/work,xino=off",
+            "maj:min": "0:27",
+            "children": [
+                {
+                    "target": "/sys",
+                    "source": "sysfs",
+                    "fstype": "sysfs",
+                    "options": "rw,nosuid,nodev,noexec,relatime",
+                    "maj:min": "0:20",
+                    "children": [
+                        {
+                            "target": "/sys/firmware/efi/efivars",
+                            "source": "efivarfs",
+                            "fstype": "efivarfs",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:24"
+                        },
+                        {
+                            "target": "/sys/kernel/security",
+                            "source": "securityfs",
+                            "fstype": "securityfs",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:6"
+                        },
+                        {
+                            "target": "/sys/fs/cgroup",
+                            "source": "cgroup2",
+                            "fstype": "cgroup2",
+                            "options": "rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot",
+                            "maj:min": "0:33"
+                        },
+                        {
+                            "target": "/sys/fs/pstore",
+                            "source": "pstore",
+                            "fstype": "pstore",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:34"
+                        },
+                        {
+                            "target": "/sys/fs/bpf",
+                            "source": "bpf",
+                            "fstype": "bpf",
+                            "options": "rw,nosuid,nodev,noexec,relatime,mode=700",
+                            "maj:min": "0:35"
+                        },
+                        {
+                            "target": "/sys/kernel/tracing",
+                            "source": "tracefs",
+                            "fstype": "tracefs",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:12"
+                        },
+                        {
+                            "target": "/sys/kernel/debug",
+                            "source": "debugfs",
+                            "fstype": "debugfs",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:7"
+                        },
+                        {
+                            "target": "/sys/fs/fuse/connections",
+                            "source": "fusectl",
+                            "fstype": "fusectl",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:38"
+                        },
+                        {
+                            "target": "/sys/kernel/config",
+                            "source": "configfs",
+                            "fstype": "configfs",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:19"
+                        }
+                    ]
+                },
+                {
+                    "target": "/proc",
+                    "source": "proc",
+                    "fstype": "proc",
+                    "options": "rw,nosuid,nodev,noexec,relatime",
+                    "maj:min": "0:21",
+                    "children": [
+                        {
+                            "target": "/proc/sys/fs/binfmt_misc",
+                            "source": "systemd-1",
+                            "fstype": "autofs",
+                            "options": "rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=15137",
+                            "maj:min": "0:36",
+                            "children": [
+                                {
+                                    "target": "/proc/sys/fs/binfmt_misc",
+                                    "source": "binfmt_misc",
+                                    "fstype": "binfmt_misc",
+                                    "options": "rw,nosuid,nodev,noexec,relatime",
+                                    "maj:min": "0:44"
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "target": "/dev",
+                    "source": "udev",
+                    "fstype": "devtmpfs",
+                    "options": "rw,nosuid,relatime,size=3993400k,nr_inodes=998350,mode=755,inode64",
+                    "maj:min": "0:5",
+                    "children": [
+                        {
+                            "target": "/dev/pts",
+                            "source": "devpts",
+                            "fstype": "devpts",
+                            "options": "rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000",
+                            "maj:min": "0:22"
+                        },
+                        {
+                            "target": "/dev/shm",
+                            "source": "tmpfs",
+                            "fstype": "tmpfs",
+                            "options": "rw,nosuid,nodev,inode64",
+                            "maj:min": "0:31"
+                        },
+                        {
+                            "target": "/dev/mqueue",
+                            "source": "mqueue",
+                            "fstype": "mqueue",
+                            "options": "rw,nosuid,nodev,noexec,relatime",
+                            "maj:min": "0:18"
+                        },
+                        {
+                            "target": "/dev/hugepages",
+                            "source": "hugetlbfs",
+                            "fstype": "hugetlbfs",
+                            "options": "rw,relatime,pagesize=2M",
+                            "maj:min": "0:37"
+                        }
+                    ]
+                },
+                {
+                    "target": "/run",
+                    "source": "tmpfs",
+                    "fstype": "tmpfs",
+                    "options": "rw,nosuid,nodev,noexec,relatime,size=811808k,mode=755,inode64",
+                    "maj:min": "0:23",
+                    "children": [
+                        {
+                            "target": "/run/lock",
+                            "source": "tmpfs",
+                            "fstype": "tmpfs",
+                            "options": "rw,nosuid,nodev,noexec,relatime,size=5120k,inode64",
+                            "maj:min": "0:32"
+                        },
+                        {
+                            "target": "/run/credentials/systemd-sysusers.service",
+                            "source": "ramfs",
+                            "fstype": "ramfs",
+                            "options": "ro,nosuid,nodev,noexec,relatime,mode=700",
+                            "maj:min": "0:39"
+                        },
+                        {
+                            "target": "/run/credentials/systemd-tmpfiles-setup-dev.service",
+                            "source": "ramfs",
+                            "fstype": "ramfs",
+                            "options": "ro,nosuid,nodev,noexec,relatime,mode=700",
+                            "maj:min": "0:40"
+                        },
+                        {
+                            "target": "/run/credentials/systemd-sysctl.service",
+                            "source": "ramfs",
+                            "fstype": "ramfs",
+                            "options": "ro,nosuid,nodev,noexec,relatime,mode=700",
+                            "maj:min": "0:41"
+                        },
+                        {
+                            "target": "/run/user/1000",
+                            "source": "tmpfs",
+                            "fstype": "tmpfs",
+                            "options": "rw,nosuid,nodev,relatime,size=811804k,nr_inodes=202951,mode=700,uid=1000,gid=1000,inode64",
+                            "maj:min": "0:62",
+                            "children": [
+                                {
+                                    "target": "/run/user/1000/gvfs",
+                                    "source": "gvfsd-fuse",
+                                    "fstype": "fuse.gvfsd-fuse",
+                                    "options": "rw,nosuid,nodev,relatime,user_id=1000,group_id=1000",
+                                    "maj:min": "0:63"
+                                },
+                                {
+                                    "target": "/run/user/1000/doc",
+                                    "source": "portal",
+                                    "fstype": "fuse.portal",
+                                    "options": "rw,nosuid,nodev,relatime,user_id=1000,group_id=1000",
+                                    "maj:min": "0:75"
+                                }
+                            ]
+                        },
+                        {
+                            "target": "/run/credentials/systemd-tmpfiles-setup.service",
+                            "source": "ramfs",
+                            "fstype": "ramfs",
+                            "options": "ro,nosuid,nodev,noexec,relatime,mode=700",
+                            "maj:min": "0:43"
+                        },
+                        {
+                            "target": "/run/snapd/ns",
+                            "source": "tmpfs[/snapd/ns]",
+                            "fstype": "tmpfs",
+                            "options": "rw,nosuid,nodev,noexec,relatime,size=811808k,mode=755,inode64",
+                            "maj:min": "0:23",
+                            "children": [
+                                {
+                                    "target": "/run/snapd/ns/firefox.mnt",
+                                    "source": "nsfs[mnt:[4026532487]]",
+                                    "fstype": "nsfs",
+                                    "options": "rw",
+                                    "maj:min": "0:4"
+                                },
+                                {
+                                    "target": "/run/snapd/ns/snap-store.mnt",
+                                    "source": "nsfs[mnt:[4026532488]]",
+                                    "fstype": "nsfs",
+                                    "options": "rw",
+                                    "maj:min": "0:4"
+                                },
+                                {
+                                    "target": "/run/snapd/ns/snapd-desktop-integration.mnt",
+                                    "source": "nsfs[mnt:[4026532489]]",
+                                    "fstype": "nsfs",
+                                    "options": "rw",
+                                    "maj:min": "0:4"
+                                }
+                            ]
+                        },
+                        {
+                            "target": "/run/credentials/systemd-resolved.service",
+                            "source": "ramfs",
+                            "fstype": "ramfs",
+                            "options": "ro,nosuid,nodev,noexec,relatime,mode=700",
+                            "maj:min": "0:46"
+                        }
+                    ]
+                },
+                {
+                    "target": "/cdrom",
+                    "source": "/dev/sr0",
+                    "fstype": "iso9660",
+                    "options": "ro,noatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8",
+                    "maj:min": "11:0"
+                },
+                {
+                    "target": "/rofs",
+                    "source": "/dev/loop0",
+                    "fstype": "squashfs",
+                    "options": "ro,noatime,errors=continue,threads=single",
+                    "maj:min": "7:0"
+                },
+                {
+                    "target": "/snap",
+                    "source": "/cow[/snap]",
+                    "fstype": "overlay",
+                    "options": "rw,relatime,lowerdir=/standard.live.squashfs:/standard.squashfs,upperdir=/cow/upper,workdir=/cow/work,xino=off",
+                    "maj:min": "0:27",
+                    "children": [
+                        {
+                            "target": "/snap/bare/5",
+                            "source": "/dev/loop6",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:6"
+                        },
+                        {
+                            "target": "/snap/firefox/3068",
+                            "source": "/dev/loop2",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:2"
+                        },
+                        {
+                            "target": "/snap/core22/864",
+                            "source": "/dev/loop5",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:5"
+                        },
+                        {
+                            "target": "/snap/snap-store/1036",
+                            "source": "/dev/loop8",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:8"
+                        },
+                        {
+                            "target": "/snap/snapd/20092",
+                            "source": "/dev/loop7",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:7"
+                        },
+                        {
+                            "target": "/snap/snapd-desktop-integration/83",
+                            "source": "/dev/loop9",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:9"
+                        },
+                        {
+                            "target": "/snap/gtk-common-themes/1535",
+                            "source": "/dev/loop4",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:4"
+                        },
+                        {
+                            "target": "/snap/gnome-42-2204/126",
+                            "source": "/dev/loop3",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:3"
+                        },
+                        {
+                            "target": "/snap/ubuntu-desktop-installer/1229",
+                            "source": "/dev/loop10",
+                            "fstype": "squashfs",
+                            "options": "ro,nodev,relatime,errors=continue,threads=single",
+                            "maj:min": "7:10"
+                        }
+                    ]
+                },
+                {
+                    "target": "/tmp",
+                    "source": "tmpfs",
+                    "fstype": "tmpfs",
+                    "options": "rw,nosuid,nodev,relatime,inode64",
+                    "maj:min": "0:42",
+                    "children": [
+                        {
+                            "target": "/tmp/tmprwy0p_f7/standard.squashfs.dir",
+                            "source": "/dev/loop0",
+                            "fstype": "squashfs",
+                            "options": "ro,relatime,errors=continue,threads=single",
+                            "maj:min": "7:0"
+                        },
+                        {
+                            "target": "/tmp/tmprwy0p_f7/standard.enhanced-secureboot.squashfs.dir",
+                            "source": "/dev/loop11",
+                            "fstype": "squashfs",
+                            "options": "ro,relatime,errors=continue,threads=single",
+                            "maj:min": "7:11"
+                        },
+                        {
+                            "target": "/tmp/tmprwy0p_f7/standard.enhanced-secureboot.en.squashfs.dir",
+                            "source": "/dev/loop12",
+                            "fstype": "squashfs",
+                            "options": "ro,relatime,errors=continue,threads=single",
+                            "maj:min": "7:12"
+                        },
+                        {
+                            "target": "/tmp/tmprwy0p_f7/root.dir",
+                            "source": "overlay",
+                            "fstype": "overlay",
+                            "options": "ro,relatime,lowerdir=/tmp/tmprwy0p_f7/standard.enhanced-secureboot.en.squashfs.dir:/tmp/tmprwy0p_f7/standard.enhanced-secureboot.squashfs.dir:/tmp/tmprwy0p_f7/standard.squashfs.dir",
+                            "maj:min": "0:65"
+                        }
+                    ]
+                },
+                {
+                    "target": "/snap/bare/5",
+                    "source": "/dev/loop6",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:6"
+                },
+                {
+                    "target": "/snap/firefox/3068",
+                    "source": "/dev/loop2",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:2"
+                },
+                {
+                    "target": "/snap/core22/864",
+                    "source": "/dev/loop5",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:5"
+                },
+                {
+                    "target": "/snap/snap-store/1036",
+                    "source": "/dev/loop8",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:8"
+                },
+                {
+                    "target": "/snap/snapd/20092",
+                    "source": "/dev/loop7",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:7"
+                },
+                {
+                    "target": "/snap/snapd-desktop-integration/83",
+                    "source": "/dev/loop9",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:9"
+                },
+                {
+                    "target": "/snap/gtk-common-themes/1535",
+                    "source": "/dev/loop4",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:4"
+                },
+                {
+                    "target": "/snap/gnome-42-2204/126",
+                    "source": "/dev/loop3",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:3"
+                },
+                {
+                    "target": "/snap/ubuntu-desktop-installer/1229",
+                    "source": "/dev/loop10",
+                    "fstype": "squashfs",
+                    "options": "ro,nodev,relatime,errors=continue,threads=single",
+                    "maj:min": "7:10"
+                },
+                {
+                    "target": "/var/lib/snapd/seed/systems",
+                    "source": "overlay[/var/lib/snapd/seed/systems]",
+                    "fstype": "overlay",
+                    "options": "ro,relatime,lowerdir=/tmp/tmprwy0p_f7/standard.enhanced-secureboot.en.squashfs.dir:/tmp/tmprwy0p_f7/standard.enhanced-secureboot.squashfs.dir:/tmp/tmprwy0p_f7/standard.squashfs.dir",
+                    "maj:min": "0:65"
+                },
+                {
+                    "target": "/var/lib/snapd/seed/snaps/pc-kernel_1397.snap",
+                    "source": "overlay[/var/lib/snapd/seed/snaps/pc-kernel_1397.snap]",
+                    "fstype": "overlay",
+                    "options": "ro,relatime,lowerdir=/tmp/tmprwy0p_f7/standard.enhanced-secureboot.en.squashfs.dir:/tmp/tmprwy0p_f7/standard.enhanced-secureboot.squashfs.dir:/tmp/tmprwy0p_f7/standard.squashfs.dir",
+                    "maj:min": "0:65"
+                },
+                {
+                    "target": "/var/snap/firefox/common/host-hunspell",
+                    "source": "/cow[/usr/share/hunspell]",
+                    "fstype": "overlay",
+                    "options": "ro,noexec,noatime,lowerdir=/standard.live.squashfs:/standard.squashfs,upperdir=/cow/upper,workdir=/cow/work,xino=off",
+                    "maj:min": "0:27"
+                },
+                {
+                    "target": "/var/lib/snapd/seed/snaps/pc_154.snap",
+                    "source": "overlay[/var/lib/snapd/seed/snaps/pc_154.snap]",
+                    "fstype": "overlay",
+                    "options": "ro,relatime,lowerdir=/tmp/tmprwy0p_f7/standard.enhanced-secureboot.en.squashfs.dir:/tmp/tmprwy0p_f7/standard.enhanced-secureboot.squashfs.dir:/tmp/tmprwy0p_f7/standard.squashfs.dir",
+                    "maj:min": "0:65"
+                }
+            ]
+        }
+    ],
+    "blockdev": {
+        "/dev/sr0": {
+            "CURRENT_TAGS": ":seat:uaccess:systemd:",
+            "DEVLINKS": "/dev/disk/by-path/pci-0000:00:01.1-ata-2.0 /dev/disk/by-label/Ubuntu\\x2023.10\\x20amd64 /dev/cdrom /dev/disk/by-uuid/2023-09-08-18-55-29-00 /dev/disk/by-id/ata-QEMU_DVD-ROM_QM00003 /dev/disk/by-diskseq/11 /dev/disk/by-path/pci-0000:00:01.1-ata-2",
+            "DEVNAME": "/dev/sr0",
+            "DEVPATH": "/devices/pci0000:00/0000:00:01.1/ata2/host2/target2:0:0/2:0:0:0/block/sr0",
+            "DEVTYPE": "disk",
+            "DISKSEQ": "11",
+            "ID_ATA": "1",
+            "ID_BUS": "ata",
+            "ID_CDROM": "1",
+            "ID_CDROM_DVD": "1",
+            "ID_CDROM_MEDIA": "1",
+            "ID_CDROM_MEDIA_DVD": "1",
+            "ID_CDROM_MEDIA_SESSION_COUNT": "1",
+            "ID_CDROM_MEDIA_STATE": "complete",
+            "ID_CDROM_MEDIA_TRACK_COUNT": "1",
+            "ID_CDROM_MEDIA_TRACK_COUNT_DATA": "1",
+            "ID_CDROM_MRW": "1",
+            "ID_CDROM_MRW_W": "1",
+            "ID_FOR_SEAT": "block-pci-0000_00_01_1-ata-2_0",
+            "ID_FS_BLOCKSIZE": "2048",
+            "ID_FS_BOOT_SYSTEM_ID": "EL\\x20TORITO\\x20SPECIFICATION",
+            "ID_FS_DATA_PREPARER_ID": "XORRISO-1.5.4\\x202021.01.30.150001\\x2c\\x20LIBISOBURN-1.5.4\\x2c\\x20LIBISOFS-1.5.4\\x2c\\x20LIBBURN-1.5.4",
+            "ID_FS_LABEL": "Ubuntu_23.10_amd64",
+            "ID_FS_LABEL_ENC": "Ubuntu\\x2023.10\\x20amd64",
+            "ID_FS_SIZE": "4397549568",
+            "ID_FS_TYPE": "iso9660",
+            "ID_FS_USAGE": "filesystem",
+            "ID_FS_UUID": "2023-09-08-18-55-29-00",
+            "ID_FS_UUID_ENC": "2023-09-08-18-55-29-00",
+            "ID_FS_VERSION": "Joliet Extension",
+            "ID_MODEL": "QEMU_DVD-ROM",
+            "ID_MODEL_ENC": "QEMU\\x20DVD-ROM\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20",
+            "ID_PART_TABLE_TYPE": "PMBR",
+            "ID_PATH": "pci-0000:00:01.1-ata-2.0",
+            "ID_PATH_ATA_COMPAT": "pci-0000:00:01.1-ata-2",
+            "ID_PATH_TAG": "pci-0000_00_01_1-ata-2_0",
+            "ID_REVISION": "2.5+",
+            "ID_SERIAL": "QEMU_DVD-ROM_QM00003",
+            "ID_SERIAL_SHORT": "QM00003",
+            "ID_TYPE": "cd",
+            "MAJOR": "11",
+            "MINOR": "0",
+            "SUBSYSTEM": "block",
+            "TAGS": ":seat:uaccess:systemd:",
+            "UDISKS_IGNORE": "1",
+            "USEC_INITIALIZED": "1204574",
+            "attrs": {
+                "alignment_offset": "0",
+                "bdi": null,
+                "capability": "0",
+                "dev": "11:0",
+                "device": null,
+                "discard_alignment": "0",
+                "diskseq": "11",
+                "events": "media_change eject_request",
+                "events_async": "",
+                "events_poll_msecs": "-1",
+                "ext_range": "1",
+                "hidden": "0",
+                "inflight": "       0        0",
+                "integrity/device_is_integrity_capable": "0",
+                "integrity/format": "none",
+                "integrity/protection_interval_bytes": "0",
+                "integrity/read_verify": "0",
+                "integrity/tag_size": "0",
+                "integrity/write_generate": "0",
+                "mq/0/cpu_list": "0",
+                "mq/0/nr_reserved_tags": "0",
+                "mq/0/nr_tags": "1",
+                "power/async": "disabled",
+                "power/autosuspend_delay_ms": null,
+                "power/control": "auto",
+                "power/runtime_active_kids": "0",
+                "power/runtime_active_time": "0",
+                "power/runtime_enabled": "disabled",
+                "power/runtime_status": "unsupported",
+                "power/runtime_suspended_time": "0",
+                "power/runtime_usage": "0",
+                "queue/add_random": "0",
+                "queue/bsg": null,
+                "queue/chunk_sectors": "0",
+                "queue/dax": "0",
+                "queue/discard_granularity": "0",
+                "queue/discard_max_bytes": "0",
+                "queue/discard_max_hw_bytes": "0",
+                "queue/discard_zeroes_data": "0",
+                "queue/dma_alignment": "511",
+                "queue/fua": "0",
+                "queue/hw_sector_size": "2048",
+                "queue/io_poll": "0",
+                "queue/io_poll_delay": "-1",
+                "queue/io_timeout": "30000",
+                "queue/iosched/async_depth": "1",
+                "queue/iosched/fifo_batch": "16",
+                "queue/iosched/front_merges": "1",
+                "queue/iosched/prio_aging_expire": "10000",
+                "queue/iosched/read_expire": "500",
+                "queue/iosched/write_expire": "5000",
+                "queue/iosched/writes_starved": "2",
+                "queue/iostats": "1",
+                "queue/logical_block_size": "2048",
+                "queue/max_discard_segments": "1",
+                "queue/max_hw_sectors_kb": "128",
+                "queue/max_integrity_segments": "0",
+                "queue/max_sectors_kb": "128",
+                "queue/max_segment_size": "65536",
+                "queue/max_segments": "127",
+                "queue/minimum_io_size": "2048",
+                "queue/nomerges": "0",
+                "queue/nr_requests": "2",
+                "queue/nr_zones": "0",
+                "queue/optimal_io_size": "0",
+                "queue/physical_block_size": "2048",
+                "queue/read_ahead_kb": "128",
+                "queue/rotational": "1",
+                "queue/rq_affinity": "1",
+                "queue/scheduler": "none [mq-deadline] ",
+                "queue/stable_writes": "0",
+                "queue/virt_boundary_mask": "0",
+                "queue/wbt_lat_usec": "75000",
+                "queue/write_cache": "write through",
+                "queue/write_same_max_bytes": "0",
+                "queue/write_zeroes_max_bytes": "0",
+                "queue/zone_append_max_bytes": "0",
+                "queue/zone_write_granularity": "0",
+                "queue/zoned": "none",
+                "range": "1",
+                "removable": "1",
+                "ro": "0",
+                "size": "4397549568",
+                "stat": "   40043       39  8558188    11689        0        0        0        0        0    30904    11689        0        0        0        0        0        0",
+                "subsystem": "block",
+                "trace/act_mask": "disabled",
+                "trace/enable": "0",
+                "trace/end_lba": "disabled",
+                "trace/pid": "disabled",
+                "trace/start_lba": "disabled",
+                "uevent": "MAJOR=11\nMINOR=0\nDEVNAME=sr0\nDEVTYPE=disk\nDISKSEQ=11"
+            },
+            "partitiontable": {
+                "label": "dos",
+                "id": "0x00000000",
+                "device": "/dev/sr0",
+                "unit": "sectors",
+                "sectorsize": 2048,
+                "partitions": [
+                    {
+                        "node": "/dev/sr0p1",
+                        "start": 1,
+                        "size": 2147240,
+                        "type": "ee"
+                    },
+                    {
+                        "node": "/dev/sr0p2",
+                        "start": 0,
+                        "size": 1,
+                        "type": "0",
+                        "bootable": true
+                    }
+                ]
+            }
+        },
+        "/dev/sda": {
+            "CURRENT_TAGS": ":systemd:",
+            "DEVLINKS": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_0001 /dev/disk/by-diskseq/9 /dev/disk/by-path/pci-0000:00:04.0-scsi-0:0:0:0",
+            "DEVNAME": "/dev/sda",
+            "DEVPATH": "/devices/pci0000:00/0000:00:04.0/virtio2/host0/target0:0:0/0:0:0:0/block/sda",
+            "DEVTYPE": "disk",
+            "DISKSEQ": "9",
+            "ID_BUS": "scsi",
+            "ID_MODEL": "QEMU_HARDDISK",
+            "ID_MODEL_ENC": "QEMU\\x20HARDDISK\\x20\\x20\\x20",
+            "ID_PART_TABLE_TYPE": "gpt",
+            "ID_PART_TABLE_UUID": "3e0c934b-0f55-42af-b0cd-5a073daa0058",
+            "ID_PATH": "pci-0000:00:04.0-scsi-0:0:0:0",
+            "ID_PATH_TAG": "pci-0000_00_04_0-scsi-0_0_0_0",
+            "ID_REVISION": "2.5+",
+            "ID_SCSI": "1",
+            "ID_SCSI_SERIAL": "0001",
+            "ID_SERIAL": "0QEMU_QEMU_HARDDISK_0001",
+            "ID_SERIAL_SHORT": "0001",
+            "ID_TYPE": "disk",
+            "ID_VENDOR": "QEMU",
+            "ID_VENDOR_ENC": "QEMU\\x20\\x20\\x20\\x20",
+            "MAJOR": "8",
+            "MINOR": "0",
+            "SUBSYSTEM": "block",
+            "TAGS": ":systemd:",
+            "UDISKS_IGNORE": "1",
+            "USEC_INITIALIZED": "1148599",
+            "attrs": {
+                "alignment_offset": "0",
+                "bdi": null,
+                "capability": "0",
+                "dev": "8:0",
+                "device": null,
+                "discard_alignment": "0",
+                "diskseq": "9",
+                "events": "",
+                "events_async": "",
+                "events_poll_msecs": "-1",
+                "ext_range": "256",
+                "hidden": "0",
+                "inflight": "       0        0",
+                "integrity/device_is_integrity_capable": "0",
+                "integrity/format": "none",
+                "integrity/protection_interval_bytes": "0",
+                "integrity/read_verify": "0",
+                "integrity/tag_size": "0",
+                "integrity/write_generate": "0",
+                "mq/0/cpu_list": "0",
+                "mq/0/nr_reserved_tags": "0",
+                "mq/0/nr_tags": "256",
+                "power/async": "disabled",
+                "power/autosuspend_delay_ms": null,
+                "power/control": "auto",
+                "power/runtime_active_kids": "0",
+                "power/runtime_active_time": "0",
+                "power/runtime_enabled": "disabled",
+                "power/runtime_status": "unsupported",
+                "power/runtime_suspended_time": "0",
+                "power/runtime_usage": "0",
+                "queue/add_random": "1",
+                "queue/chunk_sectors": "0",
+                "queue/dax": "0",
+                "queue/discard_granularity": "4096",
+                "queue/discard_max_bytes": "1073741824",
+                "queue/discard_max_hw_bytes": "1073741824",
+                "queue/discard_zeroes_data": "0",
+                "queue/dma_alignment": "3",
+                "queue/fua": "0",
+                "queue/hw_sector_size": "4096",
+                "queue/io_poll": "0",
+                "queue/io_poll_delay": "-1",
+                "queue/io_timeout": "30000",
+                "queue/iosched/async_depth": "192",
+                "queue/iosched/fifo_batch": "16",
+                "queue/iosched/front_merges": "1",
+                "queue/iosched/prio_aging_expire": "10000",
+                "queue/iosched/read_expire": "500",
+                "queue/iosched/write_expire": "5000",
+                "queue/iosched/writes_starved": "2",
+                "queue/iostats": "1",
+                "queue/logical_block_size": "4096",
+                "queue/max_discard_segments": "1",
+                "queue/max_hw_sectors_kb": "32764",
+                "queue/max_integrity_segments": "0",
+                "queue/max_sectors_kb": "1280",
+                "queue/max_segment_size": "65536",
+                "queue/max_segments": "254",
+                "queue/minimum_io_size": "4096",
+                "queue/nomerges": "0",
+                "queue/nr_requests": "256",
+                "queue/nr_zones": "0",
+                "queue/optimal_io_size": "0",
+                "queue/physical_block_size": "4096",
+                "queue/read_ahead_kb": "128",
+                "queue/rotational": "1",
+                "queue/rq_affinity": "1",
+                "queue/scheduler": "none [mq-deadline] ",
+                "queue/stable_writes": "0",
+                "queue/virt_boundary_mask": "0",
+                "queue/wbt_lat_usec": "75000",
+                "queue/write_cache": "write through",
+                "queue/write_same_max_bytes": "0",
+                "queue/write_zeroes_max_bytes": "2147479552",
+                "queue/zone_append_max_bytes": "0",
+                "queue/zone_write_granularity": "0",
+                "queue/zoned": "none",
+                "range": "16",
+                "removable": "0",
+                "ro": "0",
+                "size": "26843545600",
+                "stat": "    6060        0   327352      364       86     2191   411656      233        0     1972      598       32        0 62664720        1        0        0",
+                "subsystem": "block",
+                "trace/act_mask": "disabled",
+                "trace/enable": "0",
+                "trace/end_lba": "disabled",
+                "trace/pid": "disabled",
+                "trace/start_lba": "disabled",
+                "uevent": "MAJOR=8\nMINOR=0\nDEVNAME=sda\nDEVTYPE=disk\nDISKSEQ=9"
+            },
+            "partitiontable": {
+                "label": "gpt",
+                "id": "3E0C934B-0F55-42AF-B0CD-5A073DAA0058",
+                "device": "/dev/sda",
+                "unit": "sectors",
+                "firstlba": 6,
+                "lastlba": 6553594,
+                "sectorsize": 4096,
+                "partitions": [
+                    {
+                        "node": "/dev/sda1",
+                        "start": 256,
+                        "size": 1280000,
+                        "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+                        "uuid": "B36A4363-13E8-4DE8-9264-5369F4654916"
+                    }
+                ]
+            }
+        },
+        "/dev/sda1": {
+            "CURRENT_TAGS": ":systemd:",
+            "DEVLINKS": "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_0001-part1 /dev/disk/by-partuuid/b36a4363-13e8-4de8-9264-5369f4654916 /dev/disk/by-path/pci-0000:00:04.0-scsi-0:0:0:0-part1 /dev/disk/by-diskseq/9-part1 /dev/disk/by-uuid/af54ef06-c5a2-4660-b89a-3fc7e51a6840",
+            "DEVNAME": "/dev/sda1",
+            "DEVPATH": "/devices/pci0000:00/0000:00:04.0/virtio2/host0/target0:0:0/0:0:0:0/block/sda/sda1",
+            "DEVTYPE": "partition",
+            "DISKSEQ": "9",
+            "ID_BUS": "scsi",
+            "ID_FS_BLOCKSIZE": "4096",
+            "ID_FS_LASTBLOCK": "1280000",
+            "ID_FS_SIZE": "5242880000",
+            "ID_FS_TYPE": "ext4",
+            "ID_FS_USAGE": "filesystem",
+            "ID_FS_UUID": "af54ef06-c5a2-4660-b89a-3fc7e51a6840",
+            "ID_FS_UUID_ENC": "af54ef06-c5a2-4660-b89a-3fc7e51a6840",
+            "ID_FS_VERSION": "1.0",
+            "ID_MODEL": "QEMU_HARDDISK",
+            "ID_MODEL_ENC": "QEMU\\x20HARDDISK\\x20\\x20\\x20",
+            "ID_PART_ENTRY_DISK": "8:0",
+            "ID_PART_ENTRY_NUMBER": "1",
+            "ID_PART_ENTRY_OFFSET": "2048",
+            "ID_PART_ENTRY_SCHEME": "gpt",
+            "ID_PART_ENTRY_SIZE": "10240000",
+            "ID_PART_ENTRY_TYPE": "0fc63daf-8483-4772-8e79-3d69d8477de4",
+            "ID_PART_ENTRY_UUID": "b36a4363-13e8-4de8-9264-5369f4654916",
+            "ID_PART_TABLE_TYPE": "gpt",
+            "ID_PART_TABLE_UUID": "3e0c934b-0f55-42af-b0cd-5a073daa0058",
+            "ID_PATH": "pci-0000:00:04.0-scsi-0:0:0:0",
+            "ID_PATH_TAG": "pci-0000_00_04_0-scsi-0_0_0_0",
+            "ID_REVISION": "2.5+",
+            "ID_SCSI": "1",
+            "ID_SCSI_SERIAL": "0001",
+            "ID_SERIAL": "0QEMU_QEMU_HARDDISK_0001",
+            "ID_SERIAL_SHORT": "0001",
+            "ID_TYPE": "disk",
+            "ID_VENDOR": "QEMU",
+            "ID_VENDOR_ENC": "QEMU\\x20\\x20\\x20\\x20",
+            "MAJOR": "8",
+            "MINOR": "1",
+            "PARTN": "1",
+            "SUBSYSTEM": "block",
+            "TAGS": ":systemd:",
+            "UDISKS_IGNORE": "1",
+            "USEC_INITIALIZED": "304109112",
+            "attrs": {
+                "alignment_offset": "0",
+                "dev": "8:1",
+                "discard_alignment": "0",
+                "inflight": "       0        0",
+                "partition": "1",
+                "power/async": "disabled",
+                "power/autosuspend_delay_ms": null,
+                "power/control": "auto",
+                "power/runtime_active_kids": "0",
+                "power/runtime_active_time": "0",
+                "power/runtime_enabled": "disabled",
+                "power/runtime_status": "unsupported",
+                "power/runtime_suspended_time": "0",
+                "power/runtime_usage": "0",
+                "ro": "0",
+                "size": "5242880000",
+                "start": "2048",
+                "stat": "     398        0    27440       24       21      326   133960       17        0      212       42        6        0 10240008        0        0        0",
+                "subsystem": "block",
+                "trace/act_mask": "disabled",
+                "trace/enable": "0",
+                "trace/end_lba": "disabled",
+                "trace/pid": "disabled",
+                "trace/start_lba": "disabled",
+                "uevent": "MAJOR=8\nMINOR=1\nDEVNAME=sda1\nDEVTYPE=partition\nDISKSEQ=9\nPARTN=1"
+            }
+        },
+        "/dev/fd0": {
+            "CURRENT_TAGS": ":systemd:",
+            "DEVNAME": "/dev/fd0",
+            "DEVPATH": "/devices/platform/floppy.0/block/fd0",
+            "DEVTYPE": "disk",
+            "DISKSEQ": "50",
+            "ID_DRIVE_FLOPPY": "1",
+            "MAJOR": "2",
+            "MINOR": "0",
+            "SUBSYSTEM": "block",
+            "TAGS": ":systemd:",
+            "UDISKS_IGNORE": "1",
+            "USEC_INITIALIZED": "7145803",
+            "attrs": {
+                "alignment_offset": "0",
+                "bdi": null,
+                "capability": "0",
+                "dev": "2:0",
+                "device": null,
+                "discard_alignment": "0",
+                "diskseq": "50",
+                "events": "",
+                "events_async": "",
+                "events_poll_msecs": "-1",
+                "ext_range": "1",
+                "hidden": "0",
+                "inflight": "       0        0",
+                "integrity/device_is_integrity_capable": "0",
+                "integrity/format": "none",
+                "integrity/protection_interval_bytes": "0",
+                "integrity/read_verify": "0",
+                "integrity/tag_size": "0",
+                "integrity/write_generate": "0",
+                "mq/0/cpu_list": "0",
+                "mq/0/nr_reserved_tags": "0",
+                "mq/0/nr_tags": "2",
+                "power/async": "disabled",
+                "power/autosuspend_delay_ms": null,
+                "power/control": "auto",
+                "power/runtime_active_kids": "0",
+                "power/runtime_active_time": "0",
+                "power/runtime_enabled": "disabled",
+                "power/runtime_status": "unsupported",
+                "power/runtime_suspended_time": "0",
+                "power/runtime_usage": "0",
+                "queue/add_random": "0",
+                "queue/chunk_sectors": "0",
+                "queue/dax": "0",
+                "queue/discard_granularity": "0",
+                "queue/discard_max_bytes": "0",
+                "queue/discard_max_hw_bytes": "0",
+                "queue/discard_zeroes_data": "0",
+                "queue/dma_alignment": "511",
+                "queue/fua": "0",
+                "queue/hw_sector_size": "512",
+                "queue/io_poll": "0",
+                "queue/io_poll_delay": "-1",
+                "queue/iosched/async_depth": "3",
+                "queue/iosched/fifo_batch": "16",
+                "queue/iosched/front_merges": "1",
+                "queue/iosched/prio_aging_expire": "10000",
+                "queue/iosched/read_expire": "500",
+                "queue/iosched/write_expire": "5000",
+                "queue/iosched/writes_starved": "2",
+                "queue/iostats": "1",
+                "queue/logical_block_size": "512",
+                "queue/max_discard_segments": "1",
+                "queue/max_hw_sectors_kb": "32",
+                "queue/max_integrity_segments": "0",
+                "queue/max_sectors_kb": "32",
+                "queue/max_segment_size": "65536",
+                "queue/max_segments": "128",
+                "queue/minimum_io_size": "512",
+                "queue/nomerges": "0",
+                "queue/nr_requests": "4",
+                "queue/nr_zones": "0",
+                "queue/optimal_io_size": "0",
+                "queue/physical_block_size": "512",
+                "queue/read_ahead_kb": "128",
+                "queue/rotational": "1",
+                "queue/rq_affinity": "1",
+                "queue/scheduler": "none [mq-deadline] ",
+                "queue/stable_writes": "0",
+                "queue/virt_boundary_mask": "0",
+                "queue/wbt_lat_usec": "75000",
+                "queue/write_cache": "write through",
+                "queue/write_same_max_bytes": "0",
+                "queue/write_zeroes_max_bytes": "0",
+                "queue/zone_append_max_bytes": "0",
+                "queue/zone_write_granularity": "0",
+                "queue/zoned": "none",
+                "range": "1",
+                "removable": "1",
+                "ro": "0",
+                "size": "4096",
+                "stat": "      25        0      200      992        0        0        0        0        0     1140      992        0        0        0        0        0        0",
+                "subsystem": "block",
+                "trace/act_mask": "disabled",
+                "trace/enable": "0",
+                "trace/end_lba": "disabled",
+                "trace/pid": "disabled",
+                "trace/start_lba": "disabled",
+                "uevent": "MAJOR=2\nMINOR=0\nDEVNAME=fd0\nDEVTYPE=disk\nDISKSEQ=50"
+            }
+        }
+    },
+    "dmcrypt": {},
+    "os": {},
+    "filesystem": {
+        "/dev/sr0": {
+            "BLOCKSIZE": "2048",
+            "BOOT_SYSTEM_ID": "EL\\x20TORITO\\x20SPECIFICATION",
+            "DATA_PREPARER_ID": "XORRISO-1.5.4\\x202021.01.30.150001\\x2c\\x20LIBISOBURN-1.5.4\\x2c\\x20LIBISOFS-1.5.4\\x2c\\x20LIBBURN-1.5.4",
+            "LABEL": "Ubuntu_23.10_amd64",
+            "LABEL_ENC": "Ubuntu\\x2023.10\\x20amd64",
+            "SIZE": "4397549568",
+            "TYPE": "iso9660",
+            "USAGE": "filesystem",
+            "UUID": "2023-09-08-18-55-29-00",
+            "UUID_ENC": "2023-09-08-18-55-29-00",
+            "VERSION": "Joliet Extension",
+            "ESTIMATED_MIN_SIZE": -1
+        },
+        "/dev/sda1": {
+            "BLOCKSIZE": "4096",
+            "LASTBLOCK": "1280000",
+            "SIZE": 5242880000,
+            "TYPE": "ext4",
+            "USAGE": "filesystem",
+            "UUID": "af54ef06-c5a2-4660-b89a-3fc7e51a6840",
+            "UUID_ENC": "af54ef06-c5a2-4660-b89a-3fc7e51a6840",
+            "VERSION": "1.0",
+            "ESTIMATED_MIN_SIZE": 107950080
+        }
+    }
+}
diff --git a/tests/unittests/test_storage_config.py b/tests/unittests/test_storage_config.py
index b032bf4..caaac29 100644
--- a/tests/unittests/test_storage_config.py
+++ b/tests/unittests/test_storage_config.py
@@ -603,6 +603,14 @@ class TestBlockdevParser(CiTestCase):
             'type': 'disk'}
         self.assertDictEqual(expected_dict, self.bdevp.asdict(blockdev))
 
+    def test_blockdev_asdict_4k_sector_size(self):
+        """ existing part on 4k logical sector size disk with size 5000 MiB """
+        self.probe_data = _get_data('probert_storage_4ksectors.json')
+        self.bdevp = BlockdevParser(self.probe_data)
+        blockdev = self.bdevp.blockdev_data['/dev/sda1']
+        actual = self.bdevp.asdict(blockdev)
+        self.assertEqual(5000 << 20, actual['size'])
+
 
 class TestFilesystemParser(CiTestCase):
 

Follow ups