All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Jacobson <jidanni@jidanni.org>
To: util-linux@vger.kernel.org
Subject: Mention fdisk -l order on man page
Date: Sun, 07 Mar 2021 08:05:12 +0800	[thread overview]
Message-ID: <87o8fvrfpj.8.fsf@jidanni.org> (raw)

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.

             reply	other threads:[~2021-03-07  0:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07  0:05 Dan Jacobson [this message]
2021-03-08  9:59 ` Mention fdisk -l order on man page Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8fvrfpj.8.fsf@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.