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

TRIM remainder after shrinking? #191

Open
Jille opened this issue Aug 4, 2024 · 1 comment
Open

TRIM remainder after shrinking? #191

Jille opened this issue Aug 4, 2024 · 1 comment

Comments

@Jille
Copy link

Jille commented Aug 4, 2024

Just a shower thought: Could resize2fs issue TRIM commands for all the "released" space after shrinking?

That would allow GCP Persistent Disk to safely allow shrinking if and only if the reduced size was trimmed. I don't know whether partitioning tools could also check whether the to-be-dropped space is trimmed on a disk backed block device, but worst case they could check for it all being zero.

This could all live behind optional flags not to have the performance degradation, but available for people who'd prefer the extra safety.

@tytso
Copy link
Owner

tytso commented Aug 4, 2024

It wouldn't be hard for resize2fs to issue the trim command. I can't speak to whether the GCP's Persistent Disk would be willing to shrink the space if and only if all of the reduced space was trimmed. Partitioning tools can't check whether the to-be-dropped space was trimed; but the partitioning tools could very much check the file system's superblock for common file system types to determine whether it would be safe to shrink the partition.

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

2 participants