I don't know if this is a hardware or software issue, but on my Dell XPS, running 18.04, when I type sudo fdisk -l
I get all sorts of garbage that I don't want to see of the form
Disk /dev/loop21: 140.9 MiB, 147722240 bytes, 288520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
I don't know what these /dev/loop devices are and certainly don't want to see any information about them. All I care about is my actual disks, and I'd like to see a summary that can fit onto one page.
I can eliminate the /dev/loop
garbage by the call sudo fdisk -l /dev/[nv]* /dev/sd*
but this command still produces way more information than I need.
This kind of output---which is more or less what 16.04 used to produce---would be ideal if there were some way of filtering out all of the extraneous garbage. That is, it just lists the available file systems and any partitions that are on them.
Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 sectors
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1023999 1021952 499M Windows recovery environment
/dev/nvme0n1p2 1024000 1228799 204800 100M EFI System
/dev/nvme0n1p3 1228800 1261567 32768 16M Microsoft reserved
/dev/nvme0n1p4 1261568 158547967 157286400 75G Microsoft basic data
/dev/nvme0n1p5 158547968 327999487 169451520 80.8G Linux filesystem
/dev/nvme0n1p6 327999488 1284618239 956618752 456.2G Linux filesystem
/dev/nvme0n1p7 1284618240 1835775999 551157760 262.8G Linux filesystem
/dev/nvme0n1p8 1835776000 1835778047 2048 1M BIOS boot
/dev/nvme0n1p9 1835778048 1967998975 132220928 63G Linux filesystem
/dev/nvme0n1p10 1967998976 2000408575 32409600 15.5G Linux swap
Disk /dev/sda: 28.9 GiB, 31004295168 bytes, 60555264 sectors
Disk /dev/sdb1: 30 GiB, 32212140032 bytes, 62914336 sectors
Perhaps there's an alternative to fdisk that's more customizable? Thanks for any advice!
I use
lsdrv
(list drive) which is an alias oflsblk ...
setup in my~/.bashrc
file.The alias selects the important fields I want to see that fit on a regular screen without line wrapping:
From
man fdisk
: