LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-28-2006, 01:03 PM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
The command to find the size of the partitons


[Nissanka@c83-250-99-43 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda11 68G 2.5G 62G 4% /
tmpfs 501M 0 501M 0% /dev/shm
[Nissanka@c83-250-99-43 ~]$


The above command shows the size of the hda11 partiton. It is 68G. I have more partitions.
------------------------------------------------------------------------------------------------------------------------
[root@c83-250-99-43 Nissanka]# /sbin/fdisk -l

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4552 36563908+ 7 HPFS/NTFS
/dev/hda2 4553 24321 158794492+ f W95 Ext'd (LBA)
/dev/hda5 4553 4561 72261 82 Linux swap / Solaris
/dev/hda6 4562 14264 77939316 83 Linux
/dev/hda7 14265 14417 1228941 82 Linux swap / Solaris
/dev/hda8 14418 14418 8001 82 Linux swap / Solaris
/dev/hda9 14419 14419 8001 82 Linux swap / Solaris
/dev/hda10 14420 15183 6136798+ 83 Linux
/dev/hda11 15184 24321 73400953+ 83 Linux
[root@c83-250-99-43 Nissanka]#

How do I find the size of the hda5 and hda6 partitions? What is the command? Your help is greatly appreciated.
 
Old 10-28-2006, 01:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you already have the size there, it's the end unit - start unit * unit size, e.g. for hda5 it's (4561 - 4553) * 8225280
 
Old 10-28-2006, 01:30 PM   #3
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
acid_kewpie

hda5 has the following figures:

Start 4553
End 4561
Blocks 72261
Id 82

How did you calculate?
The figure 8225280 is not clear to me?

I want to know the size. As I wrote, hda11 is 68GB. I just want to know size in GB. I am interested in hda5 and hda6.
 
Old 10-28-2006, 01:33 PM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by Gins
Units = cylinders of 16065 * 512 = 8225280 bytes
That's where that number comes from. You'll get an answer in bytes obviously, but you can easily convert that to gigabytes.
 
Old 10-28-2006, 01:33 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i just read it from the message you posted in the first place.
Quote:
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Old 10-28-2006, 01:40 PM   #6
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks acid_kewpie and nylex for the replies.
--------------------------------------------------------------------------------------
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
--------------------------------------------------------------------------------------

The above figure applies to the entire harddrive. I am interested in hda5 and hda6.
I can't figure out it.
 
Old 10-28-2006, 02:09 PM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Do the calculation that Chris told you to do, namely

Quote:
Originally Posted by acid_kewpie
end unit - start unit * unit size
 
Old 10-28-2006, 02:18 PM   #8
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
end unit - start unit
4553 4561

This is 8.
Unit size is 512.

8*512 = 4096

So the answer is 4096 bytes.

Am I correct? Please tell me.
 
Old 10-28-2006, 02:22 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
*sigh* (4561 - 4553) * 8225280 = 65802240 bytes
 
Old 10-28-2006, 02:55 PM   #10
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks acid_kewpie

So the largest free extended partition is hda6. I have installed Fedora Core 5 on hda11. I wouldn't touch it. I would install Mandriva on hda6.

I guess the following is the swap partition.
tmpfs 501M 0 501M 0% /dev/shm

Is it hda7, hda8, hda9 or hda10? How do I find it?
 
Old 10-28-2006, 04:11 PM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
it's none of them, tmpfs is held in ram only.
 
Old 10-28-2006, 06:18 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Glad you people don't calculate my tax .... - try your math on hda8.
As for swap, you'd better hope you are using hda7 - you can check by issuing "swapon -s" from a terminal/console.
No point in all those (small) swap partitions.
 
Old 10-28-2006, 10:18 PM   #13
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
On my system, the blocks column in fdisk -l /dev/sda is the near/same as size listed in qparted. This is also what shows from the command: cat /proc/partitions. So, it would seem that no calcutating is needed as I can easily see that all of my ext3 partitions are about 20GB and the swap is about 600MB. Just the way I made them.
Code:
fdisk -l /dev/sda

Disk /dev/sda: 100.2 GB, 100256292864 bytes
255 heads, 63 sectors/track, 12188 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2433    19543041   83  Linux
/dev/sda2            2434        4866    19543072+  83  Linux
/dev/sda3            4867        4940      594405   82  Linux swap / Solaris
/dev/sda4            4941       12188    58219560    5  Extended
/dev/sda5            4941        7373    19543041   83  Linux
/dev/sda6            7374        9806    19543041   83  Linux
Code:
cat /proc/partitions
major minor  #blocks  name

   8     0   97906536 sda
   8     1   19543041 sda1
   8     2   19543072 sda2
   8     3     594405 sda3
   8     5   19543041 sda5
   8     6   19543041 sda6
Edit: I forgot to mention that fdisk -s or sfdisk -s also report partition size to be same as block in other commands.
Code:
fdisk -s /dev/sda1
19543041

Last edited by homey; 10-28-2006 at 10:44 PM.
 
Old 10-29-2006, 03:10 AM   #14
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks for the replies.

[Nissanka@c83-250-99-43 ~]$ swapon -s
bash: swapon: command not found
[Nissanka@c83-250-99-43 ~]$

[root@c83-250-99-43 Nissanka]# swapon -s
bash: swapon: command not found
[root@c83-250-99-43 Nissanka]#

The swapon command did not work. How do I find my swap partition?
 
Old 10-29-2006, 04:50 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Mmmm - some crappy redhat derivative no doubt. Try either of these
Code:
/sbin/swapon -s
cat /proc/swaps
 
  


Reply



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
Linux/Unix Command to find RAM size? ssnkumar Linux - General 9 09-09-2009 09:38 AM
what command can i use to find files of a certain size? abutzki Linux - Newbie 2 01-31-2006 07:43 AM
command to find size of a dir Longinus Linux - Newbie 3 08-01-2004 08:19 PM
Command to find total file size satimis Linux - Newbie 1 01-22-2004 11:19 AM
Installing and don't know how many or what size partitons to make. Travis86 Linux - Newbie 14 05-23-2003 09:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:33 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
Open Source Consulting | Domain Registration