When I use Ubuntu and CentOS, I see /dev/sda and /dev/vda. So I can't understand what is the different between above two?

  • Is one of these in a VM?
    – goldilocks
    Jul 18, 2014 at 17:31
  • Yes. I'm using VM ..:) Jul 18, 2014 at 17:32

5 Answers 5


They're different devices.

/dev/sda is the first disk that's either SCSI or (more likely) providing the SCSI drive API to user land. This includes SATA drives and IDE drives using libata. This can also be an IDE/SATA/SCSI/etc. drive emulated by the hypervisor.

/dev/vda is the first disk using the virtualization-aware disk driver. The performance should be much better, as the hypervisor doesn't have to emulate some hardware interface.

If the disk has been exposed to your VM under both interfaces, you should prefer /dev/vda as it'll almost certainly be faster.

  • 2
    What would be the goal of having both /dev/sdX & /dev/vdX devices in a machine? Dec 16, 2016 at 20:43
  • 1
    @user42076 Only thing I can think of is a hosting company that doesn't know exactly what OS you're running on its VM could offer both interfaces, in case your OS doesn't support the faster /dev/vda. Other than that... no idea why you'd do it. If you're actually seeing it done somewhere, probably worth it's own question.
    – derobert
    Dec 16, 2016 at 20:46
  • @user42076 Yea, I am going to ask about this . . . . . lol Dec 16, 2016 at 21:06
  • Just to be sure, are there any cases when I should not name my VM storage devices vdx, when host-OS is newer Linux (e.g. Debian 10) and VM-OS is newer Linux or newer Windows? No matter if VM disk-type is virtio-blk, virtio-scsi, iSCSI, NDB, CD-ROM?
    – MrCalvin
    Apr 16, 2020 at 8:47
  • Hmm, all the examples I can find when using virtio-scsi is the device is named sdx. But virtio-scsi is also a para-virtualized device, so why not vdx?
    – MrCalvin
    Apr 16, 2020 at 9:23

/dev/sdx and /dev/hdx are physical (hard) disk drives or emulated physical (hard) disk drives. When the kernel or some program I/O's to these, it does all sorts of things like bringing the disk to the right spot and doing all sorts of physical-specific "stuff."

/dev/vdx is for virtual (hard) disk drives. All the kernel does when it is I/O'd to is tell the virtualization software that bits need to be read/written and it's done. In general, vdx is faster because the kernel doesn't need to tell the hard drive to do a whole bunch of random junk that really shouldn't be needed because it just needs to tell the VM hypervisor to do stuff.

I apologize for the word "stuff," I couldn't think of a better word :D

  • The word is was plenty expressive - thanks for your answer.
    – mikeserv
    Jul 19, 2014 at 6:43
  • 1
    Stuff? You couldn't think of "something" or "the requested IO operation". Apology not accepted. ;)
    – Johan
    Jul 23, 2014 at 11:53

In the udev rules in /lib/udev/rules.d/* is defined which kind of hardware gets which name from the kernel.

See the rules for /dev/vd*:

# partitions do not have hardware identifiers
ENV{DEVTYPE}!="disk",                   GOTO="persistent_storage_not_a_disk"
# nor do paravirtualized hard disks
KERNEL=="vd*",                          GOTO="persistent_storage_not_a_disk"


KERNEL=="vd*",                          ATTRS{serial}=="?*", \
ENV{ID_BUS}="virtio",   ENV{ID_SERIAL}="$attr{serial}"

So /dev/vda is the first, virtual harddrive (no hardware identificators) and a bus id virtio. Looks like a qemu/kvm guest.

The udev rules for /dev/sd* devices can be more different hardware types: scsi, ata, ieee1394, usb, ...


/dev/ is the part in the unix directory tree that contains all "device" files -- unix traditionally treats just about everything you can access as a file to read from or write to.

So in essence, the /dev/sda is all device files found in your Harddrive while the /dev/vda is all device files found in the space allocated for your virtual machine.


One fairly fundamental way in which these /dev/.da device files differ that has not yet been mentioned is that they represent different kernel major numbers. If you follow that link you will land on a kernel source documentation page containing a table of mostly all of the allocated device major numbers. This same file is also very likely on your harddisk somewhere.

Here's what a quick CTRL-F has surfaced for me regarding your question:

112 block IBM iSeries virtual disk
      0 = /dev/iseries/vda  First virtual disk, whole disk
      8 = /dev/iseries/vdb  Second virtual disk, whole disk
    200 = /dev/iseries/vdz  26th virtual disk, whole disk
    208 = /dev/iseries/vdaa 27th virtual disk, whole disk
    248 = /dev/iseries/vdaf 32nd virtual disk, whole disk

    Partitions are handled in the same way as for IDE
    disks (see major number 3) except that the limit on
    partitions is 7.

The 112 number listed at top indicates the allocated major number and the various 0...8...200 numbers listed before each line indicate the possible minor number ranges. These numbers, among many other things, are used by the linux kernel to pair driver modules with physical devices - they identify a device type.

The above list accounts for 3 of 4 matches found with CTRL-F - here's the fourth:

202 block   Xen Virtual Block Device
      0 = /dev/xvda       First Xen VBD whole disk
      16 = /dev/xvdb      Second Xen VBD whole disk
      32 = /dev/xvdc      Third Xen VBD whole disk
      240 = /dev/xvdp     Sixteenth Xen VBD whole disk

            Partitions are handled in the same way as for IDE
            disks (see major number 3) except that the limit on
            partitions is 15.

There definitely seems to be a trend among vda block types. Note that these may not be completely up to date in the documentation - even as linked at kernel.org. The devs are, after all, only human. But another possible source of discrepancy is where your distribution's maintainers chose to locate the devices. A great number of the paths listed amount to little more than suggestions - there are many ways to relocate them.

And here's sda:

8 block SCSI disk devices (0-15)
      0 = /dev/sda      First SCSI disk whole disk
     16 = /dev/sdb      Second SCSI disk whole disk
     32 = /dev/sdc      Third SCSI disk whole disk
    240 = /dev/sdp      Sixteenth SCSI disk whole disk

    Partitions are handled in the same way as for IDE
    disks (see major number 3) except that the limit on
    partitions is 15.

As already noted - these paths are eminently configurable - but the major/minor numbers themselves serve as pretty explicit identifiers. You can check these with a stat call to a device file.

stat /dev/sda

  File: ‘/dev/sda’
  Size: 0               Blocks: 0          IO Block: 4096   block special file
Device: 5h/5d   Inode: 7598        Links: 1     Device type: 8,0
Access: (0660/brw-rw----)  Uid: (    0/    root)   Gid: (    6/    disk)
Access: 2014-07-18 11:10:13.112495427 -0700
Modify: 2014-07-16 18:59:41.313323401 -0700
Change: 2014-07-16 18:59:41.313323401 -0700
 Birth: -

That's my /dev/sda. There's a lot of information there, but to the right you can see that its Device Type is specified as major number 8, minor number 0. You can id pretty much any device file that way by comparing its maj/min to the table linked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .