Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When you do a df -h you can see:

Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7 . 9G 1.7G 6.2G 22% /

But, when you do fdisk -l you see:

Disk /dev/xvda1: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Can someone help?

share|improve this question
welcome to Stack Exchange! I've flagged your question as "unclear what you're asking" because, well, it's unclear. please edit your question using the edit link (right below the tags) and clarify what you want us to help with. thanks! –  strugee Oct 23 '13 at 16:32
@strugee you can embed the edit link in a comment by writing [edit] (without the inverted commas), it looks like this: edit. –  terdon Oct 23 '13 at 16:35
add comment

closed as unclear what you're asking by Renan, Anthon, slm, Joseph R., jasonwryan Oct 23 '13 at 17:58

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

The two programs give different information (try man fdisk and man df). fdisk will show you the available partitions of the disk (those are the lines that come after the output you have posted) and df will show the usage of mounted partitions.

If that is the entirety of the df -h output, it looks like you only have one partition mounted, /dev/xvda1 which is 7.9G. Based on the output you posted, you probably ran fdisk -l /dev/xvda1 not fdisk -l. This should also have returned an error:

Disk /dev/xvda1 doesn't contain a valid partition table

That's because fdisk should be run on disks, not partitions. Try fdisk -l /dev/xvda (without the partition number) or simply fdisk -l. That should show you the full partition table of all your disks. One of these partitions will be xvda1 and will be 7.9G in size. When you run fdsik on a partition, it reports the size of the entire disk (26.8 GB in your case), not the size of the partition you gave it as input.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.