- What is the difference between /dev/sda and /dev/hda? [duplicate]
- 1 Answer 1
- Linked
- Related
- Hot Network Questions
- What is /dev/sda in Linux?
- What is Linux?
- Files in Linux
- What is /dev in Linux?
- What is /dev/hda in Linux?
- What is /dev/sda in Linux?
- SDA file structure
- Watch our Explanation
- Share this:
- Like this:
- Related
- Published by Sayan De
- 12 thoughts on “ What is /dev/sda in Linux? ”
- Leave a Reply Cancel reply
- please visit www.tec4tric.com
- Recent Posts
What is the difference between /dev/sda and /dev/hda? [duplicate]
Sometimes internal harddrives are available as /dev/sda (with subsequent media located in /dev/sdb etc), and other times available as /dev/hda . What is the difference between the two? Does it vary between Linux distributions, or is it based on the computer hardware, or perhaps the harddrive type?
@psusi By «sometimes» I mean reading guides online that indicate /dev/hda should be used in a command; didn’t realize the article was that old (and despite that difference, still accurate)
1 Answer 1
Device files defined based on the controllers they are using.
- For IDE controllers device file name is — hda, hdb, hdc..
- For SCSI and SATA controllers device file name is — sda, sdb, sdc..
Actually, I’m in an Ubuntu 14.10 laptop right now, and my internal 2.5″ IDE drive is showing up as /dev/sda . I can also attest to a desktop machine running the current Debian version using a 3.5″ IDE-connected drive is showing up as sda as well.
I found that it was changed in drivers, so devices now are shown as /dev/sda. If you use old drivers, the names will be the same as I described link
Linked
Related
Hot Network Questions
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533
Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
What is /dev/sda in Linux?
Understanding the concept of /dev/sda in Linux is very important. Over the 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 avialable 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.
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..
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.
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
Watch our Explanation
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/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.
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.
Share this:
Like this:
Related
Published by Sayan De
Deep Learner, persuing M.Tech in CSE from MAKAUT, WB. View all posts by Sayan De
12 thoughts on “ What is /dev/sda in Linux? ”
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 Like Like
They are basically your hard disk partitions, if you want to create any directory you’ll need root access. Like Like
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 Like Like
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! Like Like
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.