1

Topic: Question about GParted's used/unused disk space checking

Hi there,

I have been trying to find a way to use parted (or libparted) to output the amount of used/unused space on a given partition, when it is unmounted.
So far I've had no success, and after spending some time in the #parted freenode channel, I was told that libparted does not have this functionality.

So how exactly does GParted manage to display used/unused space of unmounted partitions?

I've downloaded the GParted sources and given them a look, but I'm not at all savvy in either C or C++ so I'm kind of lost there... neutral

Thanks in advance!

2

Re: Question about GParted's used/unused disk space checking

Lets say the partition you want to check is a fat32 partition on /dev/hda1.

>parted /dev/hda1

bla bla bla

>print 1

Minor: 1
Flags:
File System: fat32
Size:         10.0GB (100%)
Minimum size: 8369MB (83.7%) <------- RIGHT HERE
Maximum size: 10.0GB (100%)

100% - 83.7% = 16.3% free

That's how GParted does it. Hope this helps.

Patrick Verner
www.partedmagic.com

3

Re: Question about GParted's used/unused disk space checking

Ah...that was pretty simple.

Thanks a lot! smile

4 (edited by easuter 2007-08-15 23:13:16)

Re: Question about GParted's used/unused disk space checking

Hmm, just one other thing though: what about ext2/ext3 partitions?
I'm not able to get parted to return any information on my ext3 backup partition:

root:# parted /dev/hda print 5
Error: File system has an incompatible feature enabled.

And something similar happens for ext2 as well.
I'm using parted 1.8.2 by the way.

5

Re: Question about GParted's used/unused disk space checking

Never mind, I think I can get the data I need from dumpe2fs.