Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-14-2004, 08:22 AM   #1
Registered: Feb 2003
Posts: 229

Rep: Reputation: 34
Wink How do I check free partition space

Is there a command that shows the partition size, the amount used, and the available amount of unused space on a partition ?
Old 04-14-2004, 08:25 AM   #2
Registered: Mar 2004
Location: Virginia
Distribution: PacketProtector
Posts: 331

Rep: Reputation: 30
df -k

will show your mounted filesystems, with their size, amount used (both in actual size and percentage of whole). The -k switch provides the display in kilobytes versus disk blocks.
Old 04-14-2004, 08:30 AM   #3
Registered: Mar 2004
Location: Virginia
Distribution: PacketProtector
Posts: 331

Rep: Reputation: 30
Now that I re-read your message, if you are looking for the sizes of the actual partitions versus the size of the file system you can use the 'fdisk' command and use the 'p' option from the prompt to determine the layout of the partions on a given device

Such as:

[root@mobilev tmp]# /sbin/fdisk /dev/hda

The number of cylinders for this disk is set to 7296.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs

Command (m for help): p

Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3854 30957223+ 7 HPFS/NTFS
/dev/hda2 3855 3867 104422+ 83 Linux
/dev/hda3 3868 7166 26499217+ 83 Linux
/dev/hda4 7167 7296 1044225 f Win95 Ext'd (LBA)
/dev/hda5 7167 7296 1044193+ 82 Linux swap

Command (m for help):
Old 04-14-2004, 09:15 AM   #4
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
or you can use it with the -l option like this:

# fdisk -l /dev/hda

You will get the same result as the p command in fdisk, without actually getting into fdisk.
Good if you are not familiar with fdisk commands. Coz you may mess up your partition table.
Old 04-14-2004, 09:19 AM   #5
Registered: Feb 2003
Posts: 229

Original Poster
Rep: Reputation: 34
Thanks Kvedaa - both of these will be very helpful but the df -k is what I was looking for .....Mike
Old 04-14-2004, 12:35 PM   #6
Registered: Feb 2004
Distribution: Gentoo
Posts: 129

Rep: Reputation: 16
i prefer df -h

just easier for me to look at
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to do a free space regular check baronlynx Linux - General 1 10-04-2005 07:01 PM
How to check free disk space TigerLinux Linux - Newbie 9 10-04-2005 05:04 PM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Partition Free Space? Gerardoj Linux - General 16 06-02-2003 01:16 AM
SCRIPT: check free space on partition base markus1982 Linux - Software 0 05-25-2003 05:52 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration