Summary: | Cannot shrink an ext2/3/4 filesystem | ||
---|---|---|---|
Product: | [Applications] partitionmanager | Reporter: | Ian Turner <vectro> |
Component: | general | Assignee: | Andrius Štikonas <andrius> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 20.12.2 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ian Turner
2023-01-08 20:37:43 UTC
I think the bug is right here: https://github.com/KDE/kpmcore/blob/ce39e149040bce9782b91e532d041ca0c7548a77/src/fs/ext2.cpp#L181 There should be an extra "--" as the first parameter. Actually, looking more closely at the resize2fs documentation, I think the problem is that we are passing a negative number at all. And unfortunately, I'm now unable to reproduce this issue. (In reply to Ian Turner from comment #2) > Actually, looking more closely at the resize2fs documentation, I think the > problem is that we are passing a negative number at all. And unfortunately, > I'm now unable to reproduce this issue. Yeah, I was just going to say that it shouldn't be negative number. Strangely that negative number is equal to 1,953,523,119 - 1,827,692,544, so the difference between final and current size. Do you remember whether you were trying to reduce it by a bit (1,953,523,119 -> 1,827,692,544) or by a lot 1,953,523,119 to 125830575 sectors? I.e. my guess is that maybe something went wrong and newLength() was -1 https://invent.kde.org/system/kpmcore/-/blob/master/src/jobs/resizefilesystemjob.cpp#L82 I was trying to reduce it by 60 gibibytes (to 892428 mebibytes). While I was playing around with it I reduced it by a much smaller amount (< 1GB) and then reduced it a second time to the desired size, and that worked. So possible there is some mathy issue. I suppose that one possible step forward would be to change some of these types to unsigned, or to add asserts. (In reply to Ian Turner from comment #4) > I suppose that one possible step forward would be to change some of these > types to unsigned I suspect this is easier said than done. Probably both API and ABI would break. > or to add asserts. Asserts might be useful though. |