LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 03-10-2007, 01:40 AM   #1
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Rep: Reputation: 15
fdisk problem


Can you please tell me how much cylinder size is equal to 1 MB. Below is the /dev/sda5 size.. What is the size of this parttion (in MB or GB) what this block signifies and ID means ?????


Device Boot Start End Blocks Id System

/dev/sda5 8756 8856 610407 82 Linux






and sometimes + is marked after block ..what is this ??
/dev/sda1 1 4854 38989723+
 
Old 03-10-2007, 08:50 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I get 298 MB for the partition size.

Blocks on disk are 512 bytes.
Two blocks = 1 KB. (1024 bytes)
1 MB = 1024 bytes times 1024 bytes = 1,048,576 bytes.

610,407 blocks times 512 bytes = 312,528,384 bytes.

312,528,384 bytes divided by 1 MB = 298.05029296875 MB.

Note that hard drive manufacturers will often calculate 1 MB = 1000 x 1000 and they will calculate 1 GB as 1000 x 1000 x 1000. This obviously makes it look like they have more capacity than they actually do have since they are dividing the total number of bytes on the disk by a smaller number than if they used 1024 x 1024 for 1 MB and 1024 x 1024 x 1024 for 1 GB.

If we used those misleading values then your partition would falsely appear to be 312.5 MB. It's about exactly what the words mean. A megabyte is a power of two rounded down to the nearest million while a million bytes is an exact measurement. This is why it is possible to purchase a 200 GB hard drive and your computer will say that it is only 186 GB.

200,000,000,000 divided by (1024 x 1024 x 1024) equals 186.2645149230957031

Last edited by stress_junkie; 03-10-2007 at 09:15 AM.
 
Old 03-10-2007, 08:57 AM   #3
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
SHHH!!!

don't tell people that hardware manufacturers take after Politicians and Microsoft and lie to everyone.
people have to have something they can trust. ~eg~
 
Old 03-10-2007, 09:11 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You should take a look at README.fdisk found in utils-linux package for a full expalanation. Anyway, blocks is the size of the partition in kbytes and id is the hex value of the type of the partition. Hence in your case sda5 is 610,4M swap (id=82) partition.
The + flag means that the partition has an odd number of sectors which will be wasted.
 
Old 03-10-2007, 12:04 PM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by bathory
You should take a look at README.fdisk found in utils-linux package for a full explanation. Anyway, blocks is the size of the partition in kbytes and id is the hex value of the type of the partition.
I couldn't find the README.fdisk on my computer.

A quick experiment proved you to be correct. The fdisk utility does report blocks as 1K units or something like that.
Code:
root> fdisk -l /dev/hda
...
/dev/hda3   *        1156        2249     8787555   83  Linux
...

root> df -h /dev/hda3
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3             8.3G  2.2G  5.8G  28% /mnt/hda3
Well. I think I'll just go home now.
 
Old 03-10-2007, 04:18 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by stress_junkie
I couldn't find the README.fdisk on my computer.
In slackware the README.fdisk is located in /usr/doc/util-linux-2.12r/README.fdisk. You can read it online here

Regards

Last edited by bathory; 03-10-2007 at 04:19 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird fdisk problem (Fdisk unable to see winxp partitions) khidot Slackware - Installation 5 04-07-2007 09:26 PM
fdisk problem JediDrunk Slackware - Installation 6 10-18-2006 07:20 AM
fdisk problem JediDrunk Linux - Newbie 2 10-12-2006 03:23 AM
fdisk problem JellyWerker Linux - Hardware 4 12-17-2005 11:46 PM
Problem with fdisk Tinku Linux - General 14 11-11-2005 08:44 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 06:07 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