LinuxQuestions.org
Help answer threads with 0 replies.
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 09-11-2003, 07:39 PM   #1
Henry_1
LQ Newbie
 
Registered: Sep 2003
Posts: 29

Rep: Reputation: 15
how to find disk capacity


How can I find the total capacity of my disk on linux. I tried df but it does not give the space allocated to swap
 
Old 09-11-2003, 07:46 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
fdisk -l /dev/hda

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 141 1132551 a0 IBM Thinkpad hibernation
/dev/hda2 * 142 3789 29302560 7 HPFS/NTFS
/dev/hda3 3790 3806 136552+ 83 Linux
/dev/hda4 3807 7296 28033425 5 Extended
/dev/hda5 3807 3931 1004031 82 Linux swap
/dev/hda6 3932 7296 27029331 83 Linux
 
Old 09-11-2003, 07:56 PM   #3
Henry_1
LQ Newbie
 
Registered: Sep 2003
Posts: 29

Original Poster
Rep: Reputation: 15
Thanks David. But its not showing me the disk capacity when I run fdisk -l

fdisk -l /dev/sda

Disk /dev/sda: 255 heads, 63 sectors, 1106 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 50 401593+ 83 Linux
/dev/sda2 51 63 104422+ 6 FAT16
/dev/sda3 64 307 1959930 83 Linux
/dev/sda4 308 1106 6417967+ 5 Extended
/dev/sda5 308 554 1983996 82 Linux swap
/dev/sda6 555 747 1550241 83 Linux
/dev/sda7 748 940 1550241 83 Linux
/dev/sda8 941 1041 811251 83 Linux
/dev/sda9 1042 1106 522081 83 Linux
 
Old 09-11-2003, 11:34 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
It appears your version is different but it is showing it. Just total up the blocks


If you had the version I have it would report 9G


This is what's used, since we are showing partitions.

.........401593
.........104422
.......1959930
.......6417967
.......8883912
..........*..1024
9097125888 bytes


9 GB partitioned space with no gaps between partitions.


The actual disk capacity would be

(16065 * 512) x 1106 = 9097159680 bytes

9 GB

so it's all used

Last edited by DavidPhillips; 09-11-2003 at 11:54 PM.
 
Old 09-11-2003, 11:40 PM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
That is a rather large swap partition.
 
  


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
Can't find hard disk recursv Slackware - Installation 4 06-08-2006 03:10 AM
can not find install disk Pacux Slackware - Installation 7 10-04-2005 07:22 AM
Help! Can't find the right Disk Driver! Jedy Fedora - Installation 3 04-09-2004 03:38 PM
Where can I find a simple tutorial on quota (limit capacity of disk space of a user)? George2 Linux - Software 5 11-04-2003 08:56 AM
How do i find out how much disk space i have Fathonkey Linux - General 5 06-07-2003 03:50 AM


All times are GMT -5. The time now is 07:36 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration