sda & sde sometimes switch their places, is this normal?

Message
Author
User avatar
Buck Fankers
Posts: 770
Joined: Sat Mar 10, 2018 8:06 pm

sda & sde sometimes switch their places, is this normal?

#1 Post by Buck Fankers »

This one is weird, I have 5 disks, I physically connected them in order (sata1, sata2...) to have them like this:

Code: Select all

$ lsblk -f
NAME   FSTYPE LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                           
├─sda1 vfat               E997-FBEA                             510.6M     0% /boot/efi
├─sda2 swap               f81bb6f3-5def-4895-ae1f-a6bbbb7f7731                [SWAP]
├─sda3 ext4   MX.19    1f47aad0-5e59-4f43-873b-ec60649ef805    3.2G    85% /
├─sda4 ext4   AX.19.Xfce  e17f462d-921d-467c-8268-bf1237b7c7e6                
├─sda5 ext4   Manjaro     7b7fe4bf-d644-4391-b05f-f3c6e5cbdad5                
├─sda6 ext4   MX.19.runit b27b4be2-9289-4c41-950d-10906372a362                
└─sda7 ext4   data        eea17d6d-7afd-45ae-88b9-e470916c46d7  282.6G     8% /media/data
sdb                                                                           
└─sdb1 ext4   samsung     8c51e874-993b-42d4-9733-f9a4041470d8  127.4G    37% /media/samsung
sdc                                                                           
└─sdc1 ext4   backup      7ae4cabb-8e46-409c-bd3c-e04aa424a1fc  522.7G    66% /media/backup
sdd                                                                           
└─sdd1 ext4   seagate2    dd29df59-d556-4123-aa8b-e2143faca3a4  434.1G     0% /media/seagate2
sde                                                                           
└─sde1 ext4   seagate1    985a2c87-6928-4a97-b760-af273cbb69ba  387.6G    10% /media/seagate1
sr0
But sometimes after restart, sda and sde swap their places without my approval :yuck: Is this normal behavior? If not, is there anything I can/should do about this? Anyone heard of this before? (Bios is updated to latest version)

Code: Select all

$ lsblk -f
NAME   FSTYPE LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                           
└─sda1 ext4   backup      7ae4cabb-8e46-409c-bd3c-e04aa424a1fc  522.7G    66% /media/backup
sdb                                                                           
└─sdb1 ext4   samsung     8c51e874-993b-42d4-9733-f9a4041470d8  127.4G    37% /media/samsung
sdc                                                                           
└─sdc1 ext4   seagate2    dd29df59-d556-4123-aa8b-e2143faca3a4  434.1G     0% /media/seagate2
sdd                                                                           
└─sdd1 ext4   seagate1    985a2c87-6928-4a97-b760-af273cbb69ba  387.6G    10% /media/seagate1
sde                                                                           
├─sde1 vfat               E997-FBEA                             510.6M     0% /boot/efi
├─sde2 swap               f81bb6f3-5def-4895-ae1f-a6bbbb7f7731                [SWAP]
├─sde3 ext4   MX.19       1f47aad0-5e59-4f43-873b-ec60649ef805    3.3G    84% /
├─sde4 ext4   AX.19.Xfce  e17f462d-921d-467c-8268-bf1237b7c7e6                
├─sde5 ext4   Manjaro     7b7fe4bf-d644-4391-b05f-f3c6e5cbdad5                
├─sde6 ext4   MX.19.runit b27b4be2-9289-4c41-950d-10906372a362                
└─sde7 ext4   data        eea17d6d-7afd-45ae-88b9-e470916c46d7  282.6G     8% /media/data
sr0 
QSI:

Code: Select all

System:    Host: mx Kernel: 5.4.0-1.1-liquorix-amd64 x86_64 bits: 64 compiler: gcc v: 8.3.0 
           parameters: audit=0 BOOT_IMAGE=/boot/vmlinuz-5.4.0-1.1-liquorix-amd64 
           root=UUID=1f47aad0-5e59-4f43-873b-ec60649ef805 ro 
           Desktop: Xfce 4.14.1 tk: Gtk 3.24.5 info: xfce4-panel wm: xfwm4 dm: LightDM 1.26.0 
           Distro: MX-19_x64 patito feo October 21  2019 base: Debian GNU/Linux 10 (buster) 
Machine:   Type: Desktop System: MSI product: MS-7A70 v: 1.0 serial: <filter> 
           Mobo: MSI model: B250M BAZOOKA (MS-7A70) v: 1.0 serial: <filter> 
           UEFI: American Megatrends v: 1.70 date: 07/03/2018 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Mouse B330/M330/M331 
           serial: <filter> charge: 55% (should be ignored) rechargeable: yes 
           status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i5-7400 bits: 64 type: MCP arch: Kaby Lake 
           family: 6 model-id: 9E (158) stepping: 9 microcode: CA L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 24000 
           Speed: 3304 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 3307 2: 3309 3: 3404 
           4: 3408 
           Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled 
           Type: mds mitigation: Clear CPU buffers; SMT disabled 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass 
           mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, 
           STIBP: disabled, RSB filling 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel HD Graphics 630 vendor: Micro-Star MSI driver: i915 v: kernel 
           bus ID: 00:02.0 chip ID: 8086:5912 
           Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: fbdev,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2) v: 4.5 Mesa 18.3.6 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel 200 Series PCH HD Audio vendor: Micro-Star MSI driver: snd_hda_intel 
           v: kernel bus ID: 00:1f.3 chip ID: 8086:a2f0 
           Sound Server: ALSA v: k5.4.0-1.1-liquorix-amd64 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
           vendor: Micro-Star MSI driver: r8169 v: kernel port: e000 bus ID: 01:00.0 
           chip ID: 10ec:8168 
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 3.41 TiB used: 1.36 TiB (40.0%) 
           ID-1: /dev/sda vendor: Samsung model: SSD 850 EVO 250GB size: 232.89 GiB block size: 
           physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 2B6Q scheme: GPT 
           ID-2: /dev/sdb vendor: Western Digital model: WD20EZRZ-00Z5HB0 size: 1.82 TiB 
           block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s rotation: 5400 rpm 
           serial: <filter> rev: 0A80 scheme: MBR 
           ID-3: /dev/sdc vendor: Seagate model: ST500DM002-1BD142 size: 465.76 GiB block size: 
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> 
           rev: HP73 scheme: MBR 
           ID-4: /dev/sdd vendor: Seagate model: ST500DM002-1BD142 size: 465.76 GiB block size: 
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> 
           rev: KC43 scheme: GPT 
           ID-5: /dev/sde vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB block size: 
           physical: 4096 B logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 023 scheme: GPT 
Partition: ID-1: / raw size: 32.23 GiB size: 31.47 GiB (97.65%) used: 26.60 GiB (84.5%) fs: ext4 
           dev: /dev/sde3 
           ID-2: swap-1 size: 2.05 GiB used: 0 KiB (0.0%) fs: swap swappiness: 15 (default 60) 
           cache pressure: 100 (default) dev: /dev/sde2 
Sensors:   System Temperatures: cpu: 34.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/antix.list 
           1: deb http://la.mxrepo.com/antix/buster/ buster main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian buster-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian buster main contrib non-free
           2: deb http://deb.debian.org/debian-security buster/updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mxrepo.com/mx/repo/ buster main non-free
           No active apt repos in: /etc/apt/sources.list.d/sublime-text.list 
           No active apt repos in: /etc/apt/sources.list.d/various.list 
           Active apt repos in: /etc/apt/sources.list.d/vivaldi.list 
           1: deb http://repo.vivaldi.com/stable/deb/ stable main
           No active apt repos in: /etc/apt/sources.list.d/vscodium.list 
Info:      Processes: 195 Uptime: 5m Memory: 15.54 GiB used: 566.8 MiB (3.6%) Init: SysVinit 
           v: 2.93 runlevel: 5 default: 5 Compilers: gcc: 8.3.0 alt: 8 Shell: bash v: 5.0.3 
           running in: quick-system-in inxi: 3.0.36 
fdisk --list

Code: Select all

$ sudo fdisk --list
Disk /dev/sdd: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x7fa73897

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdd1        2048 976773119 976771072 465.8G 83 Linux


Disk /dev/sde: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: CT500MX500SSD1  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 4584A4F3-641B-4279-AFC9-0E9DD8623290

Device         Start       End   Sectors   Size Type
/dev/sde1       2048   1050623   1048576   512M EFI System
/dev/sde2    1050624   5351423   4300800   2.1G Linux swap
/dev/sde3    5351424  72935423  67584000  32.2G Linux root (x86)
/dev/sde4   72935424 115943423  43008000  20.5G Linux filesystem
/dev/sde5  115943424 197863423  81920000  39.1G Linux filesystem
/dev/sde6  197863424 261351423  63488000  30.3G Linux root (x86)
/dev/sde7  261351424 953575423 692224000 330.1G Linux filesystem


Disk /dev/sdc: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1D9179C8-1C3A-4EC7-ACB7-7A95226579CE

Device     Start       End   Sectors   Size Type
/dev/sdc1   2048 976773119 976771072 465.8G Linux filesystem


Disk /dev/sdb: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 850 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 37DA418B-DE45-40C3-B95B-259B2797A54B

Device     Start       End   Sectors  Size Type
/dev/sdb1   2048 469839871 469837824  224G Linux filesystem


Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRZ-00Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x4668745f

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1        2048 3907028991 3907026944  1.8T 83 Linux
parted --list

Code: Select all

$ sudo parted --list
Model: ATA WDC WD20EZRZ-00Z (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  2000GB  2000GB  primary  ext4


Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sdb: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  241GB  241GB  ext4


Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  500GB  500GB  ext4


Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sdd: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  500GB  500GB  primary  ext4


Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sde: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  538MB   537MB   fat32                 boot, esp
 2      538MB   2740MB  2202MB  linux-swap(v1)
 3      2740MB  37.3GB  34.6GB  ext4
 4      37.3GB  59.4GB  22.0GB  ext4
 5      59.4GB  101GB   41.9GB  ext4
 6      101GB   134GB   32.5GB  ext4
 7      134GB   488GB   354GB   ext4

User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: sda & sde sometimes switch their places, is this normal?

#2 Post by JayM »

Yes, it's normal, or at least normal that it can happen. It depends on which drive happens to be detected first, second, third and so on when it's scanning the SATA bus for devices. Windows does the same thing when assigning drive letters: they can sometimes be different. That's why it's always better to mount disks and partitions in fstab by their UUIDs which don't change (unless you reformat or repartition the disks) instead of their /dev/sdX designations which can change. It doesn't usually happen very often though.

It could also be an issue with either the physical "sda" disk, or with the SATA port it's plugged into or the SATA cable it's using, causing it to be slow to respond, or else something up with your "sde" disk/port/cable causing the system to think its the first drive.

I don't know if they still do, but motherboards used to have SATA 1 and SATA 2 connectors with SATA 1 meant for use with optical drives. Maybe yours has SATA 2 and 3 ports and sda is connected to the wrong one?

Next time it happens, immediately reboot and go into your system settings ("BIOS") and look at the SATA device (disk) order there and see what it tells you.)
Last edited by JayM on Sat Dec 28, 2019 8:00 pm, edited 1 time in total.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Richard
Posts: 1590
Joined: Fri Dec 12, 2008 9:31 am

Re: sda & sde sometimes switch their places, is this normal?

#3 Post by Richard »

I have read that using PARTUUID instead of UUID in /etc/fstab will prevent changing places.

Some reading:
https://unix.stackexchange.com/question ... and-ptuuid
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
__kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
__Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.
HP Ryzen 5 17-cp3xxx with MX23.4 AHS & Liquorix 6.10-12~mx23ahs amd64

alamahant
Posts: 42
Joined: Thu Dec 19, 2019 9:48 pm

Re: sda & sde sometimes switch their places, is this normal?

#4 Post by alamahant »

It happens often if you switch between windows and linux installations.
In fstab please mount the partitions by their UUID, part UUID, Label or lvm names if you use lvm.
Please have a look at
/dev/disk
You shall see something like :
by-id by-label by-partlabel by-partuuid by-path by-uuid
These are all the ways to indicate partitions.
Please have a look here https://wiki.archlinux.org/index.php/Fs ... lesystems]
;)

User avatar
Buck Fankers
Posts: 770
Joined: Sat Mar 10, 2018 8:06 pm

Re: sda & sde sometimes switch their places, is this normal?

#5 Post by Buck Fankers »

Thank you all for responses. So it is OK if it happens, OK (phew!) Although I do have UUID's in my fstab, see bellow. OK maybe I need PARTUUID, need to read more about it, thanks for the link and all the info. Oh yes, I know, some HDD's sometimes need more time to initiate, that's why I placed on 1st and 2nd position SSD, third is fastest HDD and 4th & 5th are slower HDD's. No windows either. I will do some readin and change my sftam from UUID to PARTUUID and see if it makes any difference.

My fstab: (only partitions I'm not auto mounting are 3 sda's, where are other OS's on such as, another MX, antiX and Manjaro)

Code: Select all

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

# ====================
#   SDA (ssd)  500GB
# ====================
#Entry for /dev/sda1 :
UUID=E997-FBEA	/boot/efi	vfat	defaults,noatime,dmask=0002,fmask=0113	0	0
#Entry for /dev/sda2 :
UUID=f81bb6f3-5def-4895-ae1f-a6bbbb7f7731	swap	swap	defaults	0	0
#Entry for /dev/sda3 :
UUID=1f47aad0-5e59-4f43-873b-ec60649ef805	/	ext4	defaults	1	1
#Entry for /dev/sda7 :
UUID=eea17d6d-7afd-45ae-88b9-e470916c46d7	/media/data	ext4	defaults,nosuid,nodev,relatime	0	0

# ====================
#   SDB (ssd)  250GB
# ====================
#Entry for /dev/sdb1 :
UUID=8c51e874-993b-42d4-9733-f9a4041470d8	/media/samsung	ext4	defaults,nosuid,nodev,relatime	0	0

# ====================
#   SDC (hdd) 2000GB
# ====================
#Entry for /dev/sdc1 :
UUID=7ae4cabb-8e46-409c-bd3c-e04aa424a1fc	/media/backup	ext4	defaults	0	0

# ===================
#   SDD (hdd)  500GB
# ===================
#Entry for /dev/sdd1 :
UUID=985a2c87-6928-4a97-b760-af273cbb69ba	/media/seagate1	ext4	defaults	0	0

# ===================
#   SDE (hdd)  500GB
# ===================
#Entry for /dev/sde1 :
UUID=dd29df59-d556-4123-aa8b-e2143faca3a4	/media/seagate2	ext4	defaults	0	0
P.s.
I even checked jumpers to see if disks are properly set as master and slave <jk>

User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: sda & sde sometimes switch their places, is this normal?

#6 Post by JayM »

One thing I noticed is that both sda and sde are SSDs while the rest are HDDs. It could be that sde is so fast to respond that it's being detected prior to the spinners, but why it's trading places with the other SSD and not one of the HDDs is beyond me.
:confused2:
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Buck Fankers
Posts: 770
Joined: Sat Mar 10, 2018 8:06 pm

Re: sda & sde sometimes switch their places, is this normal?

#7 Post by Buck Fankers »

Well, changed all UUID's into PARTUUID's and no change, after every restart SDx are assigned differently, I wonder if something is wrong with this computer?

fstab (I kept old entries just in case)

Code: Select all

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

# ====================
#   SDA (ssd)  500GB
# ====================
# Entry for /dev/sda1 : (run blkid for PARTUUID)
PARTUUID=47417f3c-4286-4107-a51d-8c4b512c13d2	/boot/efi	vfat	defaults,noatime,dmask=0002,fmask=0113	0	0
# UUID=E997-FBEA	/boot/efi	vfat	defaults,noatime,dmask=0002,fmask=0113	0	0

# Entry for /dev/sda2 :
PARTUUID=feb58cb1-3d7a-4570-bb2a-6cf92a6e9787	swap	swap	defaults	0	0
# UUID=f81bb6f3-5def-4895-ae1f-a6bbbb7f7731	swap	swap	defaults	0	0

# Entry for /dev/sda3 :
PARTUUID=af200ddb-76c9-458a-97e8-3ebbf74c3daf	/	ext4	defaults	1	1
# UUID=1f47aad0-5e59-4f43-873b-ec60649ef805	/	ext4	defaults	1	1

# Entry for /dev/sda7 :
PARTUUID=b11c4e9e-6964-43cc-a9d0-1498f6f7d16e	/media/data	ext4	defaults,nosuid,nodev,relatime	0	0
# UUID=eea17d6d-7afd-45ae-88b9-e470916c46d7	/media/data	ext4	defaults,nosuid,nodev,relatime	0	0


# ====================
#   SDB (ssd)  250GB
# ====================
# Entry for /dev/sdb1 :
PARTUUID=6b5fbfd6-1bbc-4111-b85e-064f8ef4af32	/media/samsung	ext4	defaults,nosuid,nodev,relatime	0	0
# UUID=8c51e874-993b-42d4-9733-f9a4041470d8	/media/samsung	ext4	defaults,nosuid,nodev,relatime	0	0

# ====================
#   SDC (hdd) 2000GB
# ====================
# Entry for /dev/sdc1 :
PARTUUID=4668745f-01	/media/backup	ext4	defaults	0	0
# UUID=7ae4cabb-8e46-409c-bd3c-e04aa424a1fc	/media/backup	ext4	defaults	0	0

# ===================
#   SDD (hdd)  500GB
# ===================
# Entry for /dev/sdd1 :
PARTUUID=7fa73897-01	/media/seagate1	ext4	defaults	0	0
# UUID=985a2c87-6928-4a97-b760-af273cbb69ba	/media/seagate1	ext4	defaults	0	0

# ===================
#   SDE (hdd)  500GB
# ===================
# Entry for /dev/sde1 :
PARTUUID=a5e3405d-1315-4e85-94b5-a9a512929a9c	/media/seagate2	ext4	defaults	0	0
# UUID=dd29df59-d556-4123-aa8b-e2143faca3a4	/media/seagate2	ext4	defaults	0	0
three computer restarts, and disks are changing positions like no tomorrow, different order after every restart

Code: Select all

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0   2.1G  0 part [SWAP]
├─sda3   8:3    0  32.2G  0 part /
├─sda4   8:4    0  20.5G  0 part 
├─sda5   8:5    0  39.1G  0 part 
├─sda6   8:6    0  30.3G  0 part 
└─sda7   8:7    0 330.1G  0 part /media/data
sdb      8:16   0 232.9G  0 disk 
└─sdb1   8:17   0   224G  0 part /media/samsung
sdc      8:32   0 465.8G  0 disk 
└─sdc1   8:33   0 465.8G  0 part /media/seagate2
sdd      8:48   0   1.8T  0 disk 
└─sdd1   8:49   0   1.8T  0 part /media/backup
sde      8:64   0 465.8G  0 disk 
└─sde1   8:65   0 465.8G  0 part /media/seagate1
sr0     11:0    1  1024M  0 rom 

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
└─sda1   8:1    0   224G  0 part /media/samsung
sdb      8:16   0   1.8T  0 disk 
└─sdb1   8:17   0   1.8T  0 part /media/backup
sdc      8:32   0 465.8G  0 disk 
└─sdc1   8:33   0 465.8G  0 part /media/seagate1
sdd      8:48   0 465.8G  0 disk 
└─sdd1   8:49   0 465.8G  0 part /media/seagate2
sde      8:64   0 465.8G  0 disk 
├─sde1   8:65   0   512M  0 part /boot/efi
├─sde2   8:66   0   2.1G  0 part [SWAP]
├─sde3   8:67   0  32.2G  0 part /
├─sde4   8:68   0  20.5G  0 part 
├─sde5   8:69   0  39.1G  0 part 
├─sde6   8:70   0  30.3G  0 part 
└─sde7   8:71   0 330.1G  0 part /media/data
sr0     11:0    1  1024M  0 rom  


$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0   2.1G  0 part [SWAP]
├─sda3   8:3    0  32.2G  0 part /
├─sda4   8:4    0  20.5G  0 part 
├─sda5   8:5    0  39.1G  0 part 
├─sda6   8:6    0  30.3G  0 part 
└─sda7   8:7    0 330.1G  0 part /media/data
sdb      8:16   0 232.9G  0 disk 
└─sdb1   8:17   0   224G  0 part /media/samsung
sdc      8:32   0 465.8G  0 disk 
└─sdc1   8:33   0 465.8G  0 part /media/seagate1
sdd      8:48   0 465.8G  0 disk 
└─sdd1   8:49   0 465.8G  0 part /media/seagate2
sde      8:64   0   1.8T  0 disk 
└─sde1   8:65   0   1.8T  0 part /media/backup
sr0     11:0    1  1024M  0 rom  


User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: sda & sde sometimes switch their places, is this normal?

#8 Post by JayM »

More reading: https://wiki.debian.org/Part-UUID
Persistent device naming for block devices has been made possible by the introduction of udev and has some advantages over the use of traditional bus-based names such as /dev/hda1 or /dev/sda2.

While Linux distributions and udev are evolving and hardware detection is becoming more reliable, there are also a number of new problems and changes:

If you have more than one disk controller (IDE or especially SCSI/SATA), or even if you just have variable numbers of removable USB/firewire storage devices attached from day to day, the order in which they are detected may not be deterministic. The result is that device names like /dev/sda1 and /dev/sdb1 may switch around randomly on each boot. Persistent naming allows you not to worry about this at all.

For machines with IDE controllers (including for instance machines with all-SATA hard drives and just one IDE cdrom drive), the switch to a standard Squeeze kernel may cause trouble: with the introduction of the new libata PATA support, your IDE hdX devices will become sdX devices. Again, if you have persistent naming in place, you won't even notice. (The postinst for the package linux-base includes code to assist with the changeover, but it makes sense to get it sorted out and verified as working in advance.)

Big machines, with many fast CPUs, and many Fiber Channel Host Bus Adapters, variable load/latency FC switches, SCSI controllers, and/or high-performance network cards, may have asynchronous timing issues when dealing with udev and multipath I/O, with almost unpredictable device detection order and automatic assignment of names during boot.

There are more reasons, but these are the most critical ones now and in the near future. That's why Debian encourages you to change your setup to persistent naming schemes, unless you are using LVM. LVM logical volumes should always be identified by logical volume name (/dev/mapper/name).
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Eadwine Rose
Administrator
Posts: 14841
Joined: Wed Jul 12, 2006 2:10 am

Re: sda & sde sometimes switch their places, is this normal?

#9 Post by Eadwine Rose »

I have the same thing happen with my external HDD. The rest (4) are SSDs.

On installs the external is most times sdd, well pretty much always, but SOMETIMES it's sde. Indeed if I have been in windows, or.. whatever reason that it might have started slow. Usually powering all the way down fixes this. I hardly ever unplug the thing. It is there in case of emergency or if I need to bring my important files someplace (this thing also gets synced to the cloud).

On live systems the external usually becomes sdb. I have made it a habit to check gparted on each install I make to ensure I am installing to the right sdX drive. ;)

The SSD drives have never swapped spots among each other, they are always in the same order, just that the HDD sticks its butt in between at different spots.
MX-23.6_x64 July 31 2023 * 6.1.0-37amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: sda & sde sometimes switch their places, is this normal?

#10 Post by Head_on_a_Stick »

Buck Fankers wrote: Sat Dec 28, 2019 10:09 pm Well, changed all UUID's into PARTUUID's and no change, after every restart SDx are assigned differently, I wonder if something is wrong with this computer?
Changing /etc/fstab will not change how the block device names are assigned, use a udev rule for that: https://wiki.archlinux.org/index.php/Ud ... vice_names

You need to have either UUIDs, PARTUUIDs or LABELs in /etc/fstab to ensure that each drive is mounted correctly every time.

Note that UUIDs will only change if the partition or filesystem is changed so unless you want to swap filesystems using the PARTUUID instead of UUID offers no advantage. But it does no harm either.
mod note: Signature removed, please read the forum rules

Post Reply

Return to “General”