After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326640 - Gparted shows incorrect partition size in user interface
Gparted shows incorrect partition size in user interface
Status: RESOLVED NOTABUG
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2006-01-11 18:36 UTC by Daniel Holbach
Modified: 2006-01-27 13:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Holbach 2006-01-11 18:36:44 UTC
Forwarded from: http://bugzilla.ubuntu.com/show_bug.cgi?id=18604

Gparted shows incorrect partition size in user interface - it differs from
numbers, which are passed to external commands, for example to ntfsresize :(
In some cases this couses big problems - gparted displays bigger size, than is
passed to external commands (for example to ntfsresize), and sometimes external
utilities simply doesn't work, because they sometimes gets smaller size, than is
possible to use :(.
I can give an exact example - for example if you have ntfs partition partially
filled with data and you want to resize this partition to smalled possible size,
then parted passes smaller numbers to ntfsresize program, than you specified and
sometimes they are smaller, than is possible (because in that partition there
are more data, that gparted passes to ntfsresize) and because of this ntfsresize
program does not resize at all.
I'm attaching 2 screenshots and gparted output in terminal window. In first
screenshot GParted-before_ntfsresize_to_29500 is displayed situation before
resising ntfs partition - it show one ntfs partition, which is set to resize to
29500 Mb. In second screenshot is displayed situation, which is after pressing
button apply - it show one ntfs partition, which size is 29502 Mb. All this
looks good, but in terminal output I got:

root@lema-int-57:~# gparted
======================
libparted : 1.6.21
======================
Warning: Unable to open /dev/hdc read-write (Read-only file system).  /dev/hdc
has been opened read-only.
Error: Unable to open /dev/hdc - unrecognised disk label.
echo y | ntfsresize -f /dev/hda1
echo y | ntfsresize -f /dev/hda1 -s 29492M
echo y | ntfsresize -f /dev/hda1
echo y | ntfsresize -f /dev/hda1
echo y | ntfsresize -f /dev/hda1
Warning: Unable to open /dev/hdc read-write (Read-only file system).  /dev/hdc
has been opened read-only.
Error: Unable to open /dev/hdc - unrecognised disk label.

So, as you see gparted passed 29492M instead of 29500 :(


http://bugzilla.ubuntu.com/attachment.cgi?id=4820 (Screenshot of gparted version 0.0.8+cvs2005100501-0ubuntu1 before resizing ntfs partition)
http://bugzilla.ubuntu.com/attachment.cgi?id=4821 (Screenshot of gparted version 0.0.8+cvs2005100501-0ubuntu1 after resizing ntfs partition)


This bug still exists with latest gparted from ubuntu dapper - Ver.
0.0.9+cvs2006.01.08-0ubuntu4

I tried to resize ntfs partition to 32000, but gparted passed 31992 to ntfsresize :(
Comment 1 Plors (Bart H) 2006-01-11 19:04:03 UTC
You shouldn't take the numbers in the console too seriously. Most of them are calculated with rounding to cylinders in mind. Since most modern harddisks have a cylindersize of 8 MB, the number passed to the filesystem during resize is usually 8 MB smaller then you'd expect.

All this is done to prevent the filesystem from being larger then the actual partition. But don't you worry, after the resize the filesystem is growed to fit _exactly_ in the partition.

So a typical shrink would require the following steps:
- shrink the filesystem (make sure it's smaller then the partition)
- shrink the partition
- regrow the filesystem to fit exactly in the partition

I hope this makes it a bit more clear to you.

Please let me know if you don't understand something or if i misunderstood you somehow ;)
Comment 2 Plors (Bart H) 2006-01-11 19:17:38 UTC
btw, you DO know about rounding to cylinders right? In short it means your new values may differ between 0 MB and 'cylindersize' MB from what you expected.

This explains why your 29500 partition ended up 2 MB larger :)
Comment 3 Plors (Bart H) 2006-01-27 13:32:17 UTC
no response for over 14 days. 

please re-open if needed.