You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been asked to update an install script that I had written a couple of years to check that it still works correctly under the new(ish) version of Debian. On running it on a test machine, it appears the partition sizing no longer seems to work for me.
Using the demo file make_one_primary_partition.py (found in the examples directory), I can create a single partition that uses the entire disk.
INFO - wiping partitions and other meta-data
DEBUG - has partitions ['/dev/sda1']
DEBUG - wiping /dev/sda1
DEBUG - wiping /dev/sda
INFO - creating primary partition
DEBUG - created parted.Device instance --
model: ATA SanDisk SDSSDX12 path: /dev/sda type: 1
sectorSize: 512 physicalSectorSize: 512
length: 234441648 openCount: 0 readOnly: False
externalMode: False dirty: False bootDirty: False
host: 2 did: 0 busy: False
hardwareGeometry: (459689, 255, 2) biosGeometry: (459689, 255, 2)
PedDevice: <_ped.Device object at 0xb759d868>
DEBUG - created parted.Disk instance --
type: msdos primaryPartitionCount: 0
lastPartitionNumber: -1 maxPrimaryPartitionCount: 4
partitions: []
device: <parted.device.Device object at 0xb7596ad8>
PedDisk: <_ped.Disk object at 0xb759e308>
DEBUG - created parted.Geometry instance --
start: 1 end: 234441647 length: 234441647
device: <parted.device.Device object at 0xb75969d0> PedGeometry: <_ped.Geometry object at 0xb7596b38>
DEBUG - created parted.FileSystem instance --
type: ext3 geometry: <parted.geometry.Geometry object at 0xb7596aa8> checked: False
PedFileSystem: <_ped.FileSystem object at 0xb759e428>
DEBUG - created parted.Partition instance --
disk: <parted.disk.Disk object at 0xb7596a60> fileSystem: <parted.filesystem.FileSystem object at 0xb7596a30>
number: -1 path: /dev/sda-1 type: 0
name: None active: True busy: False
geometry: <parted.geometry.Geometry object at 0xb7596aa8> PedPartition: <_ped.Partition object at 0xb75a7910>
bncs@gpi-box:/opt$ sudo fdisk /dev/sda
sudo: unable to resolve host gpi-box.national.bbc.co.uk: Name or service not known
Welcome to fdisk (util-linux 2.36.1).
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 /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: SanDisk SDSSDX12
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: 0xb06a60c1
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 522240 233963519 233441280 111.3G 83 Linux
However, note the start and end positions for the partition don't seem to tally from the pyparted debug code and what fdisk is showing.
If I modify the example to specify a specific size for the partition:
INFO - wiping partitions and other meta-data
DEBUG - has partitions ['/dev/sda1']
DEBUG - wiping /dev/sda1
DEBUG - wiping /dev/sda
INFO - creating primary partition
DEBUG - created parted.Device instance --
model: ATA SanDisk SDSSDX12 path: /dev/sda type: 1
sectorSize: 512 physicalSectorSize: 512
length: 234441648 openCount: 0 readOnly: False
externalMode: False dirty: False bootDirty: False
host: 2 did: 0 busy: False
hardwareGeometry: (459689, 255, 2) biosGeometry: (459689, 255, 2)
PedDevice: <_ped.Device object at 0xb7619810>
DEBUG - created parted.Disk instance --
type: msdos primaryPartitionCount: 0
lastPartitionNumber: -1 maxPrimaryPartitionCount: 4
partitions: []
device: <parted.device.Device object at 0xb7614b20>
PedDisk: <_ped.Disk object at 0xb761a348>
DEBUG - created parted.Geometry instance --
start: 1 end: 62500 length: 62500
device: <parted.device.Device object at 0xb7614a18> PedGeometry: <_ped.Geometry object at 0xb7614b80>
DEBUG - created parted.FileSystem instance --
type: ext3 geometry: <parted.geometry.Geometry object at 0xb7614af0> checked: False
PedFileSystem: <_ped.FileSystem object at 0xb761a408>
DEBUG - created parted.Partition instance --
disk: <parted.disk.Disk object at 0xb7614aa8> fileSystem: <parted.filesystem.FileSystem object at 0xb7614a78>
number: -1 path: /dev/sda-1 type: 0
name: None active: True busy: False
geometry: <parted.geometry.Geometry object at 0xb7614af0> PedPartition: <_ped.Partition object at 0xb7624780>
bncs@gpi-box:/opt$ sudo fdisk /dev/sda
sudo: unable to resolve host gpi-box.national.bbc.co.uk: Name or service not known
Welcome to fdisk (util-linux 2.36.1).
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 /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: SanDisk SDSSDX12
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: 0x24fd1996
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 522240 1044479 522240 255M 83 Linux
Am I doing something wrong? I had initially thought it might be the drive. But a test VM behaves in exactly the same manner. I don't have a Debian Buster machine to hand right now to confirm, otherwise I would try running it on that as well.
I was using the version of pyparted that came with install of Debian which appears to be 3.11.7. I have, however tried upgrading to what appears to be the latest (3.20.0), but that doesn't seem to have made any difference.
The text was updated successfully, but these errors were encountered:
Just wanted to comment here and note that I will not be able to look in to this issue for a week or so. But thank you for the detailed report here. Please continue to post here if you have more details. If you are working on a fix, PRs are welcome too.
I've been asked to update an install script that I had written a couple of years to check that it still works correctly under the new(ish) version of Debian. On running it on a test machine, it appears the partition sizing no longer seems to work for me.
Using the demo file
make_one_primary_partition.py
(found in the examples directory), I can create a single partition that uses the entire disk.However, note the start and end positions for the partition don't seem to tally from the pyparted debug code and what
fdisk
is showing.If I modify the example to specify a specific size for the partition:
I get the following:
Am I doing something wrong? I had initially thought it might be the drive. But a test VM behaves in exactly the same manner. I don't have a Debian Buster machine to hand right now to confirm, otherwise I would try running it on that as well.
I was using the version of pyparted that came with install of Debian which appears to be
3.11.7
. I have, however tried upgrading to what appears to be the latest (3.20.0
), but that doesn't seem to have made any difference.The text was updated successfully, but these errors were encountered: