Questions tagged [lsblk]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
19 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
33 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
47 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
37 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
52 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
88 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
22 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
111 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 ...
0
votes
1answer
24 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
56 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
370 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 ...
5
votes
3answers
569 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
78 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
47 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
97 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) ...
1
vote
1answer
31 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
51 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
331 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
629 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
56 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
105 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
77 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
58 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
61 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
59 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, ...
1
vote
0answers
104 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
61 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
449 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
742 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
191 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 ...
0
votes
2answers
2k 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 ...
2
votes
1answer
422 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="...
3
votes
2answers
5k 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 ...
2
votes
2answers
584 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
3answers
471 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 ...
5
votes
4answers
612 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 ...
-4
votes
1answer
49 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
0answers
7k 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
504 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 ...
4
votes
1answer
640 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-...
0
votes
1answer
504 views

reconfigure the fstab file with UUID

we have a lot of linux working machines all mount point are configured in the /etc/fstab as the following: /dev/sdc /grd/sdc ext4 defaults,noatime 0 0 /dev/sdd /grd/sdd ext4 defaults,noatime 0 0 /...
2
votes
2answers
4k 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
2k views

lsblk doesn't show anything about root file system

On openSUSE Leap 42.3, lsblk output is like below which doesn't show anything about / i.e. root. Now my question is what about root file system? > lsblk NAME MAJ:MIN RM SIZE RO TYPE ...