10000 sfdisk --move-data dropping msdos partition · Issue #3568 · util-linux/util-linux · GitHub
[go: up one dir, main page]

Skip to content

sfdisk --move-data dropping msdos partition #3568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
champtar opened this issue May 13, 2025 · 0 comments
Open

sfdisk --move-data dropping msdos partition #3568

champtar opened this issue May 13, 2025 · 0 comments

Comments

@champtar
Copy link

Here a reproducer on my Fedora 42 (util-linux-2.40.4-7.fc42.x86_64 / parted-3.6-11.fc42.x86_64):

truncate -s100G ./testdisk

parted -s ./testdisk -- mklabel msdos \
  mkpart primary ext3 2MiB 130MiB \
  set 1 boot on \
  mkpart extended 256MiB 100% \
      set 2 lba off \
  mkpart logical ext4 1GiB 9GiB \
  mkpart logical ext4 10GiB 18GiB \
  mkpart logical ext4 19GiB 30GiB \
  mkpart logical ext4 31GiB 100%
# resize2fs ...
echo ',-8G' | sfdisk --lock ./testdisk -N8
echo '+8G,' | sfdisk --move-data --lock ./testdisk -N8
sfdisk -l ./testdisk
# partition 8 still present

echo '+8G,' | sfdisk --move-data --lock ./testdisk -N7
sfdisk -l ./testdisk
# see that partition 8 was dropped (despite showing up in 'New situation')

echo '+4G,' | sfdisk --move-data --lock ./testdisk -N6
sfdisk -l ./testdisk
# see that partition 7 was dropped (despite showing up in 'New situation')

Doing the same with gpt partition table works fine

truncate -s100G ./testdisk

parted -s ./testdisk -- mklabel gpt \
  mkpart primary ext3 2MiB 130MiB \
  mkpart primary fat32 131MiB 512MiB \
  set 2 esp on \
  mkpart primary ext3 800MiB 850MiB \
  mkpart primary ext3 850MiB 900MiB \
  mkpart primary ext4 1GiB 9GiB \
  mkpart primary ext4 10GiB 18GiB \
  mkpart primary ext4 19GiB 30GiB \
  mkpart primary ext4 31GiB 100%

# ...

This also affects 2.38.1 (Debian)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0