Questions tagged [lsblk]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
35 views

How to output only dev names and types in lsblk?

I intend to get a list of all partitions with their corresponding types but arranged in the proper tree order. This is what I get with lsblk -o NAME,TYPE -i sda disk |-sda1 part ...
0
votes
1answer
38 views

Disk doesn't appear in blkid but does appear in lsblk

When we do the following on a RHEL lab machine: lsblk | grep sdd sdd 8:48 0 1.8T 0 disk we get the sdd disk, but when we do blkid as the following: blkid | grep sdd we do not ...
0
votes
1answer
37 views

How to match usb device UUID to MODEL and VENDOR?

I'm working on a tool for managing USB devices attached to my machine. At one point I need to match UUIDs to vendor and model, so I used the following command: # lsblk -o UUID,MODEL,VENDOR,TRAN ...
0
votes
1answer
27 views

filter lsblk command using awk or grep

I need to filter the result of this command: lsblk -rno "name,size,mountpoint,fstype" | grep -v 'sda' Let me give a result of the above command on my computer: sdb 223,6G sdb1 179,8G /VMs/qemu ext4 ...
0
votes
1answer
36 views

fdisk partitions don't show with lsblk

I've partitioned an external drive with fdisk and this are the results: But when I run lsblk the partitions I created are not showing. What's the fault here?
2
votes
2answers
55 views

Efficient way to obtain a device mountpoint from its UUID

In a script I'm working on, a variable UUID must be used in obtaining the current mountpoint a device is attached to. The solution I came up with is this one: UUID='fc70ae3d-65e7-4437-a371-...
0
votes
0answers
38 views

Trying to fully wipe hard drive, can't get rid of /dev/mapper/cl-(swap, home & root)

I tried to install CentOS via a USB stick onto my machine's hard-drive and the installation failed part way. That was a few days ago. I don't recall what the error message said exactly. I have logged ...
1
vote
3answers
3k views

lsblk + capture only the disks

I want to capture only the disks from lsblk as showing here fd0 also appears in spite its not really disk for use in this case we can just do lsblk | grep disk | grep -v fd0 but maybe we missed ...
0
votes
1answer
28 views

lsblk -o serial only 8 characters

I like doing lsblk -o type,name,label,partlabel,size,model,serial,wwn,uuid for the serial option it reports only 8 characters. I just had two samsung ssd's, one with serial S3TANY0K123456 and ...
0
votes
1answer
46 views

Find out disks, which do not have any partitions/LVs mounted

Contrary to this question, I would like to know which (physical) disks currently do not have any partitions or LVs mounted. This is for a script, which shall return disks where none of their ...
1
vote
1answer
62 views

Getting an error “appear to have very similar superblocks”. Ways to fix it?

So something strange is with my partitions. root@rescue ~ # mdadm -A --scan mdadm: WARNING /dev/sdb1 and /dev/sdb appear to have very similar superblocks. If they are really different, please --...
0
votes
1answer
40 views

Linux terminal: how to achieve nice “tree” displays of e.g. lsblk output?

what do I need to do to achieve a nice display output like this from lsblk? What I currently get is this rather ugly output: Thank you very much in advance for your help!
0
votes
3answers
54 views

How to use newly partitioned disk?

I've done a disk partition with fdisk /dev/sda with following options: P - primary But when inspecting disk with df -h command I do not see the disk space available to use. But I can see it with ...
0
votes
1answer
143 views

MDADM creates additional block devices

I noticed a strange issue when creating RAID array with mdadm. As far as I see, it creates additional devices of md type. According to the kernel.org documentation, the md device type is Metadisk (...
12
votes
3answers
3k views

Can I shorten this filter, that finds disk sizes over 100G?

My goal is to get the disks greater than 100G from lsblk. I have it working, but it's awkward. I'm pretty sure it can be shortened. Either by using something totally different than lsblk, or maybe I ...
1
vote
0answers
28 views

check ssd from udevadm info

I have two peripherals(SSD and USB) connected to my system. Command: lsblk -S Output: NAME HCTL TYPE VENDOR MODEL REV TRAN sda 1:0:0:0 disk ATA xxxxxxxxxxxxxx 023 sata ...
3
votes
1answer
188 views

How to set a disk's (not partition) LABEL?

I've been searching around, and can't find a clear answer, or I find that the answer is 'no' when my system shows me otherwise. I'm running Arch Linux, and while attaching new HDD into a zfs pool I ...
1
vote
1answer
31 views

Sort block devices by most recently connected?

How can I block devices by the most recent added ones? No option in lsblk seems to have that functionality.
0
votes
1answer
98 views

Ubuntu lsblk drive size

I am setting up a ZFS NAS using Ubuntu 18 with 8 hard drives for storage. When I use sudo lsblk -P to check what the drive names are, I only see sdb-sdh. I know this is because it will skip over the ...
0
votes
0answers
524 views

Partition size mismatch using df and lsblk comands

On one of our systems, Additional SSD device mounted is showing size of 5.8 TB, but same partition showing size of only 59 GB using df command- [opc@kms10]$ df -Th /data1 Filesystem Type ...
3
votes
2answers
6k views

Can i list unmounted drives without fdisk or lsblk?

I have an Inteno dg200 Router running some Iopsys linux version (kernel 3.14 or so, I believe) I've had some trouble getting a fileshare running using the USB ports and my external harddrive. The ...
5
votes
3answers
816 views

Iterate lines of string variable in bash

I have a script where I want to list USB devices using the command lsblk. The command: $ lsblk -o NAME,TRAN,VENDOR,MODEL | grep usb which results in sdb usb Kingston DataTraveler 2.0 sdc ...
1
vote
1answer
151 views

lsblk lists a device, then says “not a device”

I'm seeing somewhat odd behaviour: % lsblk | grep sdb sdb 8:16 1 114.6G 0 disk └─sdb1 8:17 1 114.6G 0 part /run/media/...
2
votes
0answers
48 views

Strange difference of disk size

I have a Google Cloud Instance: When i check the disk space with two different command it show: df -H Filesystem Size Used Avail Use% Mounted on /dev/sda2 11G 3.1G 7.5G 30% / ...
0
votes
2answers
127 views

lsblk - what are the possible values for the column “state”

I am creating an overview site of my hard drives (HDD) I have installed in a machine. That website requests the HDDs including the state through a lsblk command. I want to indicate the status (state) ...
2
votes
2answers
5k views

Make lsblk list devices by-id

I'm constantly having the situation where I want to correlate the output of lsblk which prints devices in a tree with their name in the scheme of /dev/sdXY with the drives /dev/disk/by-id/ names.
1
vote
1answer
33 views

show volume informations in tabular view

I'm trying to save on linux powershell core 6.1 information about the volumes in a variable. Best in the same or similar format as it is possible on windows. But i am unable to achiev this kind of ...
1
vote
1answer
72 views

What is the deal with this usb drive with a second block device?

I have a giveaway usb stick and when I plug it into my computer and run lsblk it shows two block devices, i.e. sdb and sdc. sdb of them contains almost all the free space ( ~15G) and the sdc one is ...
2
votes
0answers
458 views

Different mount points with df -Th and lsblk

I am wondering why the output of df -Th and lsblk commands showing different mount points for logical volume tmp. Server: RHEL v7.4 [root@mysystem ~]# df -h Filesystem Size ...
11
votes
4answers
2k views

Why does writing random data using dd result in disk partitions?

Prior to running the dd command, the command lsblk returned the output below: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk The ...
0
votes
0answers
850 views

The availability of lsblk on RHEL 5

According to the following solution link https://access.redhat.com/solutions/2063833, there is no lsblk on RHEL 5. Could it be said that there is no solution for lsblk on RHEL 5?
0
votes
2answers
60 views

why we get values in variable that are different

when I want to get the size of sdb size on remote machine - master I get that: # ssh master "lsblk | grep \"^sdb\" | awk '{print \$4}' " 100G but when we want to set the size value in variable ...
0
votes
1answer
113 views

how to create parted disk

the linux ( OS ) installed on sda and machine also have additional disk - sdb sdb 8:16 0 20G 0 disk but we want to add two new partitions as sdb1 and sdb2 as the following: ...
-1
votes
2answers
82 views

Linux + how to capture the OS disk device [closed]

we want to capture the disk device that belong to the OS ( Linux ) since each linux machine have list of disks that are not the OS , we want to capture the disk that belong to the OS so by fdisk ...
-2
votes
2answers
62 views

how to find the size of the disk that OS is installed on

how to verify the disk size ( the disk that OS is installed on ) we have redhat 7.2 I will give example # disk_os_size=` lsblk | grep sda ` sda 8:0 0 150G 0 disk ├─sda1 ...
0
votes
2answers
63 views

Can't remove space from beginning of variable

I am trying to crate a folder with the label and uuid of a media device plugged in as its name, on another flash drive which I am using to log. I have the following code: LOGDEVICELABEL=...
1
vote
0answers
74 views

Cannot access mounted partition after using dd

I have used following command to create an image of mounted partition sda1: dd if=/dev/sda1 of=/dev/sdb1 'conv=noerror,sync' where sda1 is the one I want to "backup" and sdb1 is obviously target, ...
4
votes
3answers
516 views

Do all disks devices in my HW machines start with - sd?

in my bash script I use the syntax lsblk | grep sd in order to capture all disk in my HW machines ( not include flash card or rom ) I just worry that some disk device name will be diff from sd , and ...
1
vote
0answers
121 views

findmnt, mountinfo show non-existent partitions

I noticed findmnt -n -o SOURCE --target MOUNT_POINT was returning lines containing block devices that didn't exist on my system: TARGET SOURCE FSTYPE OPTIONS /home/...
1
vote
2answers
63 views

Replacing same keyword with different strings per line

I'm using the following command to return a list of available disks and whether they're ssd or rotational (basically replacing 0 and 1 in lsblk's output with their actual meaning): lsblk -d -o name,...
0
votes
1answer
562 views

Programmatically identify block device of filesystem [closed]

The following code was tested on RedHat 7 using df verison 8.2 and lsblk version 2.23.2. This is important as the lsblk utility has signficantly more output options than the RedHat 6 version (2.17.2) ...
1
vote
3answers
992 views

Displaying physical block devices

I need to list all block devices installed in my system. There is a command named lsblk to show all block devices. [kni@hist ttyid:0 pią kwi 13 17:56:26 ~]$ lsblk NAME MAJ:MIN RM ...
2
votes
1answer
262 views

Unmount partition mounted at /home and move /home to partition mounted at /

I have two partitions on my Debian machine. One(first) is mounted at root / and the other(second) is mounted at /home(There are two users root and ako in /home/ directory). Now, I want to unmount ...
2
votes
0answers
9k views

Inaccessible drive with the message: unknown filesystem type '(null)'

Short story: A disk with partitions sdb1-sdb4 and filetype ext4 now shows up as sdb with no file type. While trying to mount sdb I get the messages: mount: /dev/sdb is write-protected, mounting read-...
2
votes
1answer
487 views

blkid + print only the disks that are with filesystem

regarding blkid command please help me to approve this assumption can we say that blkid will print all disk devices only if these disks are with filesystem ( by mkfs ) blkid /dev/sda1: UUID="...
6
votes
4answers
842 views

How to capture all disks that don’t have a file system

I want to capture all disks that do not have a filesystem ( all disks that mkfs not runs on them ) I tried the below, but still gives the OS ( sda ). What is the best approach with lsblk or other ...
2
votes
2answers
678 views

lsblk + print only disks that with specific size

I want to print all disks that are equal or more then 18G how to fit the following syntax in order to print only the disks that are => 18G lsblk -l | awk '/disk/' fd0 2:0 1 4K 0 ...
-4
votes
1answer
50 views

my pendrive display in terminal sdb 8:16 1 14.5gb o disk, con't disply GUI mode and con't read and write [closed]

I used the command lsblk and the system recognized my pendrive as /dev/sdb. The problem is that I can't read or write to it.
-2
votes
1answer
633 views

how to print the disks from lsblk in GIGA [closed]

how to print the disks from lsblk in GIGA lsblk -io KNAME,TYPE,SIZE,MODEL dm-0 lvm 50G dm-1 lvm 16G dm-2 lvm 100G sdb disk 1.8T AVAGO sdc disk 1.8T AVAGO sdd disk 1.8T ...
5
votes
1answer
779 views

Why is usb-drive not visible with `lsblk` after having been ejected from Thunar?

If I put a USB-drive in, it will automount. I can see it with lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 1 7,5G 0 disk └─sdb1 8:17 1 7,5G 0 part /media/user/usb-...