Questions tagged [lsblk]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
28 views

USB device not being recognised as mass storage

I recently bought an external SSD. My Windows laptop recognises the device just fine, but I can't mount it on my Linux machine. The output of lsusb | grep SanDisk shows it there: Bus 002 Device 004: ...
0
votes
1answer
45 views

lsblk + how to capture the disks that are without filesystem

Dear friends and colleges we have servers with rhel 7.5 version , and each server include disks with filesystem and disks without filesystem usually sda - is the OS disk , and sdb is disk that already ...
0
votes
0answers
25 views

How to mount a usb harddisk after a interrupted shred

Shred command was interrupted by a unrelated and user induced system halt. Now I'm not able to see the harddisk using lsblk -l. Tried on multiple linux systems. This answer (from External HDD detected,...
1
vote
1answer
21 views

lsblk doesn't show attached virtual storage / partition

I attached a used virtual storage (backup) to a rescue instance because I need the files of the attached storage. [root@centos-1cpu-1gb-de-fra1 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda ...
0
votes
2answers
34 views

Multiple Threads Cannot Access the Same RAMdisk Created by modprobe

I have created RAMdisks of 60GB using modprove brd rd_size=62914560 on CentOS 7.5. Checking the results, fdisk -l /dev/ram* shows 16 ram block devices of 60GB size (/dev/ram0, /dev/ram1, ..., /dev/...
0
votes
0answers
43 views

Identify if an usb pendrive has been plugged

I want to reliably and thoroughly identify that a usb pendrive has been connected. I'm using a reduced version¹ of Debian Buster packed in a live ISO image running in VirtualBox. The process of ...
0
votes
0answers
51 views

blkid doesn't doesn't print the device name on CentOS

I am running a container with CentOS: docker run -it centos bash I first check for its Label or UUID: [root@3271c071fe0a /]# cat /proc/cmdline BOOT_IMAGE=/boot/vmlinuz-5.3.0-1032-aws root=LABEL=...
1
vote
1answer
57 views

How can lsblk and fdisk show different sizes for the same partition?

I am running a virtualbox VM and I can see that the size of /dev/sda2 is being shown differently in the two outputs. Also, in the output of fdisk, /dev/sda2 and /dev/sda5 seem to be overlapping ~$ ...
0
votes
1answer
92 views

lsblk shows disk partitions but fdisk fails

I recently tried to power up my laptop and received a "Reboot and Select Proper Boot Device" error. This seems to indicate that the firmware is not able to find the boot partition. So, I ...
0
votes
1answer
33 views

Output of lsblk includes both pipes and back ticks

sda |-sda1 ntfs Recovery F49E60439E5FFD0C |-sda2 vfat ...
0
votes
1answer
110 views

HDD size from df or lsblk?

I've been said to write a program in c++ to get every hdd and partition's total, free and used size. I can use commands to do this. I searched and I understood that there are two ways of getting size,...
0
votes
1answer
69 views

Command to list partition type codes in deb and rpm distributions for MBR and GPT

Is there any command to list all partition type codes recognizable by currently installed distribution (In my case Ubuntu 18.04.03 LTS) I know the following website exists Andries E. Brouwer 1995-2002 ...
0
votes
1answer
85 views

partition size vs file system size

I am writing a c++ program that I need to get partitions and hhd's total, free and used space. I'm so confused with all commands and codes that can be used to get these data from system and all ...
0
votes
1answer
16 views

How to umount a USB key while running on tails

I would like to create a live USB from TAILS (on the same USB key as that of running TAILS). A dd from the iso to the device is not tolerated since the key is mounted: $ lsblk sdb 8:16 1 7....
0
votes
1answer
70 views

How to merge lvm

I don't know what my colleague exactly did but I know that he was trying to increase the size of LVM. For now I can see such an output after executing the command lsblk: NAME MAJ:MIN RM SIZE ...
1
vote
1answer
36 views

How to increase LVM partition

I'm using RHEL7 and here is my partition: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 100G 0 disk ├─sda1 8:1 0 1G ...
0
votes
1answer
39 views

How can I show the hierarchy symbols when using “lsblk”

When I run lsblk, I get (example) sda |-sda1 | `-rhel-root |-sda2 `-rhel-home On another server I get the proper characters displaying the hierarchy. sda └─sda1 | └─rhel-root └─sda2 └─rhel-home ...
0
votes
1answer
32 views

How is it possible to navigate to a location which doesn't show up through “lsblk”?

I'm on RHEL 7. lsblk provides the output below. [root@integrator7 /]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K ...
0
votes
1answer
58 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
66 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
65 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
130 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
358 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
65 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
46 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 ...
0
votes
1answer
48 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
90 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
99 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
52 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
63 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
223 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
36 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
312 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
46 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
159 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 ...
5
votes
3answers
1k 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
239 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
50 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
174 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
34 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
98 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
609 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
1k 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
65 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
122 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
93 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
66 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
67 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=...