2022 Developer Survey is open! Take survey.

Questions tagged [lsblk]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5 votes
3 answers
572 views

bash + how to compare arg to one of the disks in linux machine

I can capture the disk devices of my Linux machine with the following command: lsblk -lnb | numfmt --to=iec --field=4 | grep disk | awk '{print $1}' sda sdb sdc sdd In my bash script I used the line ...
user avatar
  • 11k
5 votes
2 answers
653 views

How do I tell which partition I booted from?

Is there a way to know which partition you actually booted from? fdisk -l reveals a "Boot" column that I definitely don't have on my NVME. Is this just legacy information? Device Boot ...
user avatar
  • 53
0 votes
0 answers
19 views

How does it possible two hardware RAIDs in lsblk but one - in lspci?

lspci output: Slot: 02:00.0 Class: RAID bus controller Vendor: LSI Logic / Symbios Logic Device: MegaRAID SAS 2208 [Thunderbolt] SVendor: Dell SDevice: PERC H710P Mini (for ...
user avatar
0 votes
1 answer
19 views

RHEL 7.9 Help: Why do I get differences between lsblk and df

I have resized recently the rhel-root partition of my RHEL 7.9 system, basically I did the following commands: pvresize /dev/sda2 lvextend -l+100%FREE /dev/rhel/root I was able to resize the ...
user avatar
0 votes
0 answers
20 views

How to get path of hardware RAID array in lsblk?

I detect list of hardware arrays by next command: lspci -vmm | sed -E -n '/RAID bus|SCSI controller/,/^ *$/p' | tr -d '\t' Example: Class:RAID bus controller Vendor:Broadcom / LSI Device:MegaRAID SAS ...
user avatar
0 votes
1 answer
372 views

How to update/refresh changed partlabels as reported by lsblk?

On Linux, the command lsblk -o partlabel will display the partlabel for block devices. I have used gdisk to change a partlabel. After the change, lsblk is still reporting the old value of the ...
user avatar
  • 1,226
1 vote
0 answers
29 views

Size discrepancy between df -h output and lsblk output [duplicate]

When I run df -h and lsblk, on my Ubuntu 20.04.3 LTS Oracle Cloud instance, there is a discrepancy between sizes of my /dev/sda1 mount. I am not sure if this has to do with GiB vs GB or something else....
user avatar
  • 11
-1 votes
1 answer
56 views

fdisk prints nothing and devices are not mounted

I am quite new to Linux, and I need to mount some devices, using the lsblk command and more. lsblk presents the devices (internal, I don't have external ones) the output is: # lsblk NAME ...
user avatar
  • 1
1 vote
2 answers
48 views

'dd' command disk copy retains old size

I recently upgraded my home server and wanted to increase my cloud disk to 2TB from 600gb. After some research I found the dd command which can fully copy a disk, which in my case seemed like a good ...
user avatar
  • 13
0 votes
2 answers
46 views

lsblk size not adding up

I am using Ubuntu 20.04. when I do lsblk size is not adding up. root@UbunutuTemplate-001:/home/tca# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 4K 1 loop /snap/bare/5 ...
user avatar
  • 157
-2 votes
1 answer
67 views

linux + from lsblk partitions size are greater then disk size

I get the following details from RHEL 7.2 machine , sda DISK is using LVM lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 250G 0 disk ├─sda1 8:1 0 500M 0 part /boot ├─sda2 8:2 0 199.5G 0 part │...
user avatar
  • 11k
0 votes
0 answers
120 views

How to access files in USB in linux

I'm using Ubuntu 20.04, recently (almost a week ago) I upgraded my kernel from 5.11.0 to 5.14.0 and after that I can't access any USB drivers. The system recognises my USBs since when I run lsusb it ...
user avatar
0 votes
0 answers
57 views

Drive not connecting after power outage

I have a raspberry pi with two external hard drives. the electricity went off today and after that i couldn't enter the rpi. what i ended up doing was to remove the flash card and enter it in another ...
user avatar
  • 1,640
0 votes
0 answers
28 views

Truncated ext4 partition after trying to access my partition from windows with ext2fs

After trying to access my Linux partition from Windows operating system, my Linux partition is now truncated to a size 1K byte and I am no longer able to mount that partition. "fdisk" shows ...
user avatar
  • 31
0 votes
1 answer
116 views

Parse lsblk with jq

I am currently trying to parse the output of lsblk with jq and filters it based on some criteria. Given the following example output: { "blockdevices": [ { "name":...
user avatar
  • 83
1 vote
1 answer
87 views

Can't see mounted drive under lsblk, blkid or mount

I have mounted an external hard drive via /etc/fstab with the following entry: UUID=a8286fc9-5b08-41d9-8c4e-cb993a8976d1 /home/bu/safe-heaven-2/ ext4 defaults 0 I can read/write from this disk but I ...
user avatar
3 votes
2 answers
609 views

Does Linux update the size of a block device?

In the light of emmc wearout monitoring I'm wondering about the size as displayed inside a running Linux OS. An emmc chip has an internal manager which keeps track of the usage intensity of all the ...
user avatar
1 vote
1 answer
320 views

external hard drive not showing with fdisk & lsblk

this is output of dmesg [ 17.064706] usb 2-2: new SuperSpeed USB device number 3 using xhci_hcd [ 22.496752] usb 2-2: device descriptor read/8, error -110 [ 22.600534] usb 2-2: new SuperSpeed ...
user avatar
  • 11
1 vote
1 answer
342 views

Where is the udev database stored and what sets the permission?

I'm using Debian. When reading man lsblk I see mention of a udev db: The lsblk command reads the sysfs filesystem and udev db to gather information. If the udev db is not available or lsblk is ...
user avatar
  • 22.5k
0 votes
2 answers
144 views

how to compare the lsblk disk size values to disk size values from df -h

I want to compare the size of the disk between the size from df -h to lsblk Because we performed resize2fs , and after resize2fs I want to check the size from df -h against the size from lablk So we ...
user avatar
  • 11k
2 votes
1 answer
421 views

Meaning of the output from lsblk command

I have recently started using Linux and would love to know how to interpret the output from the lsblk -f command. More specifically, I would like to know the different partitions and sizes. For ...
user avatar
0 votes
2 answers
289 views

How do i read this raid information output?

Im currently working on a remote ubuntu 18.04 server where i need to set up a new raid array (raid1) and then mount it as an available partition to the active filesystem. The first step for me is to ...
user avatar
0 votes
0 answers
73 views

Can't read or mount MicroSD card (ext4) on Asus X205T (Q4OS)

I have hard time with MicroSD card on Asus X205T. I can see device with lsblk, but it can't be mounted and read, it doesn't read filesystem and stuff. Distro: Q4OS 32 bit. Filesystem: ext4. Kernal: ...
user avatar
  • 129
4 votes
1 answer
62 views

Is there a scriptable way to identify the nth partition of a disk?

Suppose I have a disk located at /dev/DISK_NAME. I'm curious if there is a command to find the nth partition of this disk. It seems like this sort of thing should be possible with lsblk. The best I ...
user avatar
1 vote
1 answer
44 views

UUID Multiple Times in /dev

I have an external hard drive that shows up many times in /dev whenever its connected. Is there any way I can fix this? Or is it a problem with the drive itself? Output of cat /proc/partitions: major ...
user avatar
  • 11
0 votes
1 answer
340 views

lsblk + file system type not appears from lsblk

we have VM machine with disks as sdb sdc sdd ,,, etc we create ext4 file system on sdb disk as the following mkfs.ext4 -j -m 0 /dev/sdb -F mke2fs 1.42.9 (28-Dec-2013) Discarding device blocks: done ...
user avatar
  • 11k
0 votes
0 answers
28 views

unable to figure out who is consuming root disk space

Team, my system running ubuntu 16 and k8s 1.13.5 is reporting 79% full and i tried several utilities and no avail what is actually consuming it. I tried several options but output of none is summing ...
user avatar
  • 123
-1 votes
2 answers
50 views

linux + is it possible to identify specific new disk in order to join the new disk to VG

we want to build new bash script that will join one of the new disks to volume group ( VG ) lets say we have linux machine and we add 10 new disks the target is to do manual "label" on one ...
user avatar
  • 11k
0 votes
3 answers
181 views

how to create disk label without creation filesystem on new disk

we have rhel 7.2 server , server is VM server and we add new disk - sde with the following example we create ext file system with label - disk2 mkfs.ext4 -L disk2 /dev/sde mke2fs 1.42.9 (28-Dec-2013) /...
user avatar
  • 11k
1 vote
1 answer
297 views

Mounting encrypted SD card: where does /dev/dm-3 come from?

I was trying to mount an encrypted SD card on Kubuntu 20.04. lsblk gives me this: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 ...
user avatar
  • 13
2 votes
1 answer
445 views

lsblk doesn't show size on some partitions

(Ubuntu 20.04) lsblk -f shows: NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT --- nvme0n1 ...
user avatar
  • 579
1 vote
1 answer
74 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: ...
user avatar
  • 111
0 votes
1 answer
434 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 ...
user avatar
0 votes
0 answers
363 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,...
user avatar
  • 249
1 vote
1 answer
93 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 ...
user avatar
0 votes
2 answers
142 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/...
user avatar
0 votes
0 answers
207 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 ...
user avatar
0 votes
1 answer
176 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=...
user avatar
  • 281
1 vote
1 answer
694 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 ~$ ...
user avatar
0 votes
1 answer
819 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 ...
user avatar
  • 217
0 votes
1 answer
104 views

Output of lsblk includes both pipes and back ticks

sda |-sda1 ntfs Recovery F49E60439E5FFD0C |-sda2 vfat ...
user avatar
  • 1,364
0 votes
1 answer
472 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,...
user avatar
  • 43
0 votes
1 answer
312 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 ...
user avatar
  • 1
0 votes
1 answer
777 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 ...
user avatar
  • 43
0 votes
1 answer
92 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....
user avatar
0 votes
1 answer
571 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 ...
user avatar
  • 2,819
1 vote
1 answer
55 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 ...
user avatar
  • 2,819
0 votes
1 answer
195 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 ...
user avatar
0 votes
1 answer
243 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 ...
user avatar
0 votes
1 answer
387 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 ...
user avatar
  • 105