Package: fdisk
Version: 2.38.1-5+b1
Severity: normal

Dear Maintainer,

This dumpfile defines 3 partitions to be created:

```
label: gpt
unit: sectors
first-lba: 2048
sector-size: 512

1: size=512MiB, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B
2: size=512MiB, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
3: type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
```

Using sfdisk:
# sfdisk /dev/sdb <this.dump

The output is like this:

```
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 100 MiB, 104857600 bytes, 204800 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

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new GPT disklabel (GUID: 21A415C2-8B45-9A40-B25E-4FBD0667FED4).
/dev/sdb1: Created a new partition 1 of type 'EFI System' and of size 10 MiB.
/dev/sdb2: Created a new partition 2 of type 'Linux filesystem' and of size 10 
MiB.
/dev/sdb3: Created a new partition 3 of type 'Linux filesystem' and of size 78 
MiB.
/dev/sdb4: Done.

New situation:
Disklabel type: gpt
Disk identifier: 21A415C2-8B45-9A40-B25E-4FBD0667FED4

Device     Start    End Sectors Size Type
/dev/sdb1   2048  22527   20480  10M EFI System
/dev/sdb2  22528  43007   20480  10M Linux filesystem
/dev/sdb3  43008 202751  159744  78M Linux filesystem

The partition table has been altered.
Syncing disks.
```

Notice this part:

```
/dev/sdb1: Created a new partition 1 of type 'EFI System' and of size 10 MiB.
/dev/sdb2: Created a new partition 2 of type 'Linux filesystem' and of size 10 
MiB.
/dev/sdb3: Created a new partition 3 of type 'Linux filesystem' and of size 78 
MiB.
/dev/sdb4: Done.
```

The /dev/sdb4 is not supposed to be there. It appears sfdisk is reusing the 
partition counter for line numbers.

If this is an upstream bug, please forward it on my behalf, I cannot github 
from where I live.

Thank you!

-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-10-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages fdisk depends on:
ii  libc6          2.36-9+deb12u1
ii  libfdisk1      2.38.1-5+b1
ii  libmount1      2.38.1-5+b1
ii  libncursesw6   6.4-4
ii  libreadline8   8.2-1.3
ii  libsmartcols1  2.38.1-5+b1
ii  libtinfo6      6.4-4

Versions of packages fdisk recommends:
ii  sensible-utils  0.0.17+nmu1

fdisk suggests no packages.

-- no debconf information

Reply via email to