Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

3 votes
2 answers
373 views
How can I use lsblk to display all devices except my root/main "sda" device where my root filesystem is "/"?
I use LUKS (so my system is encrypted) and LVM. I don’t want sda displayed because that’s where my root filesystem lives, and it’s my root device. The solution should also work for systems without LUKS or LVM, meaning it must handle all scenarios. I'm on a Debian 12.x and I want to display all main...
I use LUKS (so my system is encrypted) and LVM. I don’t want sda displayed because that’s where my root filesystem lives, and it’s my root device. The solution should also work for systems without LUKS or LVM, meaning it must handle all scenarios. I'm on a Debian 12.x and I want to display all main devices in a one row command, if possible, ***except my root device***, regardless of whether it's an LVM, LUKS or not, etc. The command should be flexible, and I don’t want to use fixed specifications *--vg-root, etc., if possible. > **@bertieb comment:** From the added output, it seems the root mountpoint is in a volume group in an encrypted volume on the device is presenting itself as sda -- OP wants that entire device and all associated block 'devices' elided ? i.e. remove root vg AND swap, crypt, containing partition (sda3) plus other partitions, and finally the device (sda) And that should be my result, ***so all main devices without*** sda because that’s my root device where my root filesystem is /, and without me having to specify details, so I can use it on other **devices/systems** as well, whether LVM, LUKS, etc., without needing to know what root is called, or what the UUID is, etc. I don't want to see the partitions too, only the main devices without root device, like in this command lsblk -d -o NAME,SIZE --sort SIZE. This is the output I need: - No sda (since it's the root device containing my root filesystem /) - Only main devices displayed (regardless of how many exist) - No partitions included from the other devices ##### RESULT I NEED :
NAME     SIZE
nvme0n1  238.5G
**My Setup:**
$ lsblk -d -o NAME,SIZE --sort SIZE
NAME      SIZE
sda      57,3G
nvme0n1 238,5G
$ lsblk -fs -o NAME
# ROOT DEVICE
sda1
`-sda
sda2
`-sda
desktop--vg-root
`-sdb3_crypt
  `-sda3
    `-sda
...
...
$ lsblk
NAME                 MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                    8:0    1  57,3G  0 disk  
├─sda1                 8:1    1   512M  0 part  /boot/efi
├─sda2                 8:2    1   488M  0 part  /boot
└─sda3                 8:3    1  56,3G  0 part  
  └─sdb3_crypt       254:0    0  56,3G  0 crypt 
    ├─desktop--vg-root   254:1    0  55,3G  0 lvm   /
    └─desktop--vg-swap_1 254:2    0   980M  0 lvm   [SWAP]
nvme0n1              259:0    0 238,5G  0 disk  
└─nvme0n1p1          259:1    0 238,5G  0 part  /user/backup
I don't want that, for example /dev/mapper/desktop--vg-root,sdb3_crypt, sda3 no sda. But rather this here from the example sda, this is the root device, so I don't need this device in the output. #### MY DEVICES, MY SETUP:
NAME           SIZE      
sda            57.3G     
|-sda1         512M      
|-sda2         488M      
`-sda3         56.3G     
`-sdb3_crypt   56.3G     
`-desktop--vg-swap_1980M      
nvme0n1        238.5G    
`-nvme0n1p1    238.5G
**RESULT I NEED:**
NAME     SIZE
nvme0n1  238.5G
##### System setup Debian, lsblk and other information:
Operating System: Debian GNU/Linux 12 (bookworm)  
Kernel: Linux 6.1.0-22-amd64
Architecture: x86-64
lsblk from util-linux 2.38.1
$ apt-get install --only-upgrade util-linux

util-linux is already the newest version (2.38.1-5+deb12u3)
##### From @terdon RESULT:
(){ lsblk -o NAME,SIZE,MOUNTPOINT | awk '$NF!="/"{printf "%-15s%-10s\n", $1,$2}'; }
NAME           SIZE      
sda            57.3G     
|-sda1         512M      
|-sda2         488M      
`-sda3         56.3G     
`-sdb3_crypt   56.3G     
`-desktop--vg-swap_1980M      
nvme0n1        238.5G    
`-nvme0n1p1    238.5G
$ lsblk -o NAME,SIZE,MOUNTPOINT
NAME                   SIZE MOUNTPOINT
sda                   57.3G 
|-sda1                 512M /boot/efi
|-sda2                 488M /boot
`-sda3                56.3G 
  `-sdb3_crypt        56.3G 
    |-desktop--vg-root    55.3G /
    `-desktop--vg-swap_1  980M [SWAP]
nvme0n1              238.5G
$ lsblk -o NAME,SIZE,MOUNTPOINT | awk '$NF!="/"{printf "%-15s%-10s\n", $1,$2}';
NAME           SIZE      
sda            57.3G     
|-sda1         512M      
|-sda2         488M      
`-sda3         56.3G     
`-sdb3_crypt   56.3G     
`-desktop--vg-swap_1980M      
nvme0n1        238.5G
$ lsblk -o NAME,SIZE,MOUNTPOINT | awk '$NF=="/"' |-desktop--vg-root 55.3G / ##### From Chris Davies RESULT:
Root partition: mapper/desktop--vg-root
Root device: 
NAME      SIZE
sda      57.3G
nvme0n1 238.5G
##### From @muru: lsblk -d $(findmnt -no source /)
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
desktop--vg-root 254:1    0 55,3G  0 lvm  /
ReflectYourCharacter (8185 rep)
Mar 27, 2025, 01:50 PM • Last activity: Jun 29, 2025, 01:15 PM
5 votes
3 answers
1095 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 `n`th partition of this disk. It seems like this sort of thing should be possible with `lsblk`. The best I can come up with is: lsblk -nlpo NAME,TYPE /dev/DISK_NAME | awk '/part$/ {print $1}' | grep "[^0...
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 can come up with is: lsblk -nlpo NAME,TYPE /dev/DISK_NAME | awk '/part$/ {print $1}' | grep "[^0-9]n$" Here, the n in the last grep represents the partition number in question. The command above works for the arch linux machine I'm currently on, where DISK_NAME=sda and the output of lsblk -nlpo NAME,TYPE is /dev/sda disk /dev/sda1 part /dev/sda2 part /dev/sda3 part /dev/sda5 part My command also works on my arch linux machine where DISK_NAME=nvme0n1 and the output of lsblk -nlpo NAME,TYPE is /dev/nvme0n1 disk /dev/nvme0n1p1 part /dev/nvme0n1p2 part Still, this feels rather hacky, and I'm not sure if it would work on an arbitrary disk. Are there better ways to do this?
Brian Fitzpatrick (2907 rep)
Jun 11, 2021, 05:16 PM • Last activity: Jun 25, 2025, 11:39 AM
0 votes
1 answers
36 views
Exclude non hotplug from lsblk output
I use the following command to show my hotplug devices: ``` lsblk --paths --output NAME,MODEL,TRAN,FSUSE%,UUID,HOTPLUG --exclude 7 ``` To get the following rendering: ``` NAME MODEL TRAN FSUSE% UUID HOTPLUG /dev/sda MTFDDAV256MBF-1AN15ABHA sata 0 ├─/dev/sda1 0% 9587-2822 0 ├─/dev/sda2 e280adb5-9055-...
I use the following command to show my hotplug devices:
lsblk  --paths --output  NAME,MODEL,TRAN,FSUSE%,UUID,HOTPLUG  --exclude 7
To get the following rendering:
NAME        MODEL                   TRAN   FSUSE% UUID                                 HOTPLUG
/dev/sda    MTFDDAV256MBF-1AN15ABHA sata                                                     0
├─/dev/sda1                                    0% 9587-2822                                  0
├─/dev/sda2                                       e280adb5-9055-4b1a-80f2-f91fd03002b7       0
├─/dev/sda3                                       79217da2-63f5-4a35-a27d-9578e3ae714e       0
└─/dev/sda4                                   79% 0b6c042f-0900-40fd-9971-417a3ffaae9c       0
/dev/sdb    M3 Portable             usb                                                      1
└─/dev/sdb1                                       800c918f-82ec-4d2d-8cf5-e9773f10c54e       1
However my goal was just to show the hotplug devices (ie the ones marked as “1” on the “HOTPLUG” column) and not also the other disks (ie the /dev/sda) as you can see. ### What I tried #### The solution with grep Well, I can try to filter with grep like this:
lsblk  --paths --output  NAME,MODEL,TRAN,FSUSE%,UUID,HOTPLUG  --exclude 7 | grep "1$"
and it seems to work. But I wonder if their is something a bit less _hacky_, something more built-in #### The (unworking) solution with lsblk’s --exclude I also found the --exclude option and try somthing like:
LANG=en_GB lsblk --noheadings --paths --output  NAME,MODEL,TRAN,FSUSE%,UUID,HOTPLUG --exclude hotplug=0
But I just get “lsblk: failed to parse list 'hotplug=0'” ## The question Is their a cleaner solution to filter the not hotplug devices from lsblk’s output?
fauve (1529 rep)
Jun 5, 2025, 05:27 AM • Last activity: Jun 5, 2025, 10:59 AM
5 votes
2 answers
8287 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 have some issues related to making backups via backintime (see below). So I started to poke around an...
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 have some issues related to making backups via backintime (see below). So I started to poke around and see if I can find out anything but for some reason, I cannot see this drive with any of the commands mount, blkid or lsblk. So I am stuck. What can be the reason for this? The 'actual' issue at hand: This is a new 2TB drive I use for making backups but for some reason backintime keeps telling me that the disk is full at some point. This can't be true as I am trying to (partially) back up a disk that is only 1TB big and by no means full. When I try to do a fsck /home/bu/safe-heaven-2 on this disk, I get the following error: fsck.ext4: Unable to resolve 'UUID=a8286fc9-5b08-41d9-8c4e-cb993a8976d1' But as I wrote, I can read / write to this disk. I am totally confused :D Please help! Edit: Output of fdisk -l as requested: Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/mmcblk0: 14,9 GiB, 15931539456 bytes, 31116288 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x1ddfbf63 Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA) /dev/mmcblk0p2 532480 31116287 30583808 14,6G 83 Linux Disk /dev/sdb: 931,5 GiB, 1000170586112 bytes, 1953458176 sectors Disk model: Elements 10A8 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x07e93288 Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 1953458175 1953456128 931,5G 83 Linux
password is password (51 rep)
Oct 19, 2021, 05:04 PM • Last activity: Apr 18, 2025, 08:08 PM
0 votes
1 answers
77 views
Determine used space of a block device with no filesystem
How can I determine used space of a block device that has no filesystem on it? If it helps, such device is managed via `lvm`. I understand that the concept of "used space" on a device without filesystem isn't a term, but what I mean by "used space of a block device with no filesystem" is "number of...
How can I determine used space of a block device that has no filesystem on it? If it helps, such device is managed via lvm. I understand that the concept of "used space" on a device without filesystem isn't a term, but what I mean by "used space of a block device with no filesystem" is "number of blocks that differ from what was initially allocated when that block device was created". How can I calculate it? Maybe there is some daemon that supports this? Or is my concept of used space of a block device with no filesystem ill-formed and OS / hard-drives / SSD's may write some weird data to the block-device if there is no filesystem which would impact the measurement?
blonded04 (101 rep)
Apr 6, 2025, 05:46 PM • Last activity: Apr 6, 2025, 08:35 PM
2 votes
1 answers
80 views
lsblk can see all drives attached but udev only shows half of them. Conflicting indentifiers?
I'm trying to make a zfs pool on a terramaster D8 Hybrid DAS connected via USB with 4x HDD and 4x NVME drives using [this guide][1]. When i try to build the get the drive ids to build the zpool, not all of them are reported by `udev`. when i call lsblk i can see all of the drives in the das and the...
I'm trying to make a zfs pool on a terramaster D8 Hybrid DAS connected via USB with 4x HDD and 4x NVME drives using this guide . When i try to build the get the drive ids to build the zpool, not all of them are reported by udev. when i call lsblk i can see all of the drives in the das and the drive of the host pc:
ubuntu@ubuntu:~$ lsblk -d -o TRAN,NAME,TYPE,MODEL,SERIAL,SIZE
TRAN   NAME    TYPE MODEL     SERIAL               SIZE
       loop0   loop                               63.9M
       loop1   loop                                 64M
       loop2   loop                                 87M
       loop3   loop                                 87M
       loop4   loop                               49.8M
       loop5   loop                               38.8M
usb    sda     disk TDAS      800022304202         5.5T
usb    sdb     disk TDAS      800022304202         5.5T
usb    sdc     disk TDAS      A00022304202         5.5T
usb    sdd     disk TDAS      A00022304202         5.5T
usb    sde     disk D         0000000000000000   238.5G
usb    sdf     disk D         0000000000000000   238.5G
usb    sdg     disk D         0000000000000000   238.5G
usb    sdh     disk D         0000000000000000   238.5G
nvme   nvme0n1 disk 256GB SSD NJR368R008628P70GX 238.5G
But when i try to find the udev ids for the drives (needed to make the zpool), half of them are missing
ubuntu@ubuntu:~$ ls -lh /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 13 Sep 29 05:04 nvme-256GB_SSD_NJR368R008628P70GX -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep 29 05:04 nvme-256GB_SSD_NJR368R008628P70GX-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep 29 05:04 nvme-256GB_SSD_NJR368R008628P70GX-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 13 Sep 29 05:04 nvme-nvme.126f-4e4a52333638523030383632385037304758-323536474220535344-00000001 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Sep 29 05:04 nvme-nvme.126f-4e4a52333638523030383632385037304758-323536474220535344-00000001-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Sep 29 05:04 nvme-nvme.126f-4e4a52333638523030383632385037304758-323536474220535344-00000001-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root  9 Sep 29 05:04 scsi-1Realtek_RTL9220_1.010000000000000000 -> ../../sdf
lrwxrwxrwx 1 root root  9 Sep 29 05:04 scsi-33001237923792379 -> ../../sdh
lrwxrwxrwx 1 root root  9 Sep 29 05:41 scsi-35000000000000001 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep 29 05:04 scsi-S256GB_SS_D_0000000000000000 -> ../../sdh
lrwxrwxrwx 1 root root  9 Sep 29 05:41 scsi-STerraMas_TDAS_800022304202 -> ../../sdb
lrwxrwxrwx 1 root root  9 Sep 29 05:04 scsi-STerraMas_TDAS_A00022304202 -> ../../sdd
lrwxrwxrwx 1 root root  9 Sep 29 05:04 wwn-0x3001237923792379 -> ../../sdh
lrwxrwxrwx 1 root root  9 Sep 29 05:41 wwn-0x5000000000000001 -> ../../sdb
It almost seems like udev is unable to create unique ids for these drives that have the same SN? These drives are new but not from the most reputable manufacturer. They were sold as WD reds and hdparm confirms: SDA:
ubuntu@ubuntu:~$ sudo hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
	Model Number:       WDC WD60EFRX-68L0BN1                    
	Serial Number:      WD-WXK8A4P18EOR
SDB:
ubuntu@ubuntu:~$ sudo hdparm -I /dev/sdb

/dev/sdb:

ATA device, with non-removable media
	Model Number:       WDC WD60EFRX-68L0BN1                    
	Serial Number:      WD-WXK8A4P18ES6
Both SDA and SDB have different SN according to hdparm is the terramaster DAS breaking this uniqueness somehow? hdparm also shows that the drives both have different wwn but for some reason udev won't list by wwn?
ubuntu@ubuntu:~$ ls  /dev/disk/by-wwn
ls: cannot access '/dev/disk/by-wwn': No such file or directory
ubuntu@ubuntu:~$ sudo udevadm info --query=all --name=/dev/sda | grep -i wwn
S: disk/by-id/wwn-0x5000000000000001
E: ID_WWN_WITH_EXTENSION=0x5000000000000001
E: ID_WWN=0x5000000000000001
E: DEVLINKS=/dev/disk/by-path/pci-0000:00:14.0-usb-0:3.1:1.0-scsi-0:0:0:0 /dev/disk/by-id/wwn-0x5000000000000001 /dev/disk/by-id/scsi-35000000000000001 /dev/disk/by-id/scsi-STerraMas_TDAS_800022304202
ubuntu@ubuntu:~$ sudo udevadm info --query=all --name=/dev/sdb | grep -i wwn
S: disk/by-id/wwn-0x5000000000000001
E: ID_WWN_WITH_EXTENSION=0x5000000000000001
E: ID_WWN=0x5000000000000001
E: DEVLINKS=/dev/disk/by-id/scsi-35000000000000001 /dev/disk/by-id/wwn-0x5000000000000001 /dev/disk/by-path/pci-0000:00:14.0-usb-0:3.2:1.0-scsi-0:0:0:0 /dev/disk/by-id/scsi-STerraMas_TDAS_800022304202
DisplayName (21 rep)
Sep 29, 2024, 05:52 AM • Last activity: Mar 11, 2025, 02:23 PM
1 votes
0 answers
155 views
Why doesn't lsblk list the drive where Windows 11 is installed? (I can boot into Windows, so I know the drive is functional)
I used dd to write the SystemRescue ( https://www.system-rescue.org/ ) image to a USB stick drive. I used this USB stick to boot into Computer#1 and then used dd to clone the internal system drive to a second USB stick. I didn't have any problems. I put the SystemRescue USB stick into Computer#2 and...
I used dd to write the SystemRescue ( https://www.system-rescue.org/ ) image to a USB stick drive. I used this USB stick to boot into Computer#1 and then used dd to clone the internal system drive to a second USB stick. I didn't have any problems. I put the SystemRescue USB stick into Computer#2 and successfully booted into SystemRescue Linux. (There is nothing wrong with either computer, but I am using SystemRescue live Linux distro because as I understand it is inadvisable or impossible to attempt to make a raw binary clone of a drive with a presently mounted filesystem.) My plan was to clone the internal system drive of Computer#2, which has Windows 11 installed, to a third USB stick (as a backup in case I want to restore it later), and then clone what I had previously cloned to the second USB stick to the internal system drive of Computer#2, overwriting Windows 11. All of this would be accomplished with dd via the SystemRescue live Linux distro. The problem I am having is that I cannot complete the steps mentioned in the immediately preceding paragraph because the internal drive of Computer#2 that has Windows 11 on it does not show up when I type lsblk. I also tried lsblk -a. I also tried turning off Windows 11 Fast Startup in case that might be causing problems. I still can't get the drive to show in the lsblk list. (I did not attempt to mount anything because as I understand I do not need to if I am doing a raw binary copy with dd.) lsblk does show a second internal drive of Computer#2, but it's not the right one (it's 512GB instead of the 256GB drive that Win11 is on). The computer has two internal drives: the first of them is an SSD with Windows 11, and the other is an old-style HDD; but lsblk only shows the 2nd one. (lsblk also lists a 32GB USB stick, but Win11 is definitely not on there.) I know that the Windows 11 drive is functional because I can still boot into Windows 11. The Windows drive is listed as "NVMe INTEL" by Windows system info; it's 256GB. There is also a 2nd internal drive that's 512GB, "TOSHIBA". During the boot of SystemRescue on Computer #2, it shows the message: "A start job is running for /dev/tpmrm0", which times out after 90 seconds. But other than that the boot seems normal. Computer #2 is an old Dell computer, OptiPlex 3050, Intel Core i5, 7th gen. The Linux distro on the USB stick is "systemrescue-11.03-amd64.iso". Is it a problem with drivers? Or a problem with Windows DRM? Would I have better luck using a different Linux distribution? I just need something that can see the drive and run dd. I need to be able to type something for the dd parameter if=, so it's problematic that lsblk won't list the name of the device, "/dev/???". lsblk -a -o name,label,size,fstype,model loop0 854M squashfs sda 465G TOSHIBA Update: The comment from @frostschutz told me to check dmesg, where I found some messages that said that I should change from RAID to AHCI in the BIOS settings. After I did that, the drive now shows up as "nvme0n1".
Robert Jenkins (11 rep)
Feb 15, 2025, 01:20 PM • Last activity: Feb 15, 2025, 03:36 PM
1 votes
2 answers
58 views
The ambiguous principles that guide the lsblk utility in removing duplicates of displayed records
Linux Mint 20.3 > lsblk -V > > lsblk from util-linux 2.34 Let's find an explanation for the ambiguous behavior of the **lsblk** utility applied with the *-E* option. Here is the output without applying the *-E* option. You can see that there are repeated entries in the SIZE column. These are (loop0...
Linux Mint 20.3 > lsblk -V > > lsblk from util-linux 2.34 Let's find an explanation for the ambiguous behavior of the **lsblk** utility applied with the *-E* option. Here is the output without applying the *-E* option. You can see that there are repeated entries in the SIZE column. These are (loop0 loop2) and (loop6 loop10). greg@mynt23:~$ lsblk -o NAME,SIZE NAME SIZE loop0 164,8M loop1 4K loop2 164,8M loop3 55,4M loop4 73,9M loop5 66,2M loop6 449M loop7 91,7M loop8 44,4M loop9 40,9M loop10 449M loop11 74,1M loop12 55,7M sda 298,1G ├─sda1 4,9G ├─sda2 104,2G └─sda3 189,1G Now apply the *-E* option. greg@mynt23:~$ lsblk -o NAME,SIZE -E SIZE NAME SIZE loop1 4K loop3 55,4M loop4 73,9M loop5 66,2M loop7 91,7M loop8 44,4M loop9 40,9M loop11 74,1M loop12 55,7M sda 298,1G ├─sda1 4,9G ├─sda2 104,2G └─sda3 189,1G The repeated entries from the SIZE column disappeared completely, instead leaving one "original" entry. The entries left should have been loop0 and loop6. Apply RM or TYPE as a key. You will see that all duplicates are removed, but the "original" entry is left. The manual says that duplicates are removed, not duplicates along with what the duplicates duplicate. How do we explain it?
Kiki Miki (27 rep)
Feb 5, 2025, 12:13 AM • Last activity: Feb 5, 2025, 11:22 AM
-1 votes
1 answers
49 views
The concept of holder in the context of the lsblk utility action
The description for the *-d* option of the **lsblk** utility says the following: > -d, --nodeps Do not print holder devices or slaves. For example, lsblk --nodeps /dev/sda prints information about the sda device only. The result is the output of the /dev/sda device, which is the holder for the /dev/...
The description for the *-d* option of the **lsblk** utility says the following: > -d, --nodeps Do not print holder devices or slaves. For example, lsblk --nodeps /dev/sda prints information about the sda device only. The result is the output of the /dev/sda device, which is the holder for the /dev/sda1 and /dev/sda2 devices. Is there something wrong with my understanding of the concept of holder?
Kiki Miki (27 rep)
Feb 3, 2025, 06:42 AM • Last activity: Feb 3, 2025, 10:02 AM
0 votes
4 answers
2626 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 ├─sda1 xfs └─sda2 LVM2_member ├─vg-LV_root xfs ├─vg-LV_swap swap ├─vg-LV_var xfs └─vg-LV_docker xfs sdb ext4 sdc...
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 ├─sda1 xfs └─sda2 LVM2_member ├─vg-LV_root xfs ├─vg-LV_swap swap ├─vg-LV_var xfs └─vg-LV_docker xfs sdb ext4 sdc ext4 sdd ext4 sde so we try the following command in order to capture the disks without FS lsblk -o NAME,FSTYPE | awk '$2 == "" { print $0 }' and we get sda sde as we can see from above sda disk printed , but sda is the OS disk , so command line not gives the right output right output should be : sde any suggestion or other approach to gives the right output? lsblk -oNAME,FSTYPE,FSTYPE --noheadings --nodeps sda sdb ext4 ext4 sdc ext4 ext4 sdd ext4 ext4 sde
yael (13936 rep)
Jul 24, 2022, 08:27 AM • Last activity: Oct 7, 2024, 08:03 AM
0 votes
0 answers
97 views
External luks encrypted hard drive is mounted but sometimes no longer shows on lsblk?
I have an old linux laptop being used as a home server. It runs a bunch of docker containers basically. I have an external luks encrypted hard drive connected to the laptop which is mounted and luks is opened with a script. The docker containers use a docker mount to the same mounted location so tha...
I have an old linux laptop being used as a home server. It runs a bunch of docker containers basically. I have an external luks encrypted hard drive connected to the laptop which is mounted and luks is opened with a script. The docker containers use a docker mount to the same mounted location so that essentially files are saved to my external hard drive from my docker containers. I decrypt and open / mount the drive like so:
sudo cryptsetup luksOpen --key-file=$KEY_FILE UUID=$DRIVE_UUID $PARTITION_NAME
sudo mount /dev/mapper/$PARTITION_NAME /mnt/storage
The result of lsblk -o NAME,KNAME,UUID,FSTYPE,TYPE,MOUNTPOINT,SIZE shows below. sdc sdc disk 10.9T |-sdc1 sdc1 67E3-17ED vfat part 200M |-sdc2 sdc2 91c4ccef-ebf2-4976-8c93-93d48340022b apfs part 465.7G `-sdc3 sdc3 0d8b7631-030b-4e29-9eb4-079566c114a6 crypto_LUKS part 10.5T `-seagate-external-hd-123 dm-2 f21491cc-ce4e-420d-8a76-585ea5fd57ab ext4 crypt /mnt/storage 10.5T However after a long while (few days to maybe couple weeks?) I notice in my logs that the result of the same lsblk command now shows: sdc sdc disk 10.9T |-sdc1 sdc1 67E3-17ED vfat part 200M |-sdc2 sdc2 91c4ccef-ebf2-4976-8c93-93d48340022b apfs part 465.7G `-sdc3 sdc3 0d8b7631-030b-4e29-9eb4-079566c114a6 crypto_LUKS part 10.5T However when running ls -lah /mnt/storage I do in fact see the data in the hard drive. What's going on? Why does lsblk no longer show the mount point? Will writing to that mount point still make it to my hard drive? Also, what's the proper way to determine that an encrypted hard drive is open and mounted if I can't just use lsblk? My script is run on a cron job because for some reason, after some extended period, the external hard drive mount would get unmounted. If the script detects that it tries to luksopen and mount. However the script was detecting whether luks was open based on seeing the $LUKS_UUID in lsblk command and now it seems that is not a reliable way to detect the drive is open. What is the proper way to determine if I can access it? Is it as simple as just checking df -h | grep /mnt/storage ? It's not clear to me if that is enough to say the drive is actually open / unencrypted / usable so I was originally using the lsblk command.
Terence Chow (211 rep)
Oct 2, 2024, 04:23 AM
0 votes
1 answers
49 views
how to provide the device name that related to LVM2_member
LVM2_member could be different according to device partition number example lsblk -f | grep LVM2_member | awk '{print $1}' └─sda3 or on other redhat machine lsblk -f | grep LVM2_member | awk '{print $1}' └─sda2 how to capture sdaX device without the line "└─" , or maybe other approach to capture OS...
LVM2_member could be different according to device partition number example lsblk -f | grep LVM2_member | awk '{print $1}' └─sda3 or on other redhat machine lsblk -f | grep LVM2_member | awk '{print $1}' └─sda2 how to capture sdaX device without the line "└─" , or maybe other approach to capture OS device that related to LVM2_member view from lsblk -f lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT sda ├─sda1 vfat E7D6-EC08 /boot/efi ├─sda2 xfs 1d74a8b2-9226-45cf-aa90-f9c9783a9a57 /boot └─sda3 LVM2_member eRpqzd-o7UM-ruPb-2xU3-QUAW-EswH-PzsSZE ├─VG00-lvv_root xfs e0cfac88-be2e-41e4-8163-da3ef0fcb98c / ├─VG00-lvv_swap swap 91341494-85f3-4300-9f66-68922c39418b [SWAP] └─VG00-lvv_var xfs 92cc4e1a-23a4-40ac-ae5d-b0d884bfdeeb /var
yael (13936 rep)
Aug 4, 2024, 01:34 PM • Last activity: Aug 4, 2024, 05:56 PM
1 votes
1 answers
1501 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 without file system as the following lsblk -f sde ext4 20eba791-c9c9-4462-aa23-74c40a41b8a0 but in spite...
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 without file system as the following lsblk -f sde ext4 20eba791-c9c9-4462-aa23-74c40a41b8a0 but in spite we erase the filesystem , lsblk still show the ext4 filesystem on sde disk
yael (13936 rep)
Jun 13, 2022, 10:05 AM • Last activity: Jul 17, 2024, 11:40 AM
2 votes
1 answers
118 views
fstab, mountpoint - what did I miss?
I can't figure out what I'm missing or done wrong. `lsblk` dose not show the mount points(?) ``` NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 1.8T 0 disk └─sda1 8:1 0 1.8T 0 part sdb 8:16 1 119.1G 0 disk └─sdb1 8:17 1 119.1G 0 part nvme0n1 259:0 0 238.5G 0 disk ├─nvme0n1p1 259:1 0 512M 0 part...
I can't figure out what I'm missing or done wrong. lsblk dose not show the mount points(?)
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   1.8T  0 disk
└─sda1        8:1    0   1.8T  0 part
sdb           8:16   1 119.1G  0 disk
└─sdb1        8:17   1 119.1G  0 part
nvme0n1     259:0    0 238.5G  0 disk
├─nvme0n1p1 259:1    0   512M  0 part /boot/firmware
└─nvme0n1p2 259:2    0 118.6G  0 part /
**Meanwhile services *such as SMB/SAMBA* dependent on those disk/drivs being mounted are working as intended!** so I have to do a sudo mount -a after each startup.. here is the output from lsblk after doing so
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   1.8T  0 disk
└─sda1        8:1    0   1.8T  0 part /mnt/Pi5-NAS
sdb           8:16   1 119.1G  0 disk
└─sdb1        8:17   1 119.1G  0 part /mnt/Backup
nvme0n1     259:0    0 238.5G  0 disk
├─nvme0n1p1 259:1    0   512M  0 part /boot/firmware
└─nvme0n1p2 259:2    0 118.6G  0 part /
**Could this be cause of the subfolders (aka the *Mountpoints*) within /mnt/ are not owned by root?** **ls -l / ; ls -l /mnt/**
total 64
lrwxrwxrwx   1 root root     7 Mar 15 15:59 bin -> usr/bin
drwxr-xr-x   4 root root  4096 Apr 27 16:55 boot
drwxr-xr-x  17 root root  4380 May  4 14:27 dev
drwxr-xr-x  97 root root  4096 May  4 15:17 etc
drwxr-xr-x   3 root root  4096 Mar 15 16:00 home
lrwxrwxrwx   1 root root     7 Mar 15 15:59 lib -> usr/lib
drwx------   2 root root 16384 Mar 15 16:08 lost+found
drwxr-xr-x   2 root root  4096 Mar 15 15:59 media
drwxr-xr-x   4 root root  4096 May  4 03:08 mnt
drwxr-xr-x   4 root root  4096 May  2 00:03 opt
dr-xr-xr-x 214 root root     0 May  4 14:27 proc
drwx------   5 root root  4096 May  4 00:21 root
drwxr-xr-x  25 root root   740 May  4 14:42 run
lrwxrwxrwx   1 root root     8 Mar 15 15:59 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Mar 15 15:59 srv
dr-xr-xr-x  12 root root     0 May  4 14:27 sys
drwxrwxrwt   9 root root  4096 May  4 16:01 tmp
drwxr-xr-x   5 root root  4096 Apr 30 10:38 uhubctl
drwxr-xr-x  11 root root  4096 Mar 15 15:59 usr
drwxr-xr-x  11 root root  4096 Apr 27 16:53 var
total 8
drwxr-xr-x 3 pi pi 4096 May  4 02:57 Backup
drwxr-xr-x 3 pi pi 4096 May  3 23:07 Pi5-NAS
**cat /etc/fstab**
proc            /proc           proc    defaults          0       0
PARTUUID=3986f1d4-01  /boot/firmware  vfat    defaults          0       2
PARTUUID=3986f1d4-02  /               ext4    defaults,noatime  0       1
PARTUUID=417eda08-9bf8-3445-ad9c-3bd49168c167 /mnt/Pi5-NAS ext4 defaults 0 0
PARTUUID=b3a9a096-86af-324a-8347-6d8d5765b789 /mnt/Backup ext4 defaults 0 0
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
**Here is all the outputs I could think of posting in this regard.. and all of these outputs below are before running** sudo mount -a. **sudo ls -l /dev/sd*; sudo ls -l /dev/nvme***
brw-rw---- 1 root disk 8,  0 May  4 14:27 /dev/sda
brw-rw---- 1 root disk 8,  1 May  4 14:27 /dev/sda1
brw-rw---- 1 root disk 8, 16 May  4 14:27 /dev/sdb
brw-rw---- 1 root disk 8, 17 May  4 14:27 /dev/sdb1
crw------- 1 root root 245, 0 May  4 14:27 /dev/nvme0
brw-rw---- 1 root disk 259, 0 May  4 14:27 /dev/nvme0n1
brw-rw---- 1 root disk 259, 1 May  4 14:27 /dev/nvme0n1p1
brw-rw---- 1 root disk 259, 2 May  4 14:27 /dev/nvme0n1p2
**lsblk -S -p**
NAME     HCTL       TYPE VENDOR   MODEL      REV SERIAL           TRAN
/dev/sda 1:0:0:0    disk WD Blue  SN580 2TB 0    240205804034     usb
/dev/sdb 0:0:0:0    disk SanDisk  SDDR-B531 2920 0719220000001828 usb
**lsblk -P -p**
NAME="/dev/sda" MAJ:MIN="8:0" RM="0" SIZE="1.8T" RO="0" TYPE="disk" MOUNTPOINTS=""
NAME="/dev/sda1" MAJ:MIN="8:1" RM="0" SIZE="1.8T" RO="0" TYPE="part" MOUNTPOINTS=""
NAME="/dev/sdb" MAJ:MIN="8:16" RM="1" SIZE="119.1G" RO="0" TYPE="disk" MOUNTPOINTS=""
NAME="/dev/sdb1" MAJ:MIN="8:17" RM="1" SIZE="119.1G" RO="0" TYPE="part" MOUNTPOINTS=""
NAME="/dev/nvme0n1" MAJ:MIN="259:0" RM="0" SIZE="238.5G" RO="0" TYPE="disk" MOUNTPOINTS=""
NAME="/dev/nvme0n1p1" MAJ:MIN="259:1" RM="0" SIZE="512M" RO="0" TYPE="part" MOUNTPOINTS="/boot/firmware"
NAME="/dev/nvme0n1p2" MAJ:MIN="259:2" RM="0" SIZE="118.6G" RO="0" TYPE="part" MOUNTPOINTS="/"
**mount**
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3950848k,nr_inodes=246928,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=824576k,mode=755)
/dev/nvme0n1p2 on / type ext4 (rw,noatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=4444)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/nvme0n1p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=824560k,nr_inodes=206140,mode=700,uid=1000,gid=1000)
**sudo fdisk -x**
Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: THNSN5256GPU7 TOSHIBA
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3986f1d4

Device         Boot   Start       End   Sectors Id Type            Start-C/H/S   End-C/H/S Attrs
/dev/nvme0n1p1         8192   1056767   1048576  c W95 FAT32 (LBA)      64/0/1   1023/3/32
/dev/nvme0n1p2      1056768 249737215 248680448 83 Linux             1023/3/32 1023/127/63


Disk /dev/sdb: 119.08 GiB, 127865454592 bytes, 249737216 sectors
Disk model: SDDR-B531
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: EF6D1978-32E1-0E40-9979-AFFB0436BABC
First usable LBA: 2048
Last usable LBA: 249737182
Alternative LBA: 249737215
Partition entries starting LBA: 2
Allocated partition entries: 128
Partition entries ending LBA: 33

Device     Start       End   Sectors Type-UUID                            UUID                                 Name Attrs
/dev/sdb1   2048 249737182 249735135 0FC63DAF-8483-4772-8E79-3D69D8477DE4 B3A9A096-86AF-324A-8347-6D8D5765B789


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: SN580 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: 6A12D386-0B82-5243-9A71-4CABBDF2B271
First usable LBA: 2048
Last usable LBA: 3907029134
Alternative LBA: 3907029167
Partition entries starting LBA: 2
Allocated partition entries: 128
Partition entries ending LBA: 33

Device     Start        End    Sectors Type-UUID                            UUID                                 Name Attrs
/dev/sda1   2048 3907028991 3907026944 0FC63DAF-8483-4772-8E79-3D69D8477DE4 417EDA08-9BF8-3445-AD9C-3BD49168C167
**I don't know if this is necessary but if so:** SBC: Raspberry Pi 5 - OS: Raspberry Pi OS Lite - System: 64-bit Kernel version: 6.6 - Distribution: Debian version: 12 (bookworm)
Arelius (83 rep)
May 4, 2024, 02:32 PM • Last activity: May 7, 2024, 04:05 PM
0 votes
0 answers
102 views
Block size output from lsblk and blockdev don't match
- Why the output of LOG-SEC column and `--getbsz` in the following don't match? Are these values of different quantities? How to find actual values? And is the output of following stat command always equal to ` blockdev --getbsz`? ``` $ sudo lsblk -o NAME,PHY-SeC,LOG-SEC,FSTYPE NAME PHY-SEC LOG-SEC...
- Why the output of LOG-SEC column and --getbsz in the following don't match? Are these values of different quantities? How to find actual values? And is the output of following stat command always equal to blockdev --getbsz?
$ sudo lsblk -o NAME,PHY-SeC,LOG-SEC,FSTYPE
NAME                     PHY-SEC LOG-SEC FSTYPE
zram0                       4096    4096 
nvme0n1                      512     512 
├─nvme0n1p1                  512     512 ext4
├─nvme0n1p2                  512     512 ext4
├─nvme0n1p3                  512     512 ext4
├─nvme0n1p4                  512     512 vfat
└─nvme0n1p5                  512     512 LVM2_member
  ├─vgubuntu-FedoraRoot      512     512 ext4
  ├─vgubuntu-FedoraSwap      512     512 swap
  ├─vgubuntu-UbuntuSwap      512     512 swap
  ├─vgubuntu-UbuntuRoot      512     512 ext4
  ├─vgubuntu-UbuntuHome      512     512 ext4
  ├─vgubuntu-FedoraHome      512     512 ext4
  ├─vgubuntu-Data            512     512 ext4
  ├─vgubuntu-Documents       512     512 ext4
  ├─vgubuntu-Media           512     512 ext4
  ├─vgubuntu-Backup          512     512 ext4
  └─vgubuntu-SecureCrypt     512     512 crypto_LUKS
    └─Secure                 512     512 ext4
$ sudo blockdev --getbsz /dev/vgubuntu/Data 
4096
$ sudo blockdev --getpbsz /dev/vgubuntu/Data 
512
Also,
$ stat -fc %s .
4096
From man page - --getbsz: Print the blocksize in bytes. This size does not describe device topology. It's the size used internally by the kernel and it may be modified (for example) by filesystem driver on mount. - --getpbsz: Get physical block (sector) size.
Porcupine (2156 rep)
Apr 7, 2024, 08:44 PM • Last activity: Apr 7, 2024, 08:54 PM
0 votes
1 answers
84 views
Extending rootfs on centos
so I can see in lsblk that I have a 250G disk, but when I run pvresize /dev/sda3 I am not able to see the free space to extend the volume group. Do I need to modify the partition table in single user mode since this is the root filesystem? On a similar system, I was able to run pvresize, vgextend, l...
so I can see in lsblk that I have a 250G disk, but when I run pvresize /dev/sda3 I am not able to see the free space to extend the volume group. Do I need to modify the partition table in single user mode since this is the root filesystem? On a similar system, I was able to run pvresize, vgextend, lvresize and then resize2fs enter image description here enter image description here
Joe (3 rep)
Feb 13, 2024, 07:56 PM • Last activity: Feb 13, 2024, 11:22 PM
0 votes
1 answers
430 views
Subpartition inside partiton not showed in lsblk or /dev/
I installed archlinux inside my /dev/sdb4 and used the guided partition scheme. After install i can't mount /dev/sdb4 (ext4). The error was `VFS: Can't find ext4 filesystem`. lsblk shows me: sdb 8:16 0 931,5G 0 disk ├─sdb1 8:17 0 512M 0 part /boot/efi ├─sdb2 8:18 0 768,3G 0 part / ├─sdb3 8:19 0 62,7...
I installed archlinux inside my /dev/sdb4 and used the guided partition scheme. After install i can't mount /dev/sdb4 (ext4). The error was VFS: Can't find ext4 filesystem. lsblk shows me: sdb 8:16 0 931,5G 0 disk ├─sdb1 8:17 0 512M 0 part /boot/efi ├─sdb2 8:18 0 768,3G 0 part / ├─sdb3 8:19 0 62,7G 0 part [SWAP] └─sdb4 8:20 0 100G 0 part but fdisk -l: Gerät Boot Anfang Ende Sektoren Größe Kn Typ /dev/sdb4p1 * 6144 421887 415744 203M b W95 FAT32 /dev/sdb4p2 522240 209418239 208896000 99,6G 83 Linux The installer created two subpartitions inside the partition. A partition table on /dev/sdb4 Now i try to mount those partition: sudo mount /dev/sdb4p1 /mnt mount: /mnt: Spezialgerät /dev/sdb4p1 ist nicht vorhanden. dmesg(1) könnte nach einem fehlgeschlagenen mount-Systemaufruf weitere Informationen liefern. i cant. Obviously /dev/sdb4p1 doesn't exist. What should i do?
cat Man (88 rep)
Feb 10, 2024, 12:54 PM • Last activity: Feb 10, 2024, 06:27 PM
7 votes
5 answers
19775 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 some other devices that need to filter them by **grep -v** what other disk devices that could be a...
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 some other devices that need to filter them by **grep -v** what other disk devices that could be appears from **lsblk | grep disk** and not really disks ? lsblk | grep disk fd0 2:0 1 4K 0 disk sda 8:0 0 100G 0 disk sdb 8:16 0 2G 0 disk /Kol sdc 8:32 0 2G 0 disk sdd 8:48 0 2G 0 disk sde 8:64 0 2G 0 disk sdf 8:80 0 2G 0 disk lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 150G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 149.5G 0 part ├─vg00-yv_root 253:0 0 19.6G 0 lvm / ├─vg00-yv_swap 253:1 0 15.6G 0 lvm [SWAP] └─vg00-yv_var 253:2 0 100G 0 lvm /var sdb 8:16 0 2G 0 disk /Kol sdc 8:32 0 2G 0 disk sdd 8:48 0 2G 0 disk sde 8:64 0 2G 0 disk sdf 8:80 0 2G 0 disk sr0 11:0 1 1024M 0 rom
yael (13936 rep)
Jan 2, 2018, 02:03 PM • Last activity: Jan 31, 2024, 12:23 PM
0 votes
2 answers
211 views
Why the output of lsblk have almost the same lines?
lsblk -d -o NAME,SIZE,TYPE | grep disk show me the such things sda 894.3G disk sdb 894.3G disk sdc 3.7T disk sdd 3.7T disk nbd0 64G disk Are the `sda` and `sdc` have `sdb` and `sdd` similarly physical devices? Either they're "physical" and "logical" devices? It's not my own server, so I cannot see i...
lsblk -d -o NAME,SIZE,TYPE | grep disk show me the such things sda 894.3G disk sdb 894.3G disk sdc 3.7T disk sdd 3.7T disk nbd0 64G disk Are the sda and sdc have sdb and sdd similarly physical devices? Either they're "physical" and "logical" devices? It's not my own server, so I cannot see its specifications. The server was deployed without my participation.
palmasd1 (127 rep)
Jan 30, 2024, 10:11 AM • Last activity: Jan 30, 2024, 12:38 PM
0 votes
1 answers
322 views
lsblk: Why FSSIZE is not equal to FSAVAIL + FSUSED
``` sudo lsblk --fs -o NAME,FSTYPE,SIZE,FSSIZE,FSUSED,FSAVAIL,FSUSE%,MOUNTPOINTS,LABEL,PATH | grep -v '^loop' NAME FSTYPE SIZE FSSIZE FSUSED FSAVAIL FSUSE% MOUNTPOINTS LABEL PATH zram0 8G [SWAP] /dev/zram0 nvme0n1 1.8T /dev/nvme0n1 ├─nvme0n1p1 ext4 768M /dev/nvme0n1p1 ├─nvme0n1p2 ext4 768M 738.4M 24...
sudo lsblk --fs -o NAME,FSTYPE,SIZE,FSSIZE,FSUSED,FSAVAIL,FSUSE%,MOUNTPOINTS,LABEL,PATH | grep -v '^loop'

NAME                    FSTYPE       SIZE FSSIZE FSUSED FSAVAIL FSUSE% MOUNTPOINTS    LABEL          PATH
zram0                                  8G                              [SWAP]                        /dev/zram0
nvme0n1                              1.8T                                                            /dev/nvme0n1
├─nvme0n1p1             ext4         768M                                                            /dev/nvme0n1p1
├─nvme0n1p2             ext4         768M 738.4M 240.9M  443.8M    33% /boot          FedoraBoot     /dev/nvme0n1p2
├─nvme0n1p3             ext4         768M                                             UnassignedBoot /dev/nvme0n1p3
├─nvme0n1p4             vfat         128M 127.7M  22.4M  105.3M    18% /boot/efi      EFI-SP         /dev/nvme0n1p4
└─nvme0n1p5             LVM2_member  1.8T                                                            /dev/nvme0n1p5
  ├─vgubuntu-FedoraRoot ext4         100G  98.1G  47.9G   45.2G    49% /              FedoraRoot     /dev/mapper/vgubuntu-FedoraRoot
  ├─vgubuntu-FedoraSwap swap          32G                              [SWAP]                        /dev/mapper/vgubuntu-FedoraSwap
  ├─vgubuntu-UbuntuSwap swap          32G                                                            /dev/mapper/vgubuntu-UbuntuSwap
  ├─vgubuntu-UbuntuRoot ext4          50G                                                            /dev/mapper/vgubuntu-UbuntuRoot
  ├─vgubuntu-UbuntuHome ext4          18G                                                            /dev/mapper/vgubuntu-UbuntuHome
  ├─vgubuntu-FedoraHome ext4          18G  17.5G   6.5G   10.1G    37% /home          FedoraHome     /dev/mapper/vgubuntu-FedoraHome
  ├─vgubuntu-Data       ext4         100G  98.1G    82G   11.6G    84% /mnt/Data      Data           /dev/mapper/vgubuntu-Data
  ├─vgubuntu-Documents  ext4         250G   245G 208.5G     24G    85% /mnt/Documents Documents      /dev/mapper/vgubuntu-Documents
  ├─vgubuntu-Media      ext4         500G 491.1G 331.2G  134.8G    67% /mnt/Media     Media          /dev/mapper/vgubuntu-Media
  └─vgubuntu-Backup     ext4         100G  97.9G   9.1G   83.7G     9% /mnt/Backup    Backup         /dev/mapper/vgubuntu-Backup
Porcupine (2156 rep)
Jan 7, 2024, 06:32 PM • Last activity: Jan 7, 2024, 06:43 PM
Showing page 1 of 20 total questions