https://bugs.kde.org/show_bug.cgi?id=464017

            Bug ID: 464017
           Summary: Cannot shrink an ext2/3/4 filesystem
    Classification: Applications
           Product: partitionmanager
           Version: 20.12.2
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: andr...@stikonas.eu
          Reporter: vec...@vectro.org
  Target Milestone: ---

SUMMARY
Attempting to shrink an ext2/3/4 filesystem fails with an error because kpmcore
does not pass the correct arguments to resize2fs.


STEPS TO REPRODUCE
1. Mark an ext2/3/4 for resizing. Specify a smaller size
2. Execute the operatior

OBSERVED RESULT
Job: Resize file system on partition ‘/dev/sdc1’ to 1,827,692,544 sectors 
Resizing file system from 1,953,523,119 to 1,827,692,544 sectors. 

Command: resize2fs /dev/mapper/luks-edfeab04-9935-4f0c-b019-805ceb4f8df8
-125830575s 

Resizing encrypted file system on partition ‘/dev/sdc1’ failed. 
Resize file system on partition ‘/dev/sdc1’ to 1,827,692,544 sectors: Error

EXPECTED RESULT
Operation would succeed

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 11 "Bullseye"
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Running the resize2fs command in the output reveals the actual problem:
$ sudo resize2fs /dev/mapper/luks-edfeab04-9935-4f0c-b019-805ceb4f8df8
-125830575s
[sudo] password for vectro: 
resize2fs 1.46.2 (28-Feb-2021)
resize2fs: invalid option -- '1'
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device
[-b|-s|new_size] [-S RAID-stride] [-z undo_file]

Annoyingly, it is necessary to quote the negative number so that it is not
interpreted as a flag. The command line should be:
resize2fs /dev/mapper/luks-edfeab04-9935-4f0c-b019-805ceb4f8df8 -- -125830575s
(note the extra --)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to