Skip to content
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

Resize an logical volume with ntfs on it errors out since 2.03.22 #123

Closed
jelly opened this issue Aug 8, 2023 · 3 comments
Closed

Resize an logical volume with ntfs on it errors out since 2.03.22 #123

jelly opened this issue Aug 8, 2023 · 3 comments

Comments

@jelly
Copy link

jelly commented Aug 8, 2023

Resizing a logical volume with a ntfs filesystem created by ntfs-3g errors out since 2.03.22

Reproducer

Prepare lvm

qemu-img create -f raw lvm.img 100M
sudo losetup --find --show lvm.img
vgcreate testvg /dev/loop0
lvcreate -L50M -ntest testvg
/usr/bin/mkfs.ntfs /dev/mapper/testvg-test

Try to resize

lvresize --verbose --size 25M /dev/mapper/testvg-test

On lvm2 2.03.21 this succeeded

[root@archlinux ~]# lvresize --verbose --size 25M /dev/mapper/testvg-test
  Rounding size to boundary between physical extents: 28.00 MiB.
  WARNING: Reducing active logical volume to 28.00 MiB.
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce testvg/test? [y/n]: y
  Accepted input: [y]
  Reducing logical volume testvg/test to 28.00 MiB
  Size of logical volume testvg/test changed from 52.00 MiB (13 extents) to 28.00 MiB (7 extents).
  Archiving volume group "testvg" metadata (seqno 2).
  Loading table for testvg-test (253:1).
  Suspending testvg-test (253:1) with device flush
  Resuming testvg-test (253:1).
  Logical volume testvg/test successfully resized.
  Creating volume group backup "/etc/lvm/backup/testvg" (seqno 3).

On 2.03.22

[root@archlinux ~]# lvresize --verbose --size 25M /dev/mapper/testvg-test
  Rounding size to boundary between physical extents: 28.00 MiB.
  File system ntfs found on testvg/test.
  File system device usage is not available from libblkid.
@zkabelac
Copy link
Contributor

zkabelac commented Aug 8, 2023

Hi

You may likely want to try --fs ignore option.
As this operation leads to potential data loss - there was added this 'extra' option.

@zkabelac zkabelac closed this as completed Aug 9, 2023
@mvollmer
Copy link

mvollmer commented Aug 10, 2023

This also reproduces with the --force option. Shouldn't --force imply --fs ignore?

# lvresize --force --verbose --size 25M /dev/mapper/testvg-test
  Rounding size to boundary between physical extents: 28.00 MiB.
  File system ntfs found on testvg/test.
  File system device usage is not available from libblkid.

@zkabelac
Copy link
Contributor

Well the '--fs ignore' is a way to tell lvm2 to ignore anything what is on the storage when reducing a volume - as there were many reports from users who where losing their data during volume reduction too 'easily' - so yeah - when you always use '--fs ignore' it's kind of erasing protection added on lvm2 side.... - but at least we now have journaled commands with 'ignore' being passed as an intentional option...

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

3 participants