1

Topic: Where is 'calibrate'? How can 'gparted' run a cmd that doesn't exist?

My experiences with 'gparted'.

I unmounted '/dev/sdb1'
I ran 'Check'
'Check' completed successfully.

I clicked the 'GPparted Details' button
========================================
GParted 0.25.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2
Check and repair file system (ntfs) on /dev/sdb1  00:00:14    ( SUCCESS )
        
calibrate /dev/sdb1  00:00:01    ( SUCCESS )
        
path: /dev/sdb1 (partition)
start: 2048
end: 3906963455
size: 3906961408 (1.82 TiB)
check file system on /dev/sdb1 for errors and (if possible) fix them  00:00:10    ( SUCCESS )
        
ntfsresize -i -f -v /dev/sdb1  00:00:10    ( SUCCESS )
        
ntfsresize v2015.3.14AR.1 (libntfs-3g)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 2000364237312 bytes (2000365 MB)
Current device size: 2000364240896 bytes (2000365 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Space in use : 463126 MB (23.2%)
Collecting resizing constraints ...
Estimating smallest shrunken size supported ...
File feature Last used at By inode
Multi-Record : 795153 MB 219503
$MFTMirr : 1000183 MB 1
Ordinary : 1000244 MB 10
You might resize at 463125434368 bytes or 463126 MB (freeing 1537239 MB).
Please make a test run using both the -n and -s options before real resizing!
grow file system to fill the partition  00:00:03    ( SUCCESS )
        
run simulation  00:00:02    ( SUCCESS )
        
ntfsresize --force --force --no-action /dev/sdb1  00:00:02    ( SUCCESS )
        
ntfsresize v2015.3.14AR.1 (libntfs-3g)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 2000364237312 bytes (2000365 MB)
Current device size: 2000364240896 bytes (2000365 MB)
New volume size : 2000364237312 bytes (2000365 MB)
Nothing to do: NTFS volume size is already OK.
real resize  00:00:01    ( SUCCESS )
        
ntfsresize --force --force /dev/sdb1  00:00:01    ( SUCCESS )
        
ntfsresize v2015.3.14AR.1 (libntfs-3g)
Device name : /dev/sdb1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 2000364237312 bytes (2000365 MB)
Current device size: 2000364240896 bytes (2000365 MB)
New volume size : 2000364237312 bytes (2000365 MB)
Nothing to do: NTFS volume size is already OK.
========================================

I see that Gparted is a GUI front-end for 'calibrate' & 'ntfsresize'. Since I only want to check the file system, I attempted to run 'calibrate' in Terminal.
========================================
mark@mark-Lenovo-V570 ~ $ sudo calibrate /dev/sdb1
[sudo] password for mark:
sudo: calibrate: command not found
mark@mark-Lenovo-V570 ~ $
========================================
Huh? "command not found"? How can 'gparted' run it?

Figuring that I 1st need to find where 'gparted' is located, I searched for 'gparted' using a script I wrote.
========================================
Results of search for "gparted"
(Tip: Use 'Save As...' to permanently save this list)

/usr/share/gnome/help/gparted/
/usr/share/gnome/help/gparted/sl/
/usr/share/gnome/help/gparted/sl/figures/
/usr/share/gnome/help/gparted/sl/figures/gparted_window.png
/usr/share/gnome/help/gparted/sl/gparted.xml
/usr/share/gnome/help/gparted/it/
/usr/share/gnome/help/gparted/it/figures/
/usr/share/gnome/help/gparted/it/figures/gparted_window.png
/usr/share/gnome/help/gparted/it/gparted.xml
/usr/share/gnome/help/gparted/ru/
/usr/share/gnome/help/gparted/ru/figures/
/usr/share/gnome/help/gparted/ru/figures/gparted_window.png
/usr/share/gnome/help/gparted/ru/gparted.xml
/usr/share/gnome/help/gparted/th/
/usr/share/gnome/help/gparted/th/figures/
/usr/share/gnome/help/gparted/th/figures/gparted_window.png
/usr/share/gnome/help/gparted/th/gparted.xml
/usr/share/gnome/help/gparted/gd/
/usr/share/gnome/help/gparted/gd/figures/
/usr/share/gnome/help/gparted/gd/figures/gparted_window.png
/usr/share/gnome/help/gparted/gd/gparted.xml
/usr/share/gnome/help/gparted/sr@latin/
/usr/share/gnome/help/gparted/sr@latin/figures/
/usr/share/gnome/help/gparted/sr@latin/figures/gparted_window.png
/usr/share/gnome/help/gparted/sr@latin/gparted.xml
/usr/share/gnome/help/gparted/C/
/usr/share/gnome/help/gparted/C/figures/
/usr/share/gnome/help/gparted/C/figures/gparted_window.png
/usr/share/gnome/help/gparted/C/gparted.xml
/usr/share/gnome/help/gparted/sr/
/usr/share/gnome/help/gparted/sr/figures/
/usr/share/gnome/help/gparted/sr/figures/gparted_window.png
/usr/share/gnome/help/gparted/sr/gparted.xml
/usr/share/gnome/help/gparted/de/
/usr/share/gnome/help/gparted/de/figures/
/usr/share/gnome/help/gparted/de/figures/gparted_window.png
/usr/share/gnome/help/gparted/de/gparted.xml
/usr/share/gnome/help/gparted/cs/
/usr/share/gnome/help/gparted/cs/figures/
/usr/share/gnome/help/gparted/cs/figures/gparted_window.png
/usr/share/gnome/help/gparted/cs/gparted.xml
/usr/share/gnome/help/gparted/sv/
/usr/share/gnome/help/gparted/sv/figures/
/usr/share/gnome/help/gparted/sv/figures/gparted_window.png
/usr/share/gnome/help/gparted/sv/gparted.xml
/usr/share/gnome/help/gparted/el/
/usr/share/gnome/help/gparted/el/figures/
/usr/share/gnome/help/gparted/el/figures/gparted_window.png
/usr/share/gnome/help/gparted/el/gparted.xml
/usr/share/gnome/help/gparted/pt_BR/
/usr/share/gnome/help/gparted/pt_BR/figures/
/usr/share/gnome/help/gparted/pt_BR/figures/gparted_window.png
/usr/share/gnome/help/gparted/pt_BR/gparted.xml
/usr/share/gnome/help/gparted/es/
/usr/share/gnome/help/gparted/es/figures/
/usr/share/gnome/help/gparted/es/figures/gparted_window.png
/usr/share/gnome/help/gparted/es/gparted.xml
/usr/share/gnome/help/gparted/ro/
/usr/share/gnome/help/gparted/ro/figures/
/usr/share/gnome/help/gparted/ro/figures/gparted_window.png
/usr/share/gnome/help/gparted/ro/gparted.xml
/usr/share/gnome/help/gparted/te/
/usr/share/gnome/help/gparted/te/figures/
/usr/share/gnome/help/gparted/te/figures/gparted_window.png
/usr/share/gnome/help/gparted/te/gparted.xml
/usr/share/gnome/help/gparted/fr/
/usr/share/gnome/help/gparted/fr/figures/
/usr/share/gnome/help/gparted/fr/figures/gparted_window.png
/usr/share/gnome/help/gparted/fr/gparted.xml
/usr/share/omf/gparted/
/usr/share/omf/gparted/gparted-sl.omf
/usr/share/omf/gparted/gparted-th.omf
/usr/share/omf/gparted/gparted-gd.omf
/usr/share/omf/gparted/gparted-te.omf
/usr/share/omf/gparted/gparted-pt_BR.omf
/usr/share/omf/gparted/gparted-it.omf
/usr/share/omf/gparted/gparted-fr.omf
/usr/share/omf/gparted/gparted-el.omf
/usr/share/omf/gparted/gparted-es.omf
/usr/share/omf/gparted/gparted-sv.omf
/usr/share/omf/gparted/gparted-ru.omf
/usr/share/omf/gparted/gparted-cs.omf
/usr/share/omf/gparted/gparted-C.omf
/usr/share/omf/gparted/gparted-de.omf
/usr/share/omf/gparted/gparted-ro.omf
/usr/share/omf/gparted/gparted-sr.omf
/usr/share/omf/gparted/gparted-sr@latin.omf
/usr/share/applications/gparted.desktop
/usr/share/man/man8/gparted.8.gz
/usr/share/polkit-1/actions/com.ubuntu.pkexec.gparted.policy
/usr/share/menu/gparted
/usr/share/app-install/desktop/gparted:gparted.desktop
/usr/share/app-install/icons/gparted.svg
/usr/share/linuxmint/mintinstall/installed/gparted.png
/usr/share/linuxmint/mintinstall/icons/gparted.png
/usr/share/icons/Mint-Y/apps/96/gparted.png
/usr/share/icons/Mint-Y/apps/22/gparted.png
/usr/share/icons/Mint-Y/apps/256/gparted.png
/usr/share/icons/Mint-Y/apps/64/gparted.png
/usr/share/icons/Mint-Y/apps/24/gparted.png
/usr/share/icons/Mint-Y/apps/16/gparted.png
/usr/share/icons/Mint-Y/apps/48/gparted.png
/usr/share/icons/Mint-Y/apps/32/gparted.png
/usr/share/icons/hicolor/22x22/apps/gparted.png
/usr/share/icons/hicolor/16x16/apps/gparted.png
/usr/share/icons/hicolor/32x32/apps/gparted.png
/usr/share/icons/hicolor/24x24/apps/gparted.png
/usr/share/icons/hicolor/scalable/apps/gparted.svg
/usr/share/icons/hicolor/48x48/apps/gparted.png
/usr/share/icons/Mint-X/apps/96/gparted.svg
/usr/share/icons/Mint-X/apps/22/gparted.png
/usr/share/icons/Mint-X/apps/24/gparted.png
/usr/share/icons/Mint-X/apps/16/gparted.png
/usr/share/icons/Mint-X/apps/48/gparted.png
/usr/share/icons/Mint-X/apps/32/gparted.png
/usr/share/appdata/gparted.appdata.xml
/usr/share/locale-langpack/en_GB/LC_MESSAGES/gparted.mo
/usr/share/locale-langpack/en_AU/LC_MESSAGES/gparted.mo
/usr/share/locale-langpack/en_CA/LC_MESSAGES/gparted.mo
/usr/share/pixmaps/gparted.xpm
/usr/share/doc/gparted/
/usr/share/doc/gparted/README.gz
/usr/share/doc/gparted/changelog.Debian.gz
/usr/share/doc/gparted/copyright
/usr/sbin/gparted
/usr/sbin/gpartedbin
/usr/bin/gparted-pkexec
/var/lib/dpkg/info/gparted.list
/var/lib/dpkg/info/gparted.postinst
/var/lib/dpkg/info/gparted.postrm
/var/lib/dpkg/info/gparted.md5sums
/home/mark/gparted_details.htm
========================================
/* Bitch mode ON */
Comment: I just can't stand how Linux (and UNIX before it) spews the files for applications all over the disk. I know, I know, Linux is oriented to system programmers, but spewing files all over the place for applications is just plain ...ummm ...lame.
/* Bitch mode OFF */

I assume that '/usr/sbin/gparted' is the executable. But what's '/usr/sbin/gpartedbin'? and what's '/usr/bin/gparted-pkexec'? ...to be discovered later.

Okay, where is the 'calibrate' command? (Obviously, it can't be on the PATH.)
========================================
Results of search for "calibrate"
(Tip: Use 'Save As...' to permanently save this list)

/usr/share/man/man8/cups-calibrate.8.gz
/usr/share/man/man8/calibrate_ppa.8.gz
/usr/share/app-install/desktop/hugin:calibrate_lens_gui.desktop
/usr/share/app-install/desktop/gnome-color-manager:gcm-calibrate.desktop
/usr/share/colord/icons/color-munki-photo-calibrate.svg
/usr/share/help-langpack/en_GB/ubuntu-help/color-calibrate-screen.page
/usr/share/help-langpack/en_GB/ubuntu-help/color-why-calibrate.page
/usr/share/help-langpack/en_GB/ubuntu-help/color-calibrate-scanner.page
/usr/share/help-langpack/en_GB/ubuntu-help/color-calibrate-printer.page
/usr/share/help-langpack/en_GB/ubuntu-help/color-calibrate-camera.page
/usr/share/help-langpack/en_AU/ubuntu-help/color-calibrate-screen.page
/usr/share/help-langpack/en_AU/ubuntu-help/color-why-calibrate.page
/usr/share/help-langpack/en_AU/ubuntu-help/color-calibrate-scanner.page
/usr/share/help-langpack/en_AU/ubuntu-help/color-calibrate-printer.page
/usr/share/help-langpack/en_AU/ubuntu-help/color-calibrate-camera.page
/usr/share/help-langpack/en_CA/ubuntu-help/color-calibrate-screen.page
/usr/share/help-langpack/en_CA/ubuntu-help/color-why-calibrate.page
/usr/share/help-langpack/en_CA/ubuntu-help/color-calibrate-scanner.page
/usr/share/help-langpack/en_CA/ubuntu-help/color-calibrate-printer.page
/usr/share/help-langpack/en_CA/ubuntu-help/color-calibrate-camera.page
/usr/share/doc-base/pnm2ppa-calibrate
/usr/share/cups/calibrate.ppm
/usr/src/linux-headers-4.4.0-21-generic/include/config/generic/calibrate/
/usr/src/linux-headers-4.4.0-21-generic/include/config/generic/calibrate/delay.h
/usr/bin/cups-calibrate
/usr/bin/calibrate_ppa
/var/lib/doc-base/omf/pnm2ppa-calibrate/
/var/lib/doc-base/omf/pnm2ppa-calibrate/pnm2ppa-calibrate-C.omf
/var/lib/doc-base/documents/pnm2ppa-calibrate
/home/mark/Data/Ref/ref_Internet-WWW_script/my_library/calibrate/
/home/mark/Data/Ref/ref_Internet-WWW_script/my_library/calibrate/calibrate_.js
/home/mark/Data/Settings/Display calibration/Tool to calibrate display RGB gamma = calibrize_2_setup.exe
========================================
Huh? Where is 'calibrate'? How can 'gparted' run a command that does not exist?

...to be continued when the current mystery is solved.

Thanks for your help.

2

Re: Where is 'calibrate'? How can 'gparted' run a cmd that doesn't exist?

Thank you for your interest in GParted.

Links to the source code and further details can be found on the GParted development page.

The calibrate operation is internal to GParted.  See the calls to the calibrate method in the source code for more details.