Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-27 Thread tomas
On Mon, Feb 27, 2023 at 09:23:06AM -0300, Eduardo M KALINOWSKI wrote:

[...]

> Maybe putting a tiny tinfoil hat on the power cable?

tiny tinfoil ♥

Cheers
- 
t


signature.asc
Description: PGP signature


Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-27 Thread Eduardo M KALINOWSKI

On 26/02/2023 18:56, Albretch Mueller wrote:

  I started using another power cable and so far so good, but I would
not be too happy too soon. It may sound more than half way off to you,
but it is physically possible and it has been actually demonstrated
that "they" have been hacking into computers through the power supply
lines . . .
  What physical means do we have to avoid that? Would some sort of
"denoising"/"gray noIsing" power surge protector help?


Maybe putting a tiny tinfoil hat on the power cable?

--
Eduardo M KALINOWSKI
edua...@kalinowski.com.br



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-26 Thread tomas
On Sun, Feb 26, 2023 at 09:56:46PM +, Albretch Mueller wrote:
> On 2/26/23, Stefan Monnier  wrote:
> >>  the drive has its own power cable and those kinds of failures have
> >> actually happened in research rooms in libraries [...]

> >Te problem is probably not coming from the electrical outlet, but it
> >could come from the disk's power cable or power adapter.
> 
>  I started using another power cable and so far so good, but I would
> not be too happy too soon.

It could just well be that the act of changing the cable itself (e.g.
by reseating connectors) has brought about the change. The device
sockets themselves are mechanically quite exposed.

>  It may sound more than half way off to you,
> but it is physically possible and it has been actually demonstrated
> that "they" have been hacking into computers through the power supply
> lines . . .

I hope this is tongue-in-cheek. Yes, I know about proof of concept
things in this area (more exfiltration than intrusion, though [1]),
but those kinds of attacks are so expensive that you'd have to be
a rather important person for them to carry their weight.

I'd rather worry about the javascript my browser is downloading from
All Of The Internet and executing in my computer.

Cheers

[1] Yes, I also know about glitching [2]. Targets are typically
   much simpler devices than your computer or your external disk
   enclosure. Besides, you'd notice if one of those were rebooting
   hundreds of times a minute until the hackers succeeded.

[2] https://hackaday.com/tag/glitching/

[3] Remember: rumours + lack of knowledge = conspiracy fog. Kids,
   check your sources.

-- 
t


signature.asc
Description: PGP signature


Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-26 Thread Albretch Mueller
On 2/26/23, Stefan Monnier  wrote:
>>  the drive has its own power cable and those kinds of failures have
>> actually happened in research rooms in libraries, which are rented by
>> VIPs for their own conferences ...; so, I doubt those electrical
>> outlets are also failing

>Te problem is probably not coming from the electrical outlet, but it
>could come from the disk's power cable or power adapter.

 I started using another power cable and so far so good, but I would
not be too happy too soon. It may sound more than half way off to you,
but it is physically possible and it has been actually demonstrated
that "they" have been hacking into computers through the power supply
lines . . .
 What physical means do we have to avoid that? Would some sort of
"denoising"/"gray noIsing" power surge protector help?
 lbrtchx



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-25 Thread Stefan Monnier
> [22565.451321] usb-storage 1-1:1.0: USB Mass Storage device detected
> [22565.451467] scsi host3: usb-storage 1-1:1.0
> [22566.457236] scsi 3:0:0:0: Direct-Access ST16000N M001G-2KK103
>PQ: 0 ANSI: 5
> [22566.457527] sd 3:0:0:0: Attached scsi generic sg2 type 0

IIUC you plug your disk via USB and it uses the standard "USB Mass
Storage" (UMS) protocol.

> [22566.457823] sd 3:0:0:0: [sdb] Very big device. Trying to use READ
> CAPACITY(16).
> [22566.457997] sd 3:0:0:0: [sdb] 31251759104 512-byte logical blocks:
> (16.0 TB/14.6 TiB)
> [22566.458365] sd 3:0:0:0: [sdb] Write Protect is off
> [22566.458369] sd 3:0:0:0: [sdb] Mode Sense: 28 00 00 00
> [22566.458640] sd 3:0:0:0: [sdb] No Caching mode page found
> [22566.458644] sd 3:0:0:0: [sdb] Assuming drive cache: write through
> [22566.538074]  sdb: sdb1 sdb2
> [22566.583373] sd 3:0:0:0: [sdb] Attached SCSI disk
> [22575.515358] XFS (sdb1): Mounting V5 Filesystem
> [22575.742880] XFS (sdb1): Starting recovery (logdev: internal)
> [22575.919197] XFS (sdb1): Ending recovery (logdev: internal)
> [22575.932002] xfs filesystem being mounted at
> /media/user/77d8da74-a690-481a-86d5-9beab5a8e842 supports timestamps
> until 2038 (0x7fff)

OK, now it read the disk just fine and mounted it.

> [22582.368977] usb 1-1: USB disconnect, device number 21

After just 7s it disconnected?  Sounds like you have a connection
problem.  Poor cabling?  Or maybe the disk consumes more power than its
power adapter can provide? (seems unlikely since it's a 16TB drive, so
presumably spinning and those usually reach their top consumption when
spinning up, so it would have failed before mounting the filesystem, but
it's still a possibility).

>  the drive has its own power cable and those kinds of failures have
> actually happened in research rooms in libraries, which are rented by
> VIPs for their own conferences ...; so, I doubt those electrical
> outlets are also failing

Te problem is probably not coming from the electrical outlet, but it
could come from the disk's power cable or power adapter.

> The laptop + external disk combination I am using right now has a
> very pore transfer rate. I need at least three times that around
> 100MB/sec:

100MB/s means more than 1Gb/s so you definitely can't reach that much
with USB2.  Make sure your USB<->SATA adapter is USB3 and that you plug
the disk into a USB3 port as well.  But even then you may find it
difficult to reach that speed because of the overhead introduced by USB.

36.87MB/s is quite reasonable for a USB2 connection (I'd even venture
to say it's pretty good).


Stefan



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-25 Thread David Christensen

On 2/25/23 04:31, Albretch Mueller wrote:

On 2/25/23, to...@tuxteam.de  wrote:

I can't make too much heads or tails of it, but I'd focus
my suspicions on the USB part. USB ports (both sides),
cable and especially the power source for the disk: 


+1



does
it have a separate source, or does it feed on the computer's
USB?


  the drive has its own power cable and those kinds of failures have
actually happened in research rooms in libraries, which are rented by
VIPs for their own conferences ...; so, I doubt those electrical
outlets are also failing



My house was built with cheap NEMA 5-15R duplex receptacles in 1994.  A 
few lost their grip, so I replaced them with better quality devices.




On 2/25/23, David Christensen  wrote:

It looks like your USB connection is unreliable.  I suggest removing the
drive from its USB enclosure ...


  I am not using a USB enclosure per se, but a regular internal disk
externally attached using a USB/power interface. I will test the USB
cabling using a better looking, newer USB cable.



What is the make and model of your USB/power interface?


I bought a StarTech S351BMU33ET a few years ago:

https://www.startech.com/en-us/hdd/s351bmu33et

I liked everything except the fact that it lacked a fan and my HDD's 
were getting too hot.  So, I opened it up and discovered that StarTech 
had done most of the engineering -- the rear panel has injection molded 
features for a fan, and the printed circuit board has a clearance 
cut-out for a fan and nearby plated through holes for a 2 x 0.1" pin 
header.  I completed the rear panel cutout, soldered in a pin header, 
connected a fan, and powered it up.  The PCB layout is wrong -- one fan 
pin was connected to DC negative and but the other was floating (?). 
The on/off switch does not do old-school power switching -- it connects 
to a chip.  I probed the board looking for a switched DC positive.  I 
settled for the most convenient trace/ pad that I could find near the 
incoming power connector and soldered in a jumper.  Now the fan spins 
whenever a drive is inserted, regardless of the on/off switch.  Oh, 
well.  USB and eSATA performance is excellent, and I have had no 
problems with it.  StarTech should do a revision of the PCB and start 
shipping units with fans -- I would buy more and recommend them.




Unless you have suitable test equipment


  If what you meant by "test equipment" is the kind they use in clean
rooms 



And electronics labs, geek home workshops, etc..



I cannot use those, but I would like to buy some hdd failure
detection rig



I have several tower and rack computers, and install hard drive mobile 
racks in all of them:


https://www.startech.com/en-us/hdd/drw150satbk

https://www.startech.com/en-us/hdd/hsb220sat25b

https://www.startech.com/en-us/hdd/s25slotr


I typically use 2.5" SATA SSD's for OS drives, one OS per SSD, and have 
an assortment of Windows, Linux, and FreeBSD instances with various 
utility apps to choose from.  Do not be afraid to spend good money on 
good parts and good tools; it will save your sanity and your data.




... making sure the BIOS hasn’t been corrupted).



That is tough, given that you must assume backdoored firmware will take 
measures to hide and protect itself.



If your firmware EEPROM is socketed, then an EEPROM programmer and 
suitable PC/ driver/ app would do.



If your firmware EEPROM is soldered and the motherboard has JTAG, then a 
cable, JTAG adapter, and PC/ driver/ app comes to mind.  But, this may 
require technical information from the motherboard manufacturer.




There is a lot of (at times partial and in ads) information out there
about the science and art of the use and care of computer memory (RAM,
SSD and hdd) and filesystems based on the profile of your applications
but a "Bible" kind of book about such matters is nowhere to be found.



"Confidential".  I once wrote a BSD device driver for an Intel Fast 
Ethernet PCI adapter.  Intel required my employer to sign an NDA so we 
could get the technical/ programmers manual.




The laptop + external disk combination I am using right now has a
very pore transfer rate.



Does the laptop have an ExpressCard slot?  If so, an ExpressCard to USB, 
Firewire, or eSATA adapter is an option:


https://www.startech.com/en-us/search?search_term=expresscard


That said, the prices of recent model, used computers have dropped 
significantly post-COVID.



For DIY, I prefer used Intel S1200V3RPL motherboards/ CPU/ ECC bundles, 
used LSI HBA SAS 9207-8i IT Mode, new StarTech mobile racks as above, 
and new Fractal Design chassis/ PSU/ third fan:


https://www.fractal-design.com/products/cases/define/define-r5/black/

https://www.fractal-design.com/products/power-supplies/ion/ion-2-platinum-660w/Black/

https://www.fractal-design.com/products/fans/dynamic/dynamic-x2-gp-14/white/


If building a gaming/ compute box, I would substitute the 860 W PSU.


David



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-25 Thread Dan Ritter
Albretch Mueller wrote: 
> On 2/25/23, to...@tuxteam.de  wrote:
>  I am not using a USB enclosure per se, but a regular internal disk
> externally attached using a USB/power interface. I will test the USB
> cabling using a better looking, newer USB cable.

If you can swap the USB/SATA interface too, that's a pretty
likely failure point.

>  The laptop + external disk combination I am using right now has a
> very pore transfer rate. I need at least three times that around
> 100MB/sec:
> 
> $ date; time sudo hdparm -tT /dev/sdc
> Sat 25 Feb 2023 12:03:43 PM UTC
> 
> /dev/sdc:
>  Timing cached reads:   29458 MB in  2.00 seconds = 14754.70 MB/sec
>  Timing buffered disk reads: 112 MB in  3.04 seconds =  36.87 MB/sec

The top number is, of course, bogus. The bottom number is typical of a
USB2-connected disk -- the often cited "480Mb/s" connection speed has
a lot of protocol overhead and inefficiency. About 42MB/s is the best
you can hope for.

A USB3 port, if you have one available, and a USB3-SATA3 interface that
supports UASP (basically, SCSI over USB), can manage 100-120MB/s
on a spinning disk.

-dsr-



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-25 Thread Albretch Mueller
On 2/25/23, to...@tuxteam.de  wrote:
> I can't make too much heads or tails of it, but I'd focus
> my suspicions on the USB part. USB ports (both sides),
> cable and especially the power source for the disk: does
> it have a separate source, or does it feed on the computer's
> USB?

 the drive has its own power cable and those kinds of failures have
actually happened in research rooms in libraries, which are rented by
VIPs for their own conferences ...; so, I doubt those electrical
outlets are also failing

On 2/25/23, David Christensen  wrote:
> It looks like your USB connection is unreliable.  I suggest removing the
> drive from its USB enclosure ...

 I am not using a USB enclosure per se, but a regular internal disk
externally attached using a USB/power interface. I will test the USB
cabling using a better looking, newer USB cable.

> Unless you have suitable test equipment

 If what you meant by "test equipment" is the kind they use in clean
rooms I cannot use those, but I would like to buy some hdd failure
detection rig to be sure the kinds of failures I encounter are not
physical and when physical I would like to be able to differentiate
between an actual failing drive and a failure somehow externally
induced (which you would test using a Debian live start and making
sure the BIOS hasn’t been corrupted).

 There is a lot of (at times partial and in ads) information out there
about the science and art of the use and care of computer memory (RAM,
SSD and hdd) and filesystems based on the profile of your applications
but a "Bible" kind of book about such matters is nowhere to be found.

 The laptop + external disk combination I am using right now has a
very pore transfer rate. I need at least three times that around
100MB/sec:

$ date; time sudo hdparm -tT /dev/sdc
Sat 25 Feb 2023 12:03:43 PM UTC

/dev/sdc:
 Timing cached reads:   29458 MB in  2.00 seconds = 14754.70 MB/sec
 Timing buffered disk reads: 112 MB in  3.04 seconds =  36.87 MB/sec

real0m14.048s
user0m0.274s
sys 0m1.862s
$

 I wonder about how much better transfer rates can you get in a DIY
way on Linux.

 Thank you,
 lbrtchx



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-25 Thread David Christensen

On 2/24/23 22:24, Albretch Mueller wrote:

I have been "heavily" downloading data from archive.org which I
actually need for my own corpora research from two different places.
One offering me 1.5MiB/s and the other 0.5MiB/s download speed.

Is my hard drive actually failing? (smartctl tells me it doesn't seem
to be the case) or are they or my ISP somehow hacking into my computer
to "motivate" such apparent errors?

How could I check either case? I have read about XFS needing special
care, but I would like to have a better idea of the source of such
errors first.

this is what I see on the screen when the drive is disconnected
somehow, but I always reconnected by clicking on its sign using the
GUI just fine. It doesn't sound like a failing drive either.

What could possibly going on?

$ kf.solid.backends.udisks2: Error getting props:
"org.freedesktop.DBus.Error.UnknownMethod" "No such interface
“org.freedesktop.DBus.Properties” on object at path
/org/freedesktop/UDisks2/drives/..."
...
$ sudo systemctl --user --failed
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and
$XDG_RUNTIME_DIR not defined (consider using --machine=@.host
--user to connect to bus of other user)

$ sudo dmesg
...
[22565.451321] usb-storage 1-1:1.0: USB Mass Storage device detected
[22565.451467] scsi host3: usb-storage 1-1:1.0
[22566.457236] scsi 3:0:0:0: Direct-Access ST16000N M001G-2KK103
PQ: 0 ANSI: 5
[22566.457527] sd 3:0:0:0: Attached scsi generic sg2 type 0
[22566.457823] sd 3:0:0:0: [sdb] Very big device. Trying to use READ
CAPACITY(16).
[22566.457997] sd 3:0:0:0: [sdb] 31251759104 512-byte logical blocks:
(16.0 TB/14.6 TiB)
[22566.458365] sd 3:0:0:0: [sdb] Write Protect is off
[22566.458369] sd 3:0:0:0: [sdb] Mode Sense: 28 00 00 00
[22566.458640] sd 3:0:0:0: [sdb] No Caching mode page found
[22566.458644] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[22566.538074]  sdb: sdb1 sdb2
[22566.583373] sd 3:0:0:0: [sdb] Attached SCSI disk
[22575.515358] XFS (sdb1): Mounting V5 Filesystem
[22575.742880] XFS (sdb1): Starting recovery (logdev: internal)
[22575.919197] XFS (sdb1): Ending recovery (logdev: internal)
[22575.932002] xfs filesystem being mounted at
/media/user/77d8da74-a690-481a-86d5-9beab5a8e842 supports timestamps
until 2038 (0x7fff)
[22582.368977] usb 1-1: USB disconnect, device number 21
[22582.380548] XFS (sdb1): Unmounting Filesystem
[22582.380594] XFS (sdb1): log I/O error -5
[22582.380603] XFS (sdb1): xfs_do_force_shutdown(0x2) called from line
1211 of file fs/xfs/xfs_log.c. Return address = 9651f22d
[22582.380604] XFS (sdb1): Log I/O Error Detected. Shutting down filesystem
[22582.380605] XFS (sdb1): Please unmount the filesystem and rectify
the problem(s)
[22582.380608] XFS (sdb1): Unable to update superblock counters.
Freespace may not be correct on next mount.
...

$ sudo blkid
...
/dev/sdb1: UUID="77d8da74-a690-481a-86d5-9beab5a8e842"
BLOCK_SIZE="512" TYPE="xfs" PARTLABEL="primary"
PARTUUID="f646c65f-bc46-4185-ba1e-583f157d6cb3"
...

$ sudo smartctl -l selftest /dev/sdb
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-18-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_DescriptionStatus  Remaining
LifeTime(hours)  LBA_of_first_error
# 1  Extended offlineInterrupted (host reset)  00%   601 -
# 2  Extended offlineCompleted without error   00%96 -
# 3  Conveyance offline  Completed without error   00%74 -
# 4  Short offline   Completed without error   00%74 -
# 5  Extended offlineAborted by host   90%73 -
# 6  Short offline   Completed without error   00% 0 -

$



It looks like your USB connection is unreliable.  I suggest removing the 
drive from its USB enclosure, installing the drive internally, 
connecting the drive to the system power supply, and connecting the 
drive to a or HBA SATA 6 Gbps port using a 6 Gbps cable.  Unless you 
have suitable test equipment, you may need to try multiple computers, 
SATA ports, HBA's, and/or SATA cables as you search for the right 
combination.



Once the drive has a reliable hardware connection, I would run a SMART 
long test 'smartctl -t long ...', generate a complete SMART report 
'smartctl --xall ...', check the filesystem fsck.xfs(8), and validate 
the integrity of the data.



David



Re: dmesg ... XFS (sdb1): log I/O error ...

2023-02-24 Thread tomas
On Sat, Feb 25, 2023 at 06:24:23AM +, Albretch Mueller wrote:

[...]

I can't make too much heads or tails of it, but I'd focus
my suspicions on the USB part. USB ports (both sides),
cable and especially the power source for the disk: does
it have a separate source, or does it feed on the computer's
USB?

Cheers
- 
t


signature.asc
Description: PGP signature


dmesg ... XFS (sdb1): log I/O error ...

2023-02-24 Thread Albretch Mueller
I have been "heavily" downloading data from archive.org which I
actually need for my own corpora research from two different places.
One offering me 1.5MiB/s and the other 0.5MiB/s download speed.

Is my hard drive actually failing? (smartctl tells me it doesn't seem
to be the case) or are they or my ISP somehow hacking into my computer
to "motivate" such apparent errors?

How could I check either case? I have read about XFS needing special
care, but I would like to have a better idea of the source of such
errors first.

this is what I see on the screen when the drive is disconnected
somehow, but I always reconnected by clicking on its sign using the
GUI just fine. It doesn't sound like a failing drive either.

What could possibly going on?

$ kf.solid.backends.udisks2: Error getting props:
"org.freedesktop.DBus.Error.UnknownMethod" "No such interface
“org.freedesktop.DBus.Properties” on object at path
/org/freedesktop/UDisks2/drives/..."
...
$ sudo systemctl --user --failed
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and
$XDG_RUNTIME_DIR not defined (consider using --machine=@.host
--user to connect to bus of other user)

$ sudo dmesg
...
[22565.451321] usb-storage 1-1:1.0: USB Mass Storage device detected
[22565.451467] scsi host3: usb-storage 1-1:1.0
[22566.457236] scsi 3:0:0:0: Direct-Access ST16000N M001G-2KK103
   PQ: 0 ANSI: 5
[22566.457527] sd 3:0:0:0: Attached scsi generic sg2 type 0
[22566.457823] sd 3:0:0:0: [sdb] Very big device. Trying to use READ
CAPACITY(16).
[22566.457997] sd 3:0:0:0: [sdb] 31251759104 512-byte logical blocks:
(16.0 TB/14.6 TiB)
[22566.458365] sd 3:0:0:0: [sdb] Write Protect is off
[22566.458369] sd 3:0:0:0: [sdb] Mode Sense: 28 00 00 00
[22566.458640] sd 3:0:0:0: [sdb] No Caching mode page found
[22566.458644] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[22566.538074]  sdb: sdb1 sdb2
[22566.583373] sd 3:0:0:0: [sdb] Attached SCSI disk
[22575.515358] XFS (sdb1): Mounting V5 Filesystem
[22575.742880] XFS (sdb1): Starting recovery (logdev: internal)
[22575.919197] XFS (sdb1): Ending recovery (logdev: internal)
[22575.932002] xfs filesystem being mounted at
/media/user/77d8da74-a690-481a-86d5-9beab5a8e842 supports timestamps
until 2038 (0x7fff)
[22582.368977] usb 1-1: USB disconnect, device number 21
[22582.380548] XFS (sdb1): Unmounting Filesystem
[22582.380594] XFS (sdb1): log I/O error -5
[22582.380603] XFS (sdb1): xfs_do_force_shutdown(0x2) called from line
1211 of file fs/xfs/xfs_log.c. Return address = 9651f22d
[22582.380604] XFS (sdb1): Log I/O Error Detected. Shutting down filesystem
[22582.380605] XFS (sdb1): Please unmount the filesystem and rectify
the problem(s)
[22582.380608] XFS (sdb1): Unable to update superblock counters.
Freespace may not be correct on next mount.
...

$ sudo blkid
...
/dev/sdb1: UUID="77d8da74-a690-481a-86d5-9beab5a8e842"
BLOCK_SIZE="512" TYPE="xfs" PARTLABEL="primary"
PARTUUID="f646c65f-bc46-4185-ba1e-583f157d6cb3"
...

$ sudo smartctl -l selftest /dev/sdb
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-18-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_DescriptionStatus  Remaining
LifeTime(hours)  LBA_of_first_error
# 1  Extended offlineInterrupted (host reset)  00%   601 -
# 2  Extended offlineCompleted without error   00%96 -
# 3  Conveyance offline  Completed without error   00%74 -
# 4  Short offline   Completed without error   00%74 -
# 5  Extended offlineAborted by host   90%73 -
# 6  Short offline   Completed without error   00% 0 -

$