Linux block devices namingLinux kernel block device names (libATA)Linux Mint: drives' map changing at reboot brings fstab errorWhat driver is behind a certain device file?Why are there so many virtual terminal devices?How do i block USB devices based on device class in LinuxDebian - cannot find cdromDifference between sd0/sda, hd0/hdaWhy is the block size of a partition smaller than that of the underlying disk?Everything is file or process - LinuxUse /dev/ramX as their corresponding special devices?Safely remove USB device (of any type, not only block devices/mass storage)?
Where else does the Shulchan Aruch quote an authority by name?
What are the advantages and disadvantages of running one shots compared to campaigns?
What to wear for invited talk in Canada
COUNT(*) or MAX(id) - which is faster?
Crop image to path created in TikZ?
Is there a name of the flying bionic bird?
Email Account under attack (really) - anything I can do?
What do the Banks children have against barley water?
What does it exactly mean if a random variable follows a distribution
Why do UK politicians seemingly ignore opinion polls on Brexit?
How would photo IDs work for shapeshifters?
Is every set a filtered colimit of finite sets?
Is this food a bread or a loaf?
Was there ever an axiom rendered a theorem?
Should the British be getting ready for a no-deal Brexit?
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
Extreme, but not acceptable situation and I can't start the work tomorrow morning
How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)
Is Social Media Science Fiction?
Is Fable (1996) connected in any way to the Fable franchise from Lionhead Studios?
Calculate Levenshtein distance between two strings in Python
Does it makes sense to buy a new cycle to learn riding?
How to make particles emit from certain parts of a 3D object?
How could a lack of term limits lead to a "dictatorship?"
Linux block devices naming
Linux kernel block device names (libATA)Linux Mint: drives' map changing at reboot brings fstab errorWhat driver is behind a certain device file?Why are there so many virtual terminal devices?How do i block USB devices based on device class in LinuxDebian - cannot find cdromDifference between sd0/sda, hd0/hdaWhy is the block size of a partition smaller than that of the underlying disk?Everything is file or process - LinuxUse /dev/ramX as their corresponding special devices?Safely remove USB device (of any type, not only block devices/mass storage)?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am a bit confused with how linux hard drive/ storage device, block files are named.
My questions are:
How are IDE devices and partitions named?
How are EIDE devices and partitions named?
How are PATA devices and partitions named?
How are SATA devices and partitions named?
How are SCSI devices and partitions named?
Lastly, I have been reading articles on this subject, and I have seen mentions of 'master drives' and 'slave drives'. What are these, what are they used for, and how are they named?
linux devices disk
add a comment |
I am a bit confused with how linux hard drive/ storage device, block files are named.
My questions are:
How are IDE devices and partitions named?
How are EIDE devices and partitions named?
How are PATA devices and partitions named?
How are SATA devices and partitions named?
How are SCSI devices and partitions named?
Lastly, I have been reading articles on this subject, and I have seen mentions of 'master drives' and 'slave drives'. What are these, what are they used for, and how are they named?
linux devices disk
2
Note that (E-)IDE and "PATA" are just different names for exactly the same thing. In fact, there's nothing that would be officially called "PATA", that's just an alias for IDE that people started using because it nicely mirrors "SATA".
– TooTea
2 days ago
add a comment |
I am a bit confused with how linux hard drive/ storage device, block files are named.
My questions are:
How are IDE devices and partitions named?
How are EIDE devices and partitions named?
How are PATA devices and partitions named?
How are SATA devices and partitions named?
How are SCSI devices and partitions named?
Lastly, I have been reading articles on this subject, and I have seen mentions of 'master drives' and 'slave drives'. What are these, what are they used for, and how are they named?
linux devices disk
I am a bit confused with how linux hard drive/ storage device, block files are named.
My questions are:
How are IDE devices and partitions named?
How are EIDE devices and partitions named?
How are PATA devices and partitions named?
How are SATA devices and partitions named?
How are SCSI devices and partitions named?
Lastly, I have been reading articles on this subject, and I have seen mentions of 'master drives' and 'slave drives'. What are these, what are they used for, and how are they named?
linux devices disk
linux devices disk
edited 2 days ago
Paradox
478317
478317
asked Apr 5 at 18:27
QasimQasim
2112
2112
2
Note that (E-)IDE and "PATA" are just different names for exactly the same thing. In fact, there's nothing that would be officially called "PATA", that's just an alias for IDE that people started using because it nicely mirrors "SATA".
– TooTea
2 days ago
add a comment |
2
Note that (E-)IDE and "PATA" are just different names for exactly the same thing. In fact, there's nothing that would be officially called "PATA", that's just an alias for IDE that people started using because it nicely mirrors "SATA".
– TooTea
2 days ago
2
2
Note that (E-)IDE and "PATA" are just different names for exactly the same thing. In fact, there's nothing that would be officially called "PATA", that's just an alias for IDE that people started using because it nicely mirrors "SATA".
– TooTea
2 days ago
Note that (E-)IDE and "PATA" are just different names for exactly the same thing. In fact, there's nothing that would be officially called "PATA", that's just an alias for IDE that people started using because it nicely mirrors "SATA".
– TooTea
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
Introduction
First of all, all the devices populate the /dev
folder.
Also, it is important to note that (E)IDE and PATA terms usually refer to the same thing, which is the interface standard PATA. IDE and PATA are interchangable terms in this context.
There was a major change in naming conventions for block devices in Linux, around the release of Linux kernel version 2.6. The kernel supports all ATA devices through libATA, which started with SCSI devices support in 2003 and was extended to current SATA support.
Therefore, be aware that, depending on your distribution and kernel version, the drives naming convention can differ.
Since a while, PATA devices on "modern" distributions are named the ways SATA drives are, since both are now using libATA.
For your distribution, you can find this in /lib/udev/rules.d/60-persistent-storage.rules
.
On my system using Debian 9, it is also the case. For example:
$ cat /lib/udev/rules.d/60-persistent-storage.rules | grep "ATA"
# ATA
KERNEL=="sd*[!0-9]|sr*", ENVID_SERIAL!="?*", SUBSYSTEMS=="scsi",
ATTRSvendor=="ATA", IMPORTprogram="ata_id --export $devnode"
By browsing this file, you will know how your distribution will name every block device you could connect to your machine.
Block devices naming conventions
IDE drives
- IDE drives (using the old PATA driver) are prefixed with "hd"
- the first device on the IDE controller (master) is
hda
- the second device (slave) is
hdb
- the first device on the IDE controller (master) is
Since there can only be two drives on one IDE controller/cable, the master is the first one and the slave is the second one. Since most motherboard are fitted with two IDE controllers, it goes on the same way with the second controller:hdc
being the master drive on the second controller and hdb
the slave drive.
Be aware that, since Linux kernel 2.6.19, the supports of IDE drives has been merged with SATA/SCSI drives and, therefore, will be named like them.
SATA and SCSI drives
This naming convention started with SCSI drives, with libATA. As said previously it provides support for SCSI, SATA, as well as others drives, out of the scope of OP question (USB mass storage, FireWire, etc.). Anyway, usually, all the devices using a serial bus use the same denomination nowadays (except for NVMe drive, but this would a story for PCI devices).
- SATA/SCSI drives start with "sd"
- the first one is
sda
- the second one is
sdb
- etc.
- the first one is
Partitions naming conventions
Regarding partitions, each of them is denoted by a number at the end of each disk, named as described previously, starting from 1. Except for some other devices not mentioned in OP, it is always the case.
By instance, for the partitions on a SATA drive, they would be listed as sda1
, sda2
, and so on, for primary partitions. Logical partitions start at the index "5", while the extended partition takes the index "4". Note that this is obviously only true for drives making use of MBR and not GPT.
Below, this is the output of lsblk
giving an example for disk called sdd
, with 3 primary partitions (sdd1
,sdd2
,sdd3
), 1 extended partition (sdd4
) and 2 logical partitions (sdd5
,sdd6
).
$ lsblk
sdd 8:48 1 1.9G 0 disk
├─sdd1 8:49 1 153M 0 part
├─sdd2 8:50 1 229M 0 part
├─sdd3 8:51 1 138M 0 part
├─sdd4 8:52 1 1K 0 part
├─sdd5 8:53 1 289M 0 part
└─sdd6 8:54 1 1.1G 0 part
Master and slaves devices
A single IDE interface can support two devices. Usually, motherboards come with dual IDE interfaces (primary and secondary) for up to four IDE devices on a system.
To allow two drives to operate on the same parallel cable, IDE uses a special configuration called master and slave. This configuration allows one drive's controller to tell the other drive when it can transfer data to or from the computer. The name comes from the fact that the slave drive ask the master if it is communicating with the motherboard ; if the master is, it will tell the slave to wait until the operation is finished but if not, it will tell the slave to go ahead.
The master/slave role could be chosen thanks to the "Cable Select" feature: you could use a jumper on each drive supporting this feature to select either "Master", "Slave" or "Auto" (this last option meaning that the master is at the end of the IDE cable and the slave is the other).
2
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
1
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
1
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
|
show 8 more comments
Found an old reference which refers to everything but SATA.
SATA & SCSI drives are /dev/sdX where starts with a to refer to the physical drive.
Partitions are /dev/sdXY where Y represents the partition number (beginning with 1) within that device.
EIDE device naming was the same as IDE is the same as PATA, before Linux kernel 2.6.19 (Thank you, Paradox, for noting the change!)
/dev/hda was the 'master' drive on the 'primary' controller.
/dev/hdb was the 'slave' drive on the 'primary' controller.
/dev/hdc was the 'master' drive on the 'secondary' controller.
/dev/hdd was the 'slave' drive on the 'secondary' controller.
A number follows each drive device to denote the partition(s), beginning with 1.
Since Linux kernel 2.6.19, the same naming convention as SCSI & SATA is used for EIDE, IDE, and PATA.
1
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disksda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).
– Hermann
Apr 5 at 19:02
1
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510778%2flinux-block-devices-naming%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Introduction
First of all, all the devices populate the /dev
folder.
Also, it is important to note that (E)IDE and PATA terms usually refer to the same thing, which is the interface standard PATA. IDE and PATA are interchangable terms in this context.
There was a major change in naming conventions for block devices in Linux, around the release of Linux kernel version 2.6. The kernel supports all ATA devices through libATA, which started with SCSI devices support in 2003 and was extended to current SATA support.
Therefore, be aware that, depending on your distribution and kernel version, the drives naming convention can differ.
Since a while, PATA devices on "modern" distributions are named the ways SATA drives are, since both are now using libATA.
For your distribution, you can find this in /lib/udev/rules.d/60-persistent-storage.rules
.
On my system using Debian 9, it is also the case. For example:
$ cat /lib/udev/rules.d/60-persistent-storage.rules | grep "ATA"
# ATA
KERNEL=="sd*[!0-9]|sr*", ENVID_SERIAL!="?*", SUBSYSTEMS=="scsi",
ATTRSvendor=="ATA", IMPORTprogram="ata_id --export $devnode"
By browsing this file, you will know how your distribution will name every block device you could connect to your machine.
Block devices naming conventions
IDE drives
- IDE drives (using the old PATA driver) are prefixed with "hd"
- the first device on the IDE controller (master) is
hda
- the second device (slave) is
hdb
- the first device on the IDE controller (master) is
Since there can only be two drives on one IDE controller/cable, the master is the first one and the slave is the second one. Since most motherboard are fitted with two IDE controllers, it goes on the same way with the second controller:hdc
being the master drive on the second controller and hdb
the slave drive.
Be aware that, since Linux kernel 2.6.19, the supports of IDE drives has been merged with SATA/SCSI drives and, therefore, will be named like them.
SATA and SCSI drives
This naming convention started with SCSI drives, with libATA. As said previously it provides support for SCSI, SATA, as well as others drives, out of the scope of OP question (USB mass storage, FireWire, etc.). Anyway, usually, all the devices using a serial bus use the same denomination nowadays (except for NVMe drive, but this would a story for PCI devices).
- SATA/SCSI drives start with "sd"
- the first one is
sda
- the second one is
sdb
- etc.
- the first one is
Partitions naming conventions
Regarding partitions, each of them is denoted by a number at the end of each disk, named as described previously, starting from 1. Except for some other devices not mentioned in OP, it is always the case.
By instance, for the partitions on a SATA drive, they would be listed as sda1
, sda2
, and so on, for primary partitions. Logical partitions start at the index "5", while the extended partition takes the index "4". Note that this is obviously only true for drives making use of MBR and not GPT.
Below, this is the output of lsblk
giving an example for disk called sdd
, with 3 primary partitions (sdd1
,sdd2
,sdd3
), 1 extended partition (sdd4
) and 2 logical partitions (sdd5
,sdd6
).
$ lsblk
sdd 8:48 1 1.9G 0 disk
├─sdd1 8:49 1 153M 0 part
├─sdd2 8:50 1 229M 0 part
├─sdd3 8:51 1 138M 0 part
├─sdd4 8:52 1 1K 0 part
├─sdd5 8:53 1 289M 0 part
└─sdd6 8:54 1 1.1G 0 part
Master and slaves devices
A single IDE interface can support two devices. Usually, motherboards come with dual IDE interfaces (primary and secondary) for up to four IDE devices on a system.
To allow two drives to operate on the same parallel cable, IDE uses a special configuration called master and slave. This configuration allows one drive's controller to tell the other drive when it can transfer data to or from the computer. The name comes from the fact that the slave drive ask the master if it is communicating with the motherboard ; if the master is, it will tell the slave to wait until the operation is finished but if not, it will tell the slave to go ahead.
The master/slave role could be chosen thanks to the "Cable Select" feature: you could use a jumper on each drive supporting this feature to select either "Master", "Slave" or "Auto" (this last option meaning that the master is at the end of the IDE cable and the slave is the other).
2
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
1
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
1
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
|
show 8 more comments
Introduction
First of all, all the devices populate the /dev
folder.
Also, it is important to note that (E)IDE and PATA terms usually refer to the same thing, which is the interface standard PATA. IDE and PATA are interchangable terms in this context.
There was a major change in naming conventions for block devices in Linux, around the release of Linux kernel version 2.6. The kernel supports all ATA devices through libATA, which started with SCSI devices support in 2003 and was extended to current SATA support.
Therefore, be aware that, depending on your distribution and kernel version, the drives naming convention can differ.
Since a while, PATA devices on "modern" distributions are named the ways SATA drives are, since both are now using libATA.
For your distribution, you can find this in /lib/udev/rules.d/60-persistent-storage.rules
.
On my system using Debian 9, it is also the case. For example:
$ cat /lib/udev/rules.d/60-persistent-storage.rules | grep "ATA"
# ATA
KERNEL=="sd*[!0-9]|sr*", ENVID_SERIAL!="?*", SUBSYSTEMS=="scsi",
ATTRSvendor=="ATA", IMPORTprogram="ata_id --export $devnode"
By browsing this file, you will know how your distribution will name every block device you could connect to your machine.
Block devices naming conventions
IDE drives
- IDE drives (using the old PATA driver) are prefixed with "hd"
- the first device on the IDE controller (master) is
hda
- the second device (slave) is
hdb
- the first device on the IDE controller (master) is
Since there can only be two drives on one IDE controller/cable, the master is the first one and the slave is the second one. Since most motherboard are fitted with two IDE controllers, it goes on the same way with the second controller:hdc
being the master drive on the second controller and hdb
the slave drive.
Be aware that, since Linux kernel 2.6.19, the supports of IDE drives has been merged with SATA/SCSI drives and, therefore, will be named like them.
SATA and SCSI drives
This naming convention started with SCSI drives, with libATA. As said previously it provides support for SCSI, SATA, as well as others drives, out of the scope of OP question (USB mass storage, FireWire, etc.). Anyway, usually, all the devices using a serial bus use the same denomination nowadays (except for NVMe drive, but this would a story for PCI devices).
- SATA/SCSI drives start with "sd"
- the first one is
sda
- the second one is
sdb
- etc.
- the first one is
Partitions naming conventions
Regarding partitions, each of them is denoted by a number at the end of each disk, named as described previously, starting from 1. Except for some other devices not mentioned in OP, it is always the case.
By instance, for the partitions on a SATA drive, they would be listed as sda1
, sda2
, and so on, for primary partitions. Logical partitions start at the index "5", while the extended partition takes the index "4". Note that this is obviously only true for drives making use of MBR and not GPT.
Below, this is the output of lsblk
giving an example for disk called sdd
, with 3 primary partitions (sdd1
,sdd2
,sdd3
), 1 extended partition (sdd4
) and 2 logical partitions (sdd5
,sdd6
).
$ lsblk
sdd 8:48 1 1.9G 0 disk
├─sdd1 8:49 1 153M 0 part
├─sdd2 8:50 1 229M 0 part
├─sdd3 8:51 1 138M 0 part
├─sdd4 8:52 1 1K 0 part
├─sdd5 8:53 1 289M 0 part
└─sdd6 8:54 1 1.1G 0 part
Master and slaves devices
A single IDE interface can support two devices. Usually, motherboards come with dual IDE interfaces (primary and secondary) for up to four IDE devices on a system.
To allow two drives to operate on the same parallel cable, IDE uses a special configuration called master and slave. This configuration allows one drive's controller to tell the other drive when it can transfer data to or from the computer. The name comes from the fact that the slave drive ask the master if it is communicating with the motherboard ; if the master is, it will tell the slave to wait until the operation is finished but if not, it will tell the slave to go ahead.
The master/slave role could be chosen thanks to the "Cable Select" feature: you could use a jumper on each drive supporting this feature to select either "Master", "Slave" or "Auto" (this last option meaning that the master is at the end of the IDE cable and the slave is the other).
2
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
1
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
1
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
|
show 8 more comments
Introduction
First of all, all the devices populate the /dev
folder.
Also, it is important to note that (E)IDE and PATA terms usually refer to the same thing, which is the interface standard PATA. IDE and PATA are interchangable terms in this context.
There was a major change in naming conventions for block devices in Linux, around the release of Linux kernel version 2.6. The kernel supports all ATA devices through libATA, which started with SCSI devices support in 2003 and was extended to current SATA support.
Therefore, be aware that, depending on your distribution and kernel version, the drives naming convention can differ.
Since a while, PATA devices on "modern" distributions are named the ways SATA drives are, since both are now using libATA.
For your distribution, you can find this in /lib/udev/rules.d/60-persistent-storage.rules
.
On my system using Debian 9, it is also the case. For example:
$ cat /lib/udev/rules.d/60-persistent-storage.rules | grep "ATA"
# ATA
KERNEL=="sd*[!0-9]|sr*", ENVID_SERIAL!="?*", SUBSYSTEMS=="scsi",
ATTRSvendor=="ATA", IMPORTprogram="ata_id --export $devnode"
By browsing this file, you will know how your distribution will name every block device you could connect to your machine.
Block devices naming conventions
IDE drives
- IDE drives (using the old PATA driver) are prefixed with "hd"
- the first device on the IDE controller (master) is
hda
- the second device (slave) is
hdb
- the first device on the IDE controller (master) is
Since there can only be two drives on one IDE controller/cable, the master is the first one and the slave is the second one. Since most motherboard are fitted with two IDE controllers, it goes on the same way with the second controller:hdc
being the master drive on the second controller and hdb
the slave drive.
Be aware that, since Linux kernel 2.6.19, the supports of IDE drives has been merged with SATA/SCSI drives and, therefore, will be named like them.
SATA and SCSI drives
This naming convention started with SCSI drives, with libATA. As said previously it provides support for SCSI, SATA, as well as others drives, out of the scope of OP question (USB mass storage, FireWire, etc.). Anyway, usually, all the devices using a serial bus use the same denomination nowadays (except for NVMe drive, but this would a story for PCI devices).
- SATA/SCSI drives start with "sd"
- the first one is
sda
- the second one is
sdb
- etc.
- the first one is
Partitions naming conventions
Regarding partitions, each of them is denoted by a number at the end of each disk, named as described previously, starting from 1. Except for some other devices not mentioned in OP, it is always the case.
By instance, for the partitions on a SATA drive, they would be listed as sda1
, sda2
, and so on, for primary partitions. Logical partitions start at the index "5", while the extended partition takes the index "4". Note that this is obviously only true for drives making use of MBR and not GPT.
Below, this is the output of lsblk
giving an example for disk called sdd
, with 3 primary partitions (sdd1
,sdd2
,sdd3
), 1 extended partition (sdd4
) and 2 logical partitions (sdd5
,sdd6
).
$ lsblk
sdd 8:48 1 1.9G 0 disk
├─sdd1 8:49 1 153M 0 part
├─sdd2 8:50 1 229M 0 part
├─sdd3 8:51 1 138M 0 part
├─sdd4 8:52 1 1K 0 part
├─sdd5 8:53 1 289M 0 part
└─sdd6 8:54 1 1.1G 0 part
Master and slaves devices
A single IDE interface can support two devices. Usually, motherboards come with dual IDE interfaces (primary and secondary) for up to four IDE devices on a system.
To allow two drives to operate on the same parallel cable, IDE uses a special configuration called master and slave. This configuration allows one drive's controller to tell the other drive when it can transfer data to or from the computer. The name comes from the fact that the slave drive ask the master if it is communicating with the motherboard ; if the master is, it will tell the slave to wait until the operation is finished but if not, it will tell the slave to go ahead.
The master/slave role could be chosen thanks to the "Cable Select" feature: you could use a jumper on each drive supporting this feature to select either "Master", "Slave" or "Auto" (this last option meaning that the master is at the end of the IDE cable and the slave is the other).
Introduction
First of all, all the devices populate the /dev
folder.
Also, it is important to note that (E)IDE and PATA terms usually refer to the same thing, which is the interface standard PATA. IDE and PATA are interchangable terms in this context.
There was a major change in naming conventions for block devices in Linux, around the release of Linux kernel version 2.6. The kernel supports all ATA devices through libATA, which started with SCSI devices support in 2003 and was extended to current SATA support.
Therefore, be aware that, depending on your distribution and kernel version, the drives naming convention can differ.
Since a while, PATA devices on "modern" distributions are named the ways SATA drives are, since both are now using libATA.
For your distribution, you can find this in /lib/udev/rules.d/60-persistent-storage.rules
.
On my system using Debian 9, it is also the case. For example:
$ cat /lib/udev/rules.d/60-persistent-storage.rules | grep "ATA"
# ATA
KERNEL=="sd*[!0-9]|sr*", ENVID_SERIAL!="?*", SUBSYSTEMS=="scsi",
ATTRSvendor=="ATA", IMPORTprogram="ata_id --export $devnode"
By browsing this file, you will know how your distribution will name every block device you could connect to your machine.
Block devices naming conventions
IDE drives
- IDE drives (using the old PATA driver) are prefixed with "hd"
- the first device on the IDE controller (master) is
hda
- the second device (slave) is
hdb
- the first device on the IDE controller (master) is
Since there can only be two drives on one IDE controller/cable, the master is the first one and the slave is the second one. Since most motherboard are fitted with two IDE controllers, it goes on the same way with the second controller:hdc
being the master drive on the second controller and hdb
the slave drive.
Be aware that, since Linux kernel 2.6.19, the supports of IDE drives has been merged with SATA/SCSI drives and, therefore, will be named like them.
SATA and SCSI drives
This naming convention started with SCSI drives, with libATA. As said previously it provides support for SCSI, SATA, as well as others drives, out of the scope of OP question (USB mass storage, FireWire, etc.). Anyway, usually, all the devices using a serial bus use the same denomination nowadays (except for NVMe drive, but this would a story for PCI devices).
- SATA/SCSI drives start with "sd"
- the first one is
sda
- the second one is
sdb
- etc.
- the first one is
Partitions naming conventions
Regarding partitions, each of them is denoted by a number at the end of each disk, named as described previously, starting from 1. Except for some other devices not mentioned in OP, it is always the case.
By instance, for the partitions on a SATA drive, they would be listed as sda1
, sda2
, and so on, for primary partitions. Logical partitions start at the index "5", while the extended partition takes the index "4". Note that this is obviously only true for drives making use of MBR and not GPT.
Below, this is the output of lsblk
giving an example for disk called sdd
, with 3 primary partitions (sdd1
,sdd2
,sdd3
), 1 extended partition (sdd4
) and 2 logical partitions (sdd5
,sdd6
).
$ lsblk
sdd 8:48 1 1.9G 0 disk
├─sdd1 8:49 1 153M 0 part
├─sdd2 8:50 1 229M 0 part
├─sdd3 8:51 1 138M 0 part
├─sdd4 8:52 1 1K 0 part
├─sdd5 8:53 1 289M 0 part
└─sdd6 8:54 1 1.1G 0 part
Master and slaves devices
A single IDE interface can support two devices. Usually, motherboards come with dual IDE interfaces (primary and secondary) for up to four IDE devices on a system.
To allow two drives to operate on the same parallel cable, IDE uses a special configuration called master and slave. This configuration allows one drive's controller to tell the other drive when it can transfer data to or from the computer. The name comes from the fact that the slave drive ask the master if it is communicating with the motherboard ; if the master is, it will tell the slave to wait until the operation is finished but if not, it will tell the slave to go ahead.
The master/slave role could be chosen thanks to the "Cable Select" feature: you could use a jumper on each drive supporting this feature to select either "Master", "Slave" or "Auto" (this last option meaning that the master is at the end of the IDE cable and the slave is the other).
edited yesterday
answered Apr 5 at 19:01
ParadoxParadox
478317
478317
2
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
1
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
1
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
|
show 8 more comments
2
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
1
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
1
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
2
2
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
Happy to help! Hope I was clear enough.
– Paradox
2 days ago
1
1
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
Yep its pretty clear but one thing i gotta ask, do partitions ALWAYS start with 1 or 0? Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
1
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
Always with 1 for drives. Only notable exceptions being floppy disks and CD/DVD devices where devices/partitions can be mixed up.
– Paradox
2 days ago
1
1
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
Also are master and slave devices only associated with IDE devices, or is there another interface such as PATA or SATA/SCSI which master and slave devices can exist on?
– Qasim
2 days ago
1
1
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
Master/slave pattern derives from the fact that it uses a parallel interface which ATA/ATAPI protcoles. Thereferore, it impacts all PATA connexions such as IDE, EIDE, Fast ATA, Fast IDE, Ultra ATA, etc. SATA making use of a single serial interface, there is no reason for this feature to exist for SATA.
– Paradox
2 days ago
|
show 8 more comments
Found an old reference which refers to everything but SATA.
SATA & SCSI drives are /dev/sdX where starts with a to refer to the physical drive.
Partitions are /dev/sdXY where Y represents the partition number (beginning with 1) within that device.
EIDE device naming was the same as IDE is the same as PATA, before Linux kernel 2.6.19 (Thank you, Paradox, for noting the change!)
/dev/hda was the 'master' drive on the 'primary' controller.
/dev/hdb was the 'slave' drive on the 'primary' controller.
/dev/hdc was the 'master' drive on the 'secondary' controller.
/dev/hdd was the 'slave' drive on the 'secondary' controller.
A number follows each drive device to denote the partition(s), beginning with 1.
Since Linux kernel 2.6.19, the same naming convention as SCSI & SATA is used for EIDE, IDE, and PATA.
1
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disksda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).
– Hermann
Apr 5 at 19:02
1
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
add a comment |
Found an old reference which refers to everything but SATA.
SATA & SCSI drives are /dev/sdX where starts with a to refer to the physical drive.
Partitions are /dev/sdXY where Y represents the partition number (beginning with 1) within that device.
EIDE device naming was the same as IDE is the same as PATA, before Linux kernel 2.6.19 (Thank you, Paradox, for noting the change!)
/dev/hda was the 'master' drive on the 'primary' controller.
/dev/hdb was the 'slave' drive on the 'primary' controller.
/dev/hdc was the 'master' drive on the 'secondary' controller.
/dev/hdd was the 'slave' drive on the 'secondary' controller.
A number follows each drive device to denote the partition(s), beginning with 1.
Since Linux kernel 2.6.19, the same naming convention as SCSI & SATA is used for EIDE, IDE, and PATA.
1
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disksda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).
– Hermann
Apr 5 at 19:02
1
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
add a comment |
Found an old reference which refers to everything but SATA.
SATA & SCSI drives are /dev/sdX where starts with a to refer to the physical drive.
Partitions are /dev/sdXY where Y represents the partition number (beginning with 1) within that device.
EIDE device naming was the same as IDE is the same as PATA, before Linux kernel 2.6.19 (Thank you, Paradox, for noting the change!)
/dev/hda was the 'master' drive on the 'primary' controller.
/dev/hdb was the 'slave' drive on the 'primary' controller.
/dev/hdc was the 'master' drive on the 'secondary' controller.
/dev/hdd was the 'slave' drive on the 'secondary' controller.
A number follows each drive device to denote the partition(s), beginning with 1.
Since Linux kernel 2.6.19, the same naming convention as SCSI & SATA is used for EIDE, IDE, and PATA.
Found an old reference which refers to everything but SATA.
SATA & SCSI drives are /dev/sdX where starts with a to refer to the physical drive.
Partitions are /dev/sdXY where Y represents the partition number (beginning with 1) within that device.
EIDE device naming was the same as IDE is the same as PATA, before Linux kernel 2.6.19 (Thank you, Paradox, for noting the change!)
/dev/hda was the 'master' drive on the 'primary' controller.
/dev/hdb was the 'slave' drive on the 'primary' controller.
/dev/hdc was the 'master' drive on the 'secondary' controller.
/dev/hdd was the 'slave' drive on the 'secondary' controller.
A number follows each drive device to denote the partition(s), beginning with 1.
Since Linux kernel 2.6.19, the same naming convention as SCSI & SATA is used for EIDE, IDE, and PATA.
edited 11 hours ago
answered Apr 5 at 18:50
K7AAYK7AAY
1,0301028
1,0301028
1
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disksda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).
– Hermann
Apr 5 at 19:02
1
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
add a comment |
1
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disksda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).
– Hermann
Apr 5 at 19:02
1
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
1
1
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disk
sda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).– Hermann
Apr 5 at 19:02
SATA drives and USB thumb-drives are handled by the SCSI driver, so the reference still applies. The order (which disk
sda
) is derived from how the controller enumerates the disks (depending on the hardware, the order may change every boot). Hot-plugged devices usually are assigned the first unused letter (though you and the kernel may have different opinions on which letters are still in use).– Hermann
Apr 5 at 19:02
1
1
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
The partitions do not start with "0" but "1" usually.
– Paradox
Apr 5 at 19:29
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510778%2flinux-block-devices-naming%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Note that (E-)IDE and "PATA" are just different names for exactly the same thing. In fact, there's nothing that would be officially called "PATA", that's just an alias for IDE that people started using because it nicely mirrors "SATA".
– TooTea
2 days ago