4

For example will sda2 be sda2 on every boot? What about NICs? Will eth0 always be the same card?

2 Answers 2

5

Most linux/Unix systems use udev to take the devices the kernel puts in /sys and create symlinks in /dev based on various rules.

Udev rules go in /etc/udev/rules.d and sometimes in /lib/udev/rules.d - you can change them to fit your needs (for instance, changing eth0 and eth1 around) by changing the relevant rules file.

Edit: I should add that, it's possible to run without udev, and instead create static symlinks for devices (which may be desirable in a server config where the hardware is unlikely to change often). These types of systems are however more difficult to maintain as a result, because you manually take on the role of populating /dev with any new hardware further down the line.

1
  • Update: The new Udev naming scheme is worth a mention here - a new feature in v197 is "Predictable Network Interface Names" which changes slightly some of the previous information with respect to names like eth0, eth1, and so on. You can read more about that here: freedesktop.org/wiki/Software/systemd/…
    – Xyon
    Aug 5, 2014 at 11:01
3

I believe they usualy are. The number 2 in sda2 means it is the second partition and that depends on partition table and doesn't usualy change.

The letters a, b, c in the names sda, sdb, sdc are in the same order according to the order in which they are physically connected to the controller.

The eth0 will probably stay eth0 too. And I don't know about other devices, but I don't see the reason why should be their order changed neither.

1
  • 1
    The letters a, b, c in the names sda, sdb, sdc are in the same order according to the order in which they are physically connected to the controller. - sometimes. They're ordered in whichever order the kernel detects them first (same as the network devices) which can change on each boot.
    – Xyon
    Nov 20, 2012 at 7:28

You must log in to answer this question.

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