Score:0

What's the difference between /dev/dsk and /dev/sda?

ga flag

I was researching about block devices and character devices. I found an article that mentions how block devices are assigned as /dev/sd[a-z]. But then I read a different article that mentions how block devices are assigned as /dev/dsk/[c#t#d#]. Are they not both block devices? When is one used over the other?

in flag
It would be helpful if you would share the article where you found the nominations.
uz flag
You can check if it is a block device by executing `file /dev/dsk/*`
Nikita Kipriyanov avatar
za flag
Also it would be nice if you explain which OS you are thinking of. /dev/sdX hints at Linux, but I can't remember seeing /dev/dsk there, usually there is /dev/disk. On the other hand, HP-UX has /dev/dsk/cXtYdZ, but no /dev/sdX. Maybe you mixed two different articles about two different systems?
Score:2
in flag

/dev/sd[a-z] is the most common naming scheme for hard disks in Linux.

Other Unix flavours use different naming schemes, you can find /dev/dsk/ for example in HPUX or Solaris.

Score:0
in flag

Some naming conventions are the result of how the kernel discovers devices, the first SCSI/SATA/SAS Disk gets the name sda allocated and the second scb and subsequent letters fo the alphabet are used for other disks.

Other device drives use different block device naming schemes for the devices they detect.

The problem with discovery is that discovery can fail, for example your first disk fails and then the second disk can get the name sda allocated, while before it was named sdb. An /etc/fstab entry for sdb1 won't work anymore, but the data isn't gone, but now sda1 needs to be mounted on that mount point.

To counter that persistent device naming schemes have been created, which can be used to identify a device correctly, even when discovery assigns it a different name. That are for example the /dev/disk/by-uuid/* and/or /dev/disk/by-label/* device names.

Some more background here: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_storage_devices/assembly_overview-of-persistent-naming-attributes_managing-storage-devices

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.