- Thread Starter
- #101
I'm on securelevel 1
It's not giving the error on ada0 (though there seems to be some information missing), it does get a permission error on ada1. What's the difference of these disks?Code:> lsblk DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT ada0 0:108 466G - - - diskinfo: /dev/ada1: Permission denied
# READ PARTITIONS OF PROVIDER
local GPART=$( gpart show -p ${DEV} 2> /dev/null | sed -E 's-\[.*\]--g' | sed 's|=>||g' )
# PARSE gpart(8) OUTPUT
echo "${GPART}" \
| while read BEG END NAME TYPE SIZE SIZE_FREE
do
gpart show -p .... output. So everything gets shifted because it reads one value too many.kern.securelevel : -1vermaden there's something wrong with lsblk lately.
Firstly, it started demanding root credentials to display disk sizes.
Secondly, it no longer displays partition sizes, it just prints the entire device size per each partition. (if the device size is 16G, then it'll just say 16G for each individual partition on that device).
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
mmcsd0 0:78 59G MBR - -
<FREE> -:- 993K - - -
mmcsd0s1 0:79 59G fat32lba msdosfs/EFI /boot/efi
mmcsd0s2 0:80 59G BSD gpt/freebsd -
<FREE> -:- 64K - - -
mmcsd0s2a 0:83 53G freebsd-ufs ufs/rootfs /
mmcsd0s2b 0:84 5.9G freebsd-swap label/growfs_swap SWAP
<FREE> -:- 2.0M -
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
nda0 0:82 954G GPT - -
nda0p1 0:84 954G efi gpt/efi /boot/efi
nda0p2 0:86 954G freebsd-ufs gpt/freebsd-ufs /
nda0p3 0:88 954G freebsd-swap gpt/freebsd-swap SWAP
operator group, on the systems where it doesn't work the account wasn't added to operator. That makes sense, permissions on the device give the operator group read access.That's a recent change? It was working fine for me before without the user being part of the operator group.Hmm, think I might know why diskinfo(8) works for me on some systems but not others. On the systems where it works my user is a member of theoperatorgroup, on the systems where it doesn't work the account wasn't added tooperator. That makes sense, permissions on the device give theoperatorgroup read access.
Yeah, something is going on with partition size reporting.Seems odd with 59G on EFI (pretty sure a 64GB SD card) on 15.1:
Code:DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT mmcsd0 0:78 59G MBR - - <FREE> -:- 993K - - - mmcsd0s1 0:79 59G fat32lba msdosfs/EFI /boot/efi mmcsd0s2 0:80 59G BSD gpt/freebsd - <FREE> -:- 64K - - - mmcsd0s2a 0:83 53G freebsd-ufs ufs/rootfs / mmcsd0s2b 0:84 5.9G freebsd-swap label/growfs_swap SWAP <FREE> -:- 2.0M -
Was more odd on CURRENT a few weeks ago:
Code:DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT nda0 0:82 954G GPT - - nda0p1 0:84 954G efi gpt/efi /boot/efi nda0p2 0:86 954G freebsd-ufs gpt/freebsd-ufs / nda0p3 0:88 954G freebsd-swap gpt/freebsd-swap SWAP
Looked at 14.3, 14.4, 15.0 and 15.1, it's all the same, operator group has read access on the device node. Don't have anything older anymore, but I suspect it to be the same on 13 too.That's a recent change?
Who's gonna file the bug report?Yeah, partition size reporting has errors. I've seen this even with release 15.0
$ gpart show -p
=> 40 500118112 nda0 GPT (238G)
40 532480 nda0p1 efi (260M)
532520 490201088 nda0p2 freebsd-ufs (234G)
490733608 8388608 nda0p3 freebsd-swap (4.0G)
499122216 995936 - free - (486M)
$ lsblk
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
nda0 0:108 238G GPT - -
nda0p1 0:110 238G efi gpt/efiboot0 /boot/efi
nda0p2 0:112 238G freebsd-ufs gpt/root0 /
nda0p3 0:114 238G freebsd-swap gpt/swap0 -
<FREE> -:- 486M -
Add yourself to the operator group - then You will have read permission for disk devices in /dev and will be able to use lsblk(8) as regular user.Recently...mmm, maybe starting a couple of months ago.
> lsblk
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
ada0 0:108 466G - - -
diskinfo: /dev/ada1: Permission denied
And it used to show size of each partition, if I'm not mistaken. Even in some outputs in this thread I seen that.
% ls -l /dev/nda*
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda0
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda0p1
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda0p2
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda0p3
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda0p4
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda0p4.eli
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda1
crw-r----- root operator 0 B 2026/07/20 22:02 /dev/nda1p1
crw-r----- root operator 0 B 2026/07/20 22:03 /dev/nda1p1.eli
Why do you want to run lsblk? gpart gives you everything you need (also, major:minor numbers that lsblk reports is not of much use if any on freebsd. Originally major was used as an index into a blockdev or chardev table when drivers were compiled in. Originally the operator group was to allow any one in the operator to mount/unmount disk/tapes and not much else. You certainly can add yourself to the operator group on your own machine).Is it safe to add yourself to the operator group, especially just to run lsblk?
Vermaden, lsblk sum of partition sizes presented + free does not add up to total disk size as it should.
% gpart show nda0
=> 40 1000215136 nda0 GPT (477G)
40 532480 1 efi (260M)
532520 1024 2 freebsd-boot (512K)
533544 984 - free - (492K)
534528 4194304 3 freebsd-swap (2G)
4728832 995485696 4 freebsd-zfs (475G)
1000214528 648 - free - (324K)
% lsblk nda0
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
nda0 0:95 477G GPT - -
nda0p1 0:97 477G efi gpt/efiboot0 -
nda0p2 0:99 477G freebsd-boot gpt/gptboot0 -
<FREE> -:- 492K - - -
nda0p3 0:101 477G freebsd-swap gpt/swap0 -
nda0p4 0:103 477G freebsd-zfs gpt/freebsd-zfs <ZFS>
nda0p4.eli 0:110 477G zfs - -
<FREE> -:- 324K - - -