You are not logged in.

#1 2016-10-22 11:36:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Out of order disk partitions calling `lsblk -f` [SOLVED]

On most of my Arch boxes, calling `lsblk -f` results in an alpha sorted list of partitions, ie (sda1, sda2, sda3 etc).  Recently however, the order is not as such.  Others? Why?

Example: sda4, sda2, sda5, sda3, sda1, sda6 and nvme0n1p5, nvme0n1p3, nvme0n1p1, nvme0n1p6, nvme0n1p4, nvme0n1p2

Last edited by graysky (2016-10-24 19:58:37)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2016-10-22 12:21:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

Wild guess here based off of one data point at my end: are they in order by UUID?

More importantly though, does it matter?  Just add '-x NAME' or '-x KNAME' if you want them sorted by block device name.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-10-24 00:57:31

jesc516
Member
From: LI,NY
Registered: 2015-01-26
Posts: 72

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

mine are also out of order. possible update bug? i last updated on 2016-10-20. was fine before.

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdd      8:48   0 111.8G  0 disk 
├─sdd2   8:50   0 111.3G  0 part 
└─sdd1   8:49   0   487M  0 part 
sdb      8:16   0 111.8G  0 disk 
├─sdb2   8:18   0 110.8G  0 part /
└─sdb1   8:17   0     1G  0 part /boot
sr0     11:0    1  1024M  0 rom  
sde      8:64   0   1.8T  0 disk 
├─sde2   8:66   0   1.8T  0 part 
└─sde1   8:65   0   128M  0 part 
sdc      8:32   0 111.8G  0 disk 
├─sdc2   8:34   0     1K  0 part 
├─sdc5   8:37   0  15.9G  0 part 
└─sdc1   8:33   0  95.9G  0 part 
sda      8:0    0 238.5G  0 disk 
├─sda4   8:4    0 237.9G  0 part 
├─sda2   8:2    0    99M  0 part 
├─sda3   8:3    0    16M  0 part 
└─sda1   8:1    0   450M  0 part 

Offline

#4 2016-10-24 01:00:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

A bug is when software behaves contrary to how it is supposed to.  There is no indication of that there.  Did you bother checking the UUIDs of your partitions - you have ample to provide good evidence for or against my hypothesis.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-10-24 01:11:55

jesc516
Member
From: LI,NY
Registered: 2015-01-26
Posts: 72

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

doesnt look to be in uuid order

NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
sdd                                                         
├─sdd2 ext4            e57ac59d-6ebf-4e5e-a9d7-5b3d54bc6306 
└─sdd1 vfat            1101-F7B1                            
sdb                                                         
├─sdb2 ext4            f806c238-1bf9-43cd-90a9-612261e04c62 /
└─sdb1 vfat            3F7C-ACA4                            /boot
sr0                                                         
sde                                                         
├─sde2 ntfs   Share    363A81183A80D671                     
└─sde1                                                      
sdc                                                         
├─sdc2                                                      
├─sdc5 swap            76583176-352d-4b74-ab61-8507db4a5c36 
└─sdc1 ext4            8b9f7c80-e02d-42db-9139-04c55036bc28 
sda                                                         
├─sda4 ntfs            D69E8E3B9E8E1461                     
├─sda2 vfat            0C87-F884                            
├─sda3                                                      
└─sda1 ntfs   Recovery CCF48766F487519E                     

Offline

#6 2016-10-24 03:16:12

varphi
Member
Registered: 2016-10-24
Posts: 15

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

I have the same problem, I think it's since the kernel 4.8 update.

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0     11:0    1  1024M  0 rom  
sda      8:0    0 465.8G  0 disk 
├─sda2   8:2    0 440.8G  0 part /home
└─sda1   8:1    0    25G  0 part /

I installed kubuntu 16.10 on some other computer recently with a kernel 4.8 and it's the same.

Offline

#7 2016-10-24 11:40:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

varphi wrote:

I have the same problem.

Problem?  Why is this a problem?  Again this is not a bug, problem, or any other negative thing.  There is nothing in lsblk's intended behavior that states the output will be sorted by the block device name unless you add the sort flag to do just this.  The sort flag works as intended.  I am mildly curious what does determine the default ordering - but it is a curiosity to be sated, not a problem to be fixed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2016-10-24 13:37:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

It seems to be determined by partition size for me.

Edit: Looking back at others output, though, it doesn't.

Last edited by Scimmia (2016-10-24 13:38:12)

Offline

#9 2016-10-24 19:08:11

Inan
Member
Registered: 2015-10-10
Posts: 16

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

So... I asked LKML and they'll fix it in v2.29!

Glory to kzak from Redhat! smile

Last edited by Inan (2016-10-24 19:08:40)


arch~awesome~zsh~urxvt | Intel i7-6700K / Nvidia GTX 1080 / Samsung SSD 960 EVO M.2 PCIe NVMe 250 Go

Offline

#10 2016-10-24 19:21:33

rdeckard
Wiki Maintainer
Registered: 2015-01-28
Posts: 137

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

As a comparison, show us "fdisk -l".

Last edited by rdeckard (2016-10-24 19:50:15)

Offline

#11 2016-10-24 19:32:00

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

Inan wrote:

So... I asked LKML and they'll fix it in v2.29!

Glory to kzak from Redhat! smile

Great thanks for taking point on this!  I knew I wasn't crazy.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2016-10-24 19:53:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,740

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

graysky wrote:

Great thanks for taking point on this!  I knew I wasn't crazy.

Isn't this a classic case of affirming the consequent?
tongue


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#13 2016-10-24 19:58:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

ewaller wrote:
graysky wrote:

Great thanks for taking point on this!  I knew I wasn't crazy.

Isn't this a classic case of affirming the consequent?
tongue

Ha!  I'm crazy for other reasons...


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#14 2016-10-24 21:36:25

varphi
Member
Registered: 2016-10-24
Posts: 15

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

Trilby wrote:
varphi wrote:

I have the same problem.

Problem?  Why is this a problem?  Again this is not a bug, problem, or any other negative thing.  There is nothing in lsblk's intended behavior that states the output will be sorted by the block device name unless you add the sort flag to do just this.  The sort flag works as intended.  I am mildly curious what does determine the default ordering - but it is a curiosity to be sated, not a problem to be fixed.

It's a mystery.

Offline

#15 2016-11-13 21:54:10

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Out of order disk partitions calling `lsblk -f` [SOLVED]

I just built 2.29 but it doesn't appear as though the fix was not included...

Last edited by graysky (2016-11-19 12:03:31)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB