What's the difference between fdisk -l and df -h?

5,140

It says it right there:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT.

Your /dev/sda is using a GUID Partition Table. Your version of fdisk doesn't support GPT, so all it can see is the fake MBR partition that takes up your entire disk. Try using gdisk or another program that supports GPT.

Share:
5,140

Related videos on Youtube

wuchang
Author by

wuchang

Always concentrate!

Updated on September 18, 2022

Comments

  • wuchang
    wuchang over 1 year

    In my ubuntu system, I want to have a look about my system disk info. When I use fdisk -l without sudo, I get nothing. But with sudo fdisk -l, I only get a device /dev/sda1, but when I use df -h, I get so many devices, like /dev/sda2, /dev/sda4 and so on. What is the difference between such disk operations?

    # fdisk -l
    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use
    
    Disk /dev/sda: 6000.1 GB, 60000069312512 bytes
    255 heads, 63 sectors/track, 729466 cylinders, tatal 11718885376 sectars
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
       Device Boot     Start          End      Blocks   Id  System
    /dev/sda1              1   4294967295  2147483647+  ee  GPT
    
    # df -h
    Filesystem     Size  Used Avail Use% Mounted on
    /dev/sda2      457G  2.0G  432G   1% /
    udev            16G  4.0K   16G   1% /dev
    tmpfs          6.3G  236K  6.3G   1% /run
    none           5.0M     0  5.0M   0% /run/lock
    none            16G     0   16G   0% /run/shm
    /dev/sda4      5.0T  604G  4.2T  13% /var
    
    • cjm
      cjm over 10 years
      Please learn how to copy & paste text instead of an image. Images make it much harder for people searching for answers to find related questions.
  • cjm
    cjm over 10 years
    I think he's asking why fdisk shows only 1 partition, but df shows the disk has several partitions.
  • jirib
    jirib over 10 years
    Who knows. As he missed the line with WARNING and he is also does not get why fdisk without sudo shows nothing. He could do little homework...
  • Michael Mrozek
    Michael Mrozek over 10 years
    @JiriXichtkniha It's a Q&A site; if you're going to get upset when people ask about something they don't understand, you're going to be upset a lot