What is /dev/sda in Linux?

Understanding the concept of /dev/sda in Linux is very important. Over time students have asked me, “What is /dev/sda in Linux”, here is the answer, let’s dig into it.

What is Linux?

Linux is a collection of open-source Unix-type Operating systems which is based on Linux Kernel. It was first introduced by Linus Torvalds in 1991. Popular Linux distributions are – Ubuntu, Linux Mint, Fedora, Arch Linux, Kubuntu, and many more.

Files in Linux

In Linux operating systems each and everything is a file. However, there are many types of files available in Linux.

For example, Ordinary Files, Directory Files, and Device Files are file types in Linux.

  • Ordinary / General Files contains only data, in other words, it contains all the documents.
  • Directory Files contain Ordinary files as well as Directory Files.
  • Device Files contain all the device files, that is to say, it represents all the hardware devices.

What is /dev in Linux?

Before understanding the /dev/sda in Linux, you must have some knowledge about /dev.

The front slash ‘/’ is the root in Linux and, dev is a directory file containing device files under root. The root file systems have to be present in every Linux operating system. The root file system contains all the tools to keep the system on. After the system boots up in single-user mode, this is the only file system that is available to the system administrator.

dev-root

What is /dev/hda in Linux?

/dev/hda is the master IDE(Integrated Drive Electronics) drive on the primary IDE controller. Linux takes the first hard disk as a whole hard disk and it represents it by /dev/hda. The individual partitions in the disk take on names like hda1, hda2, and so forth. So, hdb is the second IDE hard disk.

What is /dev/sda in Linux?

The term sd stands for SCSI disk, that is to say, it means Small Computer System Interface disk. So, sda means the first SCSI hard disk. Likewise,/hda, the individual partition in the disk takes names as sda1, sda2, etc..

dev-sda-linux

The active partition is indicated by an * in the middle column. The middle column refers to the “Status” of that particular partition. Status has two-state, Inactive, and Active.

fdisk

The second hard disk will have the name /dev/sdb with the same numeric expressions.

SDA file structure

The lsblk command lists all the information about the specified block devices. The sda tree structures look like this

lsblk

Watch our Explanation

To learn more about Linux simply click here.

What is /dev in Linux?

The front slash ‘/’ is the root in Linux and, dev is a directory file containing device files under root. The root file systems have to be present in every Linux operating system. The root file system contains all the tools to keep the system on. After the system boots up in single-user mode, this is the only file system that is available to the system administrator.

What is /dev/hda in Linux?

/dev/hda is the master IDE(Integrated Drive Electronics) drive on the primary IDE controller. Linux takes the first hard disk as a whole hard disk and it represents it by /dev/hda. The individual partitions in the disk take on names like hda1, hda2, and so forth. So, hdb is the second IDE hard disk.

What are Kernel and Shell in Linux?

The Kernel is a collection of programs mostly written in C that directly communicate with the hardware. The Shell is actually the interface between the user and the kernel that effectively insulates the user from the knowledge of kernel functions. Read this to learn more.

In case you still have questions, contact experts from Essay Mill.

12 thoughts on “What is /dev/sda in Linux?

  • November 7, 2019 at 10:01 pm
    Permalink

    Thanks for the insight. Helpful and quality content. Cheers!

  • May 29, 2020 at 2:08 am
    Permalink

    Thank you for the information. Short and enlighten.

    • May 29, 2020 at 6:54 am
      Permalink

      You are welcome… Please Subscribe to get more updates.

  • July 5, 2020 at 1:10 pm
    Permalink

    so question is how we can use /dev/sda2 or /dev/sda3 etc we can do cd to that partition and so as we cant create any dir and files in it

    • July 5, 2020 at 3:10 pm
      Permalink

      They are basically your hard disk partitions, if you want to create any directory you’ll need root access.

      • July 5, 2020 at 3:22 pm
        Permalink

        ya i have root access i want to create directory in them sda3 so that i can add as storage to virtualizor. so can u tell me how to do it , because i tried to do /dev/sda3 i was not able to change directory to that partitions

        • July 5, 2020 at 3:24 pm
          Permalink

          Do you have a dual boot computer? want to mount the Windows partitions?

          • July 5, 2020 at 3:48 pm
            Permalink

            no i do not have dual boot computer

          • July 5, 2020 at 3:59 pm
            Permalink

            Sorry, can’t help with the virtualizer.
            You may run nautilus from the terminal.

  • August 27, 2020 at 1:22 pm
    Permalink

    There is certainly a lot to know about this topic. I love all of the points you made.

  • January 16, 2021 at 7:23 pm
    Permalink

    your article states an inaccuracy: «Linux takes the first hard disk as a whole hard disk and it represents it by /dev/hda. The individual partitions in the disk take on names like hda1, hda2, and so forth. hd2 is the second IDE hard disk.»
    But «hd2» is not the 2nd hard disk. The second hard disk is «hdb» not «hd2».
    I have 2 hard disks on my linux laptop. they are named ‘sda’ and ‘sdb’. (FYI: one is a SATA drive and the other is an M.2 drive. If this were my article, i’d make a note to the audience that both SATA and M.2 fall under your ‘IDE’ category.
    Writing that ‘hd2’ is the 2nd drive leads to a naming clash too:
    If ‘hd2’ is the 2nd IDE hard disk, then is ‘hd211’ the 11th partition of the 2nd hard drive or is it the 1st partition of the 21st hard drive? do you see the problem with this naming scheme? this is what experienced developers learn to catch (hopefully) sooner than later before real problems & bugs develop due to poorly chosen naming schemes like ‘hd2’ for the 2nd hard drive when partition numbers are just concatenated without any separator symbol. if it were me, i think i might have named both with numbers, but used a hyphen between them: hd1-2 for the 2nd partition for the 1st hard drive. but letters for each drive might be a better naming scheme. cheers!

    • January 18, 2021 at 1:05 pm
      Permalink

      Thanks for updating.

Comments are closed.