Mention fdisk -l order on man page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux