util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Mention fdisk -l order on man page
@ 2021-03-07  0:05 Dan Jacobson
  2021-03-08  9:59 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Jacobson @ 2021-03-07  0:05 UTC (permalink / raw)
  To: util-linux

Regarding fdisk -l,
the partitions are sorted
# fdisk -l|grep -P /dev/\\S+\\d|sed 's/ .*//'
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
/dev/sda6
/dev/sda7
/dev/sda8

So why can't the disks also be sorted:
# fdisk -l|grep Disk\ /
Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk /dev/sdb: 14.91 GiB, 16008609792 bytes, 31266816 sectors
Disk /dev/sdd: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk /dev/sdc: 14.46 GiB, 15525216256 bytes, 30322688 sectors
Disk /dev/sdg: 3.8 GiB, 4075290624 bytes, 7959552 sectors
Disk /dev/sdj: 28.84 GiB, 30963400704 bytes, 60475392 sectors
Disk /dev/sdk: 29.72 GiB, 31914983424 bytes, 62333952 sectors
# fdisk -l|grep Disk\ /|sort -c
sort: -:4: disorder: Disk /dev/sdc: 14.46 GiB, 15525216256 bytes, 30322688 sectors

Sure we can do
# fdisk -l /dev/sd?|grep Disk\ /
fdisk: cannot open /dev/sde: No medium found
fdisk: cannot open /dev/sdf: No medium found
fdisk: cannot open /dev/sdh: No medium found
fdisk: cannot open /dev/sdi: No medium found
Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk /dev/sdb: 14.91 GiB, 16008609792 bytes, 31266816 sectors
Disk /dev/sdc: 14.46 GiB, 15525216256 bytes, 30322688 sectors
Disk /dev/sdd: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk /dev/sdg: 3.8 GiB, 4075290624 bytes, 7959552 sectors
Disk /dev/sdj: 28.84 GiB, 30963400704 bytes, 60475392 sectors
Disk /dev/sdk: 29.72 GiB, 31914983424 bytes, 62333952 sectors

But as you see, there is some noise often.

OK, maybe it is just reading in physical disk/partition/device order
always. OK, mention that on the man page.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Mention fdisk -l order on man page
  2021-03-07  0:05 Mention fdisk -l order on man page Dan Jacobson
@ 2021-03-08  9:59 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2021-03-08  9:59 UTC (permalink / raw)
  To: Dan Jacobson; +Cc: util-linux

On Sun, Mar 07, 2021 at 08:05:12AM +0800, Dan Jacobson wrote:
> OK, maybe it is just reading in physical disk/partition/device order
> always. OK, mention that on the man page.

It's in order how kernel listens it in /proc/partitionts. I have info
about it to the man page.

Thanks for your report.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-08 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07  0:05 Mention fdisk -l order on man page Dan Jacobson
2021-03-08  9:59 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).