LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 04-14-2004, 09:22 AM   #1
explorer
Member
 
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, 09:25 AM   #2
kvedaa
Member
 
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, 09:30 AM   #3
kvedaa
Member
 
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
(e.g., DOS FDISK, OS/2 FDISK)

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, 10:15 AM   #4
koyi
Member
 
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, 10:19 AM   #5
explorer
Member
 
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, 01:35 PM   #6
John5788
Member
 
Registered: Feb 2004
Location: 127.0.0.1
Distribution: Gentoo
Posts: 129

Rep: Reputation: 15
i prefer df -h

just easier for me to look at
 
  


Reply


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 08:01 PM
How to check free disk space TigerLinux Linux - Newbie 9 10-04-2005 06:04 PM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 11:19 PM
Partition Free Space? Gerardoj Linux - General 16 06-02-2003 02:16 AM
SCRIPT: check free space on partition base markus1982 Linux - Software 0 05-25-2003 06:52 AM


All times are GMT -5. The time now is 07:10 AM.

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