A possible bug. In as few words as possible: 1. I modified the GPT of a hard disk drive, whilst it was at da0 – attention to a freebsd-swap partition, da0p3 2. with the hard disk drive later at da4, there appears to be residual information at da0. ---- % lsblk da0 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da0 0:194 0B freebsd-swap - SWAP % geom disk list da0 Geom name: da0 Providers: 1. Name: da0 Mediasize: 0 (0B) Sectorsize: 512 Mode: r0w0e0 descr: Generic USB SD Reader ident: 058F312D81B rotationrate: unknown fwsectors: 0 fwheads: 0 % freebsd-version -kru 14.0-CURRENT 14.0-CURRENT 14.0-CURRENT % uname -KU 1400030 1400030 % pkg info -x lsblk lsblk-3.6 %
Hi, what is the output of *gpart show da0* command? Regards.
Created attachment 227478 [details] Konsole transcript. Context: <https://lists.freebsd.org/archives/freebsd-current/2021-August/000468.html> Lines 5–24 from within the attachment might help to explain the (much) later residual information. A misuse of srm(1): ---- root@mowa219-gjp4-8570p-freebsd:~ # srm -lv /dev/da0p3 Using /dev/urandom for random input. Wipe mode is insecure (two passes [0xff/random]) Wiping /dev/da0p3 Warning: /dev/da0p3 is not a regular file, rename/unlink only!Warning: Couldn't rename /dev/da0p3 - Operation not supported Removed file /dev/da0p3 ... Done root@mowa219-gjp4-8570p-freebsd:~ # wipe -nv /dev/da0p3 wipe: cannot stat `/dev/da0p3': No such file or directory root@mowa219-gjp4-8570p-freebsd:~ # lsblk da0 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da0 0:181 466G GPT - - da0p1 0:184 200M efi msdosfs/EFISYS - da0p2 0:188 512K freebsd-boot gpt/gptboot0 - <FREE> -:- 492K - - - stat: /dev/da0p3: stat: No such file or directory stat: /dev/da0p3: stat: No such file or directory da0p3 16G:freebsd-swap - SWAP da0p4 0:193 450G freebsd-zfs gpt/zfs0 <ZFS> da0p4.eli 0:196 450G zfs - - <FREE> -:- 4.0K - - - root@mowa219-gjp4-8570p-freebsd:~ # gdisk /dev/da0
(In reply to Slawomir Wojciech Wojtczak from comment #1) % gpart show da0 gpart: No such geom: da0. % lsblk da0 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da0 0:194 0B freebsd-swap - SWAP %
(In reply to comment #2) > … Context: > > <https://lists.freebsd.org/archives/freebsd-current/2021-August/000468.html> – that's for completeness, however it might be an excess of information for this bug report. Would you like me to attempt to make the issue reproducible with as few steps as possible? The photograph at <https://www.heraldscotland.com/business_hq/15149526.technology-winstars-communicator-c2-hard-disk-dock/> might help to visualise the dock in which the hard disk drive is seated. I suspect that: * the bridge to the HDD appears as a relatively low numbered device i.e. /dev/da0 only if the dock is connected when FreeBSD boots * the bridge appears as a relatively high numbered device i.e. /dev/da4 after switching the dock off, then on (a hard power switch at the rear of the dock).
(In reply to Graham Perrin from comment #3) > % gpart show da0 > gpart: No such geom: da0. > > % lsblk da0 > DEVICE MAJ:MIN SIZE TYPE LABEL > MOUNT > da0 0:194 0B freebsd-swap - > SWAP The lsblk(8) behaves properly here. If gpart(8) is not able to show any partition schema then it must be something on entire device so lsblk(8) uses fstyp(8) to get the information what is on it. Regards.
(In reply to Slawomir Wojciech Wojtczak from comment #5) % fstyp /dev/da0 fstyp: /dev/da0: not a disk % lsblk da0 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da0 0:194 0B freebsd-swap - SWAP %
(In reply to Slawomir Wojciech Wojtczak from comment #5) > … something on entire device … There is no storage device; it's the empty slot of an SD card reader (In reply to Graham Perrin from comment #2) Within the attached file (lines 616-626): Geom name: da0 Providers: 1. Name: da0 Mediasize: 0 (0B) Sectorsize: 512 Mode: r0w0e0 descr: Generic USB SD Reader ident: 058F312D81B rotationrate: unknown fwsectors: 0 fwheads: 0
(In reply to Graham Perrin from comment #7) Understood. Please check the fixed version from here: https://github.com/vermaden/lsblk/blob/master/lsblk Regards.
(In reply to Slawomir Wojciech Wojtczak from comment #8) <https://github.com/vermaden/lsblk/commit/23023261d68c7e41640707cbd733068349703aa5> noted with thanks. Success: % /usr/local/sbin/lsblk da0 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da0 2:98 0B freebsd-swap - SWAP % pwd /usr/home/grahamperrin/dev/lsblk % grep "PROBABLY EMPTY CARD READER" ./lsblk # WHEN SIZE IS NOT AVAILABLE ITS PROBABLY EMPTY CARD READER % ./lsblk da0 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT %
(In reply to Graham Perrin from comment #9) Submitted to update in ports/packages: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258122
Is that still relevant or should we close that?
(In reply to Slawomir Wojciech Wojtczak from comment #11) If I recall correctly, this was fixed. Thanks.