Questions tagged [lsblk]
The lsblk tag has no usage guidance.
118
questions
-1
votes
1
answer
51
views
What are these empty 0B SIZE read-write loop devices?
What are these empty (0B SIZE) read-write loop devices?
sudo lsblk --all
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 0B 0 loop
loop1 7:1 0 0B 0 loop
loop2 7:2 ...
0
votes
1
answer
56
views
lsblk incorrect readonly
Hi I'm trying to detect ro filesystem mainly for root partition
This is portable system using usb as OS disk
The state is readonly, I cannot write anything
touch /tmp
touch: setting times of '/tmp': ...
0
votes
1
answer
25
views
Return the root partition name with lsblk or similar when the partition is encrypted
This is my lsblk output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /efi
├─nvme0n1p2 259:2 0 420G 0 ...
1
vote
1
answer
50
views
Is it safe to permanently remove swap in device with huge memory?
I have a desktop with 128G RAM. This is my typical memory usage when I am not running calculation-heavy scripts:
sam@debian:~$ free -ht --si
total used free shared ...
0
votes
0
answers
65
views
'lsblk' is not displaying the GPT partition label after formatting the disk
My lsblk is not showing gpt partition label for one disk partition, which was freshly formatted with
mkfs.ext4 -v -L MyLabel mydev
somehow the partition was not labeled properly afterwards. I didn't ...
2
votes
1
answer
58
views
Disk size is variable
I was flashing a new operating system to a device, but after the process was complete, I couldn't boot into it. I then checked the disk, and I noticed something strange.
Different tools report ...
0
votes
1
answer
253
views
What is `nvme0n1p2` in `lsblk` command output? [duplicate]
In my Ubuntu 23.04 system, running lsblk gives the following output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 55.6M ...
0
votes
2
answers
80
views
Unable to boot on centos 7
Since today, I cannot boot into my Linux CentOS 7. I am directly taken to emergency mode.
I have tried the following commands without success:
sudo umount /dev/sdb1 and sudo fsck -p /dev/sdb1
I have ...
0
votes
3
answers
247
views
What is the issue with lsblk command in some server display full details and it is not other
What is the issue with lsblk command in some servers displaying full details and it is not others?
Examples:
Server 1
~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda ...
0
votes
2
answers
195
views
unable to find or mount sd card
I have a SD card that is giving me some trouble.
I followed some instructions from here https://forums.linuxmint.com/viewtopic.php?t=368230 and used the command
sudo dd if=/dev/zero of=/dev/sdb bs=1M ...
3
votes
1
answer
385
views
How does lsblk obtain sector size?
My disk is sda. There is the size file /sys/dev/block/8:0/size. Its unit is sectors. When I run strace lsblk I can see it reading this file.
But how does lsblk get the sector size to later show the ...
1
vote
1
answer
699
views
parted + is it correct to create disk partitions in Linux only by percentage
we want to create 2 partitions from each new disk by parted command
as the following example:
sdg 8:96 0 50G 0 disk
├─sdg1 8:97 0 25G 0 part
└─sdg2 ...
0
votes
2
answers
322
views
How do I find out what is the hard disk for OS in Linux
in our bash scripts , we have many places in the code that need to capture only the disk that related to OS ( operation linux/RHEL system )
we are using Linux versions as 7.2/7.5/7.6/7.9 , and on most ...
0
votes
3
answers
807
views
lsblk + how to print only the disks that are without filesystem
we want to print only the disks that are without filesystem by command line
from following example we can see that sde disk is without filesystem
lsblk -o NAME,FSTYPE
NAME FSTYPE
sda
├─...
0
votes
0
answers
93
views
Why are uuid and ptuuid different for different commands
I get the following results for the 3 commands blkid, lsblk and sfdisk on an Arch Linux system
$ lsblk --json -p -b -o+PTUUID,UUID /dev/sda1
{
"blockdevices": [
{
"...
1
vote
1
answer
715
views
wipefs + disk not cleaned
we erased the disk signature as the following ( this is after we performed umount )
wipefs -a /dev/sde
/dev/sde: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef
then we check that disk is ...
1
vote
4
answers
612
views
How can I get the lsblk-devices that are NOT in use
root@pve-virt-01:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 250G 0 disk
├─sda1 8:1 0 1007K 0 part
├─sda2 8:2 ...
2
votes
1
answer
1k
views
fdisk or sfdisk + how to show the disks size in GIB and not in GB
we can print all disks by the following ( on our RHEL machine )
fdisk -lu | grep "Disk /dev"
Disk /dev/sda: 247.0 GB, 246960619520 bytes, 482344960 sectors
Disk /dev/sdb: 4294 MB, 4294967296 ...
5
votes
3
answers
625
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 ...
7
votes
2
answers
2k
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 ...
0
votes
0
answers
157
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 ...
0
votes
1
answer
367
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 ...
1
vote
0
answers
248
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 ...
3
votes
1
answer
5k
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 ...
1
vote
0
answers
30
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....
-1
votes
1
answer
784
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 ...
1
vote
2
answers
564
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 ...
0
votes
2
answers
964
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
...
-2
votes
1
answer
582
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
│...
0
votes
0
answers
868
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 ...
0
votes
0
answers
158
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 ...
0
votes
1
answer
608
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":...
1
vote
1
answer
2k
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 ...
3
votes
2
answers
823
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 ...
2
votes
1
answer
1k
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 ...
2
votes
1
answer
1k
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 ...
0
votes
2
answers
665
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 ...
3
votes
1
answer
2k
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 ...
0
votes
2
answers
1k
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 ...
0
votes
0
answers
169
views
Can't read or mount microSD card (ext4) on Asus X205T (Q4OS)
I'm having a hard time with my microSD card on an Asus X205T. I can see the device with lsblk, but it can't be mounted and read, it doesn't read the filesystem and stuff.
Distro: Q4OS 32-bit, ...
4
votes
1
answer
339
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 ...
1
vote
1
answer
76
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 ...
-1
votes
1
answer
2k
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
...
0
votes
0
answers
30
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 ...
-1
votes
2
answers
128
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 ...
0
votes
3
answers
641
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)
/...
1
vote
1
answer
777
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 ...
2
votes
1
answer
1k
views
lsblk doesn't show size on some partitions
(Ubuntu 20.04)
lsblk -f shows:
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
---
nvme0n1 ...
1
vote
1
answer
282
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: ...
1
vote
1
answer
1k
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 ...