Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk. Partition numbers aren't assigned sequentially; read on PC partitioning (follow the “further information” links) and perhaps this answerthis answer and this threadthis thread.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answerquanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk. Partition numbers aren't assigned sequentially; read on PC partitioning (follow the “further information” links) and perhaps this answer and this thread.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk. Partition numbers aren't assigned sequentially; read on PC partitioning (follow the “further information” links) and perhaps this answer and this thread.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.

added 460 characters in body
Source Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk. Partition numbers aren't assigned sequentially; read on PC partitioning (follow the “further information” links) and perhaps this answer and this thread.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk. Partition numbers aren't assigned sequentially; read on PC partitioning (follow the “further information” links) and perhaps this answer and this thread.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.

Source Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

The disk names (sda, sdb, sdc, …) are assigned in the order in which the drivers are initialized. That can be pretty random (it depends in which order the devices are loaded, and sometimes which drive responds to a query a microsecond earlier than the other on some system bus).

The partition numbers (sda1 vs sda2 vs …) are fixed; they won't change until you repartition the disk.

The reliable way to access particular disks is through LVM, labels or UUIDs.

  • UUIDs are assigned when you create the filesystem; quanta's answer shows how to see a disk's UUID and use it in /etc/fstab.

  • If you prefer to use meaningful labels, run tune2fs -L ubuntu /dev/sda1 and so on to give each partition with a filesystem a unique label, and mkswap -L swap1 /dev/sda5 (don't do that while the swap area is in use). Then use a line like this in /etc/fstab:

     LABEL="ubuntu" / ext4 errors=remount-ro,acl 0 1
    
  • LVM logical volume names is what I prefer to use, but your system doesn't use LVM. Think of it for your next build.