Skip to main content
34 votes

How to see disk details like manufacturer in Linux

lsblk (List Block) You can use lsblk command: $ lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE MODEL ... nvme0n1 ...
Paulo Coghi's user avatar
13 votes
Accepted

lsblk + capture only the disks

If you want only disks identified as SCSI by the device major number 8, without device partitions, you could search on device major rather than the string "disk": lsblk -d | awk '/ 8:/' where the -d (...
user4556274's user avatar
  • 9,405
8 votes
Accepted

Move a partition to the right using command line tools

If I want to use sfdisk, how can I use it so that I shift by a very precise sector number, so that it properly "touches" the partition that is on the far end of the disk? (so that they are ...
don_crissti's user avatar
  • 85.6k
6 votes

How to see disk details like manufacturer in Linux

lsblk (List blocks) gives a list with device, size, type and mount_point sudo lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk └─...
Philippe Gachoud's user avatar
6 votes

How can I list partitions in storage order?

I don't know of any program that does this, but it's easy enough to sort if all you want is the list of partitions. For example, on my system: $ sudo fdisk -l Disk /dev/nvme0n1: 953.87 GiB, ...
terdon's user avatar
  • 252k
5 votes

How can I list partitions in storage order?

One tool that lists partitions in the order they are on disk is partedso e.g. using sector as unit size, if you run (as root) parted /dev/sda unit s print you get Model: IS817 DISK (scsi) Disk /dev/...
don_crissti's user avatar
  • 85.6k
5 votes

Are UUIDs and PTUUIDs important for MBR disks? If so, how do I create them on my own?

I assume you mean "a PTUUID for the disk and PARTUUIDs for the partitions", since there is no such thing as "PTUUIDs for partitions". To answer to your question title: No, PTUUIDs ...
telcoM's user avatar
  • 114k
4 votes

How to see disk details like manufacturer in Linux

gnome-disks Either gnome-disks or just "Disks" on the Ubuntu 18.10 dash: This shows that I have a SAMSUNG MZVLB512HAJQ-000L7 in my Lenovo ThinkPad P51. TODO why: for some reason, my SSD model was ...
Ciro Santilli OurBigBook.com's user avatar
4 votes

lsblk + capture only the disks

I wanted to get only the device names of all disks without any other output. Ended up using this: lsblk -nd --output NAME Which yields something like sda sdb -d only outputs disks, -n removes the ...
thrau's user avatar
  • 141
3 votes
Accepted

Are UUIDs and PTUUIDs important for MBR disks? If so, how do I create them on my own?

This leads me to think that UUIDs and PTUUIDs are not necessary for MBR drives. That's mostly correct. PTUUIDs on the partition table itself don't serve any purpose to MBR itself, but it's used by ...
Philip Couling's user avatar
3 votes
Accepted

Copying a partition table with sfdisk from a larger device to a smaller one

The dump option is more suitable to exactly replicate a given partitioning. I can't tell you how reliable it is to use sfdisk with a recipe where the partitioning does not match the device size. But ...
Paul Pazderski's user avatar
3 votes
Accepted

Missing argument option in sfdisk?

Solution 1: build and install sfdisk from sources (to be able to use a more recent version) wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-2.35.tar.gz tar -xvf util-...
intika's user avatar
  • 15.1k
3 votes
Accepted

Redirecting output from within disk operations does not work

This is not output from the command, this is kernel log messages. Since the messages aren't coming from the command, they aren't affected by redirection. Kernel log messages normally go into log files,...
Gilles 'SO- stop being evil''s user avatar
2 votes
Accepted

What is PARTUUID from blkid when using msdos partition table?

Looks like the PARTUUID on a MBR-partitioned disk is the Windows Disk Signature from the MBR block (8 hex digits) + a dash + a two-digit partition number. The Windows Disk Signature is stored in ...
telcoM's user avatar
  • 114k
2 votes

lsblk + capture only the disks

I don't have enough reputation to comment, so here's my comment as an answer. sudo lsblk -I 8,259 -d if you want to include nvme devices in the list.
silverduck's user avatar
2 votes

What type of partition GUID should I use for Linux with Btrfs?

You should choose the partition type according to the role the filesystem on the partition has. In your case, if you have only one Linux partition then that is your root partition, and the appropriate ...
Johan Myréen's user avatar
2 votes
Accepted

fdisk or sfdisk + how to show the disks size in GIB and not in GB

From fdisk man page: In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. ...
Artem S. Tashkinov's user avatar
1 vote

fdisk partition type shown as empy when type is an UUID

Different label types use different partition types values. "dos" != "gpt" Setting the --label as suggested in comments solved the issue: sfdisk --label gpt /dev/sda < "...
Noman_1's user avatar
  • 121
1 vote
Accepted

How can you give a disk and a new UUID?

The device identifier UUID I was able to change the UUID of disk with sfdisk, sudo sfdisk --disk-id /dev/nvme1n1 $(uuidgen) Disk identifier changed from 523436E9-4DA5-474F-87CA-D784E4BF345D to ...
Evan Carroll's user avatar
  • 35.1k
1 vote

How to replace linux distro ISO on bootable USB keeping extra data partition intact and accessible?

Good things first: since modern computers for > 10 years have supported UEFI boot from GPT-partitioned USB devices, there's absolutely nothing special about the formatting/partitioning of your ...
Marcus Müller's user avatar
1 vote

Looking for a way to correct Hard Drive geometry. # of cylinders is not correct

If the hard drives are larger than 7.87 GiB (or about 8.4 GB or exactly 16 450 560 blocks), they are accessed using Logical Block Addressing (LBA). That means only the block number is meaningful, and ...
telcoM's user avatar
  • 114k
1 vote
Accepted

Scripting the partition shrinking

I understood what was wrong: First, sfdisk accept the size of the partition, not the increment, so the + sign is wrong. One difference from fdisk is that the end is the sector number from the ...
ErniBrown's user avatar
  • 111
1 vote
Accepted

sfdisk strange behavior: total size of partitions greater than device size

Partition 3 is an extended partition and shows its size as sum of parts 5, 6, 7, 8.
erkko's user avatar
  • 51
1 vote
Accepted

Why partx can't read the partition table of some disks

partx requires a partition table. The results posted show there is no partition table on sdb. This is different from a disk which has a partition table, but no partitions. In that case, you could ...
sourcejedi's user avatar
  • 53.5k
1 vote
Accepted

Is there a way to import a layout with multiple partitions into ramdisk?

You can use the sfdisk output to create the new partition table sfdisk /dev/ram <part_table If you're really daring (or old-fashioned), you can also use dd dd if=/dev/sda of=/tmp/sda-mbr.bin bs=...
doneal24's user avatar
  • 5,943
1 vote
Accepted

sfdisk - "This disk is currently in use" - but nothing seems to be using it?

ioctl(3, BLKRRPART) = -1 EINVAL (Invalid argument) Indeed, if the message was correct, the error code should show EBUSY not EINVAL. You have an "Invalid argument" because you ...
sourcejedi's user avatar
  • 53.5k
1 vote
Accepted

how mapping of sfdisk partition size is working

Note, you have a slightly out-of-date sfdisk command, as since 2015 version 2.26 it no longer accepts -uM, which is used to set the default "unit". The difference you are seeing is due to whether ...
meuh's user avatar
  • 54.7k
1 vote

lsblk + capture only the disks

Also you can show the internal kernel device name with: lsblk -np --output KNAME /dev/nvme0n1 /dev/nvme1n1 /dev/nvme0n1p1 /dev/nvme1n1p1 /dev/nvme0n1p2 /dev/nvme1n1p2
panticz's user avatar
  • 171
1 vote

Specify partition data in sfdisk and parted

With sfdisk: sudo sfdisk --label dos /dev/sda <<EOF device: /dev/sda unit: sectors sector-size: 512 size= $((24 * 2097152)), type=7, bootable EOF Note that sfdisk deals with starting position ...
Bogey Jammer's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible