r/linuxquestions • • 7d ago

Why does GParted "check filesystem consistency" 3 times before resizing ?

I understand the need to be sure, hence the first step "check file system", but then it still does it again in "run simulation" and also in "real resize" 🤔

Thanks

12 Upvotes

14 comments sorted by

12

u/FuggaDucker 7d ago edited 7d ago

I am going to guess NTFS? .. It has an additional step.
GParted explicitly runs a simulation and then runs the real resize as two separate commands.
Both invoke ntfsresize which is what is showing the message.

The three executions:
For an NTFS resize, the source establishes this sequence:

  1. Initial check - ntfsresize -i -f -v ** Check filesystem consistency and determine resizing constraints
  2. Simulation - ntfsresize --force -s SIZE --no-action ** Test if the req'd resize will work w/o moding the FS
  3. Real resize - ntfsresize --force --force -s SIZE ** Actually perform the filesystem resize

The first call is made by GParted_Core::check_repair_filesystem().
The second and third are in ntfs::resize().

You can skip the pre-flight checks with the command line but I do not suggest it.
They are there for a reason.

1

u/KaKi_87 7d ago

The thing is, the check that step 1 is, is also ran at step 2 and at step 3.

I'm not looking to skip it, only to not redo it twice.

1

u/FuggaDucker 7d ago

I don't see that in the code at first glance.
If I get a chance, I will debug it later.

1

u/CraveRulex 7d ago

ntfs really out here making simple tasks dramatic, huh? your breakdown actually cleared it up tho

2

u/ipsirc 7d ago edited 7d ago

Why does GParted "check filesystem consistency" 3 times before resizing ?

For safety reasons. You can skip those steps if you have daily backups.

2

u/KaKi_87 7d ago

I'm not wanting to skip, only to not redo twice.

5

u/CobaltOne 7d ago

Because of the old carpenter saying: "Measure twice, cut once."

1

u/Booty_Bumping 5d ago

Progress bars work in mysterious ways