View previous topic :: View next topic |
Author |
Message |
0x001A4 Apprentice
Joined: 08 Jan 2006 Posts: 263 Location: Mississauga, Ontario
|
Posted: Wed Jul 16, 2008 3:56 pm Post subject: [SOLVED] fdisk - blocks to bytes |
|
|
Can anyone tell me how to calculate the number of bytes per partition based on the number of blocks fdisk tells me I have?
This is what I have figured and I'm not sure if it's correct:
I have 3 250GB harddrives. The first one I'll use in my example. It has 4 partitions, including one for swap.
Code: | Partition - Blocks
/dev/sda1 - 71681998
/dev/sda2 - 71682030
/dev/sda3 - 10241437
/dev/sda4 - 90590535 |
What I have figured is if I divide the number of blocks by 1024, and then divide the result by 1024 again, I get a number that looks right.
So I have this:
Code: | Partition - Size (GB)
/dev/sda1 - 68.36
/dev/sda2 - 68.36
/dev/sda3 - 9.77
/dev/sda4 - 86.39
Total - 232.88 |
Now this looks right to me except for the 10GB of swap space. I cant imagine giving that much space to swap but who knows. Can anyone confirm or know of a better way to calculate disk space based on any of the information fdisk gives?
Last edited by 0x001A4 on Wed Jul 16, 2008 5:01 pm; edited 1 time in total |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Wed Jul 16, 2008 4:02 pm Post subject: |
|
|
Maybe fdisk -l |
|
Back to top |
|
|
0x001A4 Apprentice
Joined: 08 Jan 2006 Posts: 263 Location: Mississauga, Ontario
|
Posted: Wed Jul 16, 2008 4:21 pm Post subject: |
|
|
That is where I'm getting the information I'm talking about, but it doesn't provide the number of bytes per partition. |
|
Back to top |
|
|
cyrillic Watchman
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Wed Jul 16, 2008 4:54 pm Post subject: Re: fdisk - blocks to bytes |
|
|
0x001A4 wrote: | What I have figured is if I divide the number of blocks by 1024, and then divide the result by 1024 again, I get a number that looks right. |
fdisk displays 1024 byte blocks, so your calculation is correct. |
|
Back to top |
|
|
0x001A4 Apprentice
Joined: 08 Jan 2006 Posts: 263 Location: Mississauga, Ontario
|
Posted: Wed Jul 16, 2008 5:01 pm Post subject: |
|
|
Awesome. Thanks! |
|
Back to top |
|
|
|