size from df -kh vs size from fdisk -l

jackson byers byersjab at gmail.com
Tue Apr 21 17:08:40 UTC 2009


n Tue, Apr 21, 2009 at 8:37 AM, jackson byers <byersjab at gmail.com> wrote:
> # fdisk -l
>
> Disk /dev/sda: 36.7 GB, 36703934464 bytes
> 255 heads, 63 sectors/track, 4462 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1   *           1        2676    21494938+  83  Linux
> /dev/sda2            2677        3163     3911827+  82  Linux swap /
Solaris
> /dev/sda3            3164        4462    10434217+  83  Linux
>
> sda1 size  ~ 21.5 G
>
> but using df:
> # df -kh
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/sdb6             7.7G  5.6G  1.8G  77% /
> tmpfs                1014M     0 1014M   0% /dev/shm
> /dev/sda1             190M  5.6M  175M   4% /mnt/sda1
>
> sda1 size = 190M

Andrew Parker wrote:

>>df comes from the file system rather than the partition.  is it
>>possible that the sda1 partition was resized but not reformatted?

>>if you can stand to lose the data, can you reformat the file system?
>>do you then get the expected size?

my problem is I dont know  what happened,  it occurred during a botched
attempt at using the f10liveinstall cd to install (but backed out)
It wasnt my intention to do anything to sda1 ( my target for install was
sdb6)
but somehow it clobbered sda1 contents,
as seen by df, size 190M only 0.19G

I dont know what that liveinstall attempt actually did
but the _size_ as seen by fdisk is original size~21G
so this tells me there was no resizing of the partition
but df says size greatly reduced to 190M=0.19G

I am now leery of doing anything until i understand what fdisk, df tell me
I suppose my only choice now is to go ahead and reformat

Jeff Voskamp wrote

>Or just try "resize2fs /dev/sda1" to resize the filesystem to the size of
the underlying >partition.
>Jeff
I will check out info or man page on resize2fs, thanks

Stephen Berg wrote

>Aren't the "Blocks" listed from fdisk 512 and not 1024?  Your numbers
>would agree quite nicely if so.

>  Stephen Berg

I dont think that is correct.
I dont know exact def of blocks
but cyls*8225280bytes ~ 21G

this also checks well on my sdb6
where i am now booted up in my fc5copy
/dev/sdb6      1302        2321     8193118+  83  Linux
(2321-1302)*8225280= 8381560320 bytes

Any other explanations as to how
size reported by fdisk not same as  size from df?

Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090421/ba2b8efd/attachment-0001.htm>


More information about the fedora-list mailing list