<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>USB – Linux und Ich</title>
	<atom:link href="https://linuxundich.de/en/tag/usb/feed/" rel="self" type="application/rss+xml" />
	<link>https://linuxundich.de/en</link>
	<description>A German Linux blog, in English</description>
	<lastBuildDate>Wed, 14 Oct 2026 22:47:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>
	<item>
		<title>Wireless mouse lagging? How to fix USB 3.0 interference</title>
		<link>https://linuxundich.de/en/wireless-mouse-lag-usb-3-interference/</link>
					<comments>https://linuxundich.de/en/wireless-mouse-lag-usb-3-interference/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Wed, 14 Oct 2026 22:47:30 +0000</pubDate>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Input Devices]]></category>
		<category><![CDATA[Logitech]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=239</guid>

					<description><![CDATA[If your wireless mouse stutters or your wireless keyboard drops keystrokes, a USB 3.0 port is often to blame: it interferes with the 2.4 GHz signal. An extension cable usually fixes it in minutes.]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-group lui-no-link-marker lui-no-autolink has-border-color has-base-2-background-color has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-0d6366a6 wp-block-group-is-layout-constrained" style="border-color:var(--wp--preset--color--line);border-width:1px;border-radius:8px;margin-top:0;margin-bottom:var(--wp--preset--spacing--50);padding-top:var(--wp--preset--spacing--40);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)">
<p class="has-muted-color has-text-color has-small-font-size wp-block-paragraph" style="font-weight:700;letter-spacing:0.08em;text-transform:uppercase">Updated October 15, 2026</p>



<p class="has-small-font-size wp-block-paragraph">I brought this article from 2014 up to date: the links to Intel and Logitech point to the official sources again, a step-by-step guide sums up the fixes, and the charts have been redrawn. The problem itself hasn&#8217;t changed, USB 3.0 still interferes with 2.4 GHz wireless today.</p>
</div>



<p class="wp-block-paragraph">I have to admit: I&#8217;m a fan of wireless mice. Sure, ordinary rechargeable batteries drain far too quickly, but Eneloop batteries take care of that nicely. Mousing around without a cable is simply more comfortable. When I switched to a new computer and installed Arch Linux, though, my previously flawless Logitech wireless mouse drove me to despair.</p>



<p class="wp-block-paragraph">Where I used to move the cursor across the screen with precision, after the switch it just jerked and stuttered along miserably. The cause wasn&#8217;t the system, as I first suspected. The culprit is USB 3.0: the fast ports get in the way of wireless keyboards and mice. By the way, this isn&#8217;t a Linux problem, the mouse stutters on Windows just the same.</p>



<p class="wp-block-paragraph">Tracking down the cause cost me quite a few nerves over several weeks. I suspected the new computer, combed through Arch Linux forums for problems with USB mice and tried the mouse&#8217;s dongle in every port on the machine. No matter what I did, the mouse simply refused to work as precisely as I was used to from Logitech.</p>



<p class="wp-block-paragraph">Not even the USB port of the monitor right next to the computer helped. The mouse itself, a Logitech Anywhere MX, wasn&#8217;t to blame either: it worked flawlessly on other computers. In other words, I had tried all the obvious tips, and nothing helped. In the end, it was pure chance that put me on the right track.</p>



<h2 class="wp-block-heading" id="mouse-jumps">When your wireless mouse jumps all over the screen</h2>



<p class="wp-block-paragraph">I stumbled on the solution while rearranging my desk. My second monitor has USB ports as well, and lo and behold: with the Logitech dongle plugged into that monitor, about a meter away from the computer as the crow flies, the mouse works as usual again. No more lag, no dropouts, no twitching. So simple that it&#8217;s almost annoying I didn&#8217;t think of it right away.</p>



<p class="wp-block-paragraph">You&#8217;ll find the explanation if you add &#8220;USB 3.0&#8221; to your search for a &#8220;choppy mouse&#8221; or &#8220;mouse lag&#8221;. Because that&#8217;s where the problem lies: USB 3.0 ports and cables radiate broadband noise into their surroundings that also covers the 2.4 GHz band. That&#8217;s exactly where the receivers of mice and keyboards operate, and they simply can&#8217;t compete with the noise anymore.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e916d3f0b&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e916d3f0b" class="wp-block-image wp-lightbox-container"><img fetchpriority="high" decoding="async" height="853" sizes="(max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2014/05/logitech-usb-dongle-640x427.jpg 640w, https://linuxundich.de/wp-content/uploads/2014/05/logitech-usb-dongle-768x512.jpg 768w, https://linuxundich.de/wp-content/uploads/2014/05/logitech-usb-dongle.jpg 1280w" width="1280" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2014/05/logitech-usb-dongle.jpg" alt="Logitech USB receiver in a USB port" style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">Plug your wireless mouse&#8217;s USB receiver in as far away from USB 3.0 ports as possible, ideally on an extension cable right next to the mouse.</figcaption></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e916d928c&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e916d928c" class="wp-block-image wp-lightbox-container"><img decoding="async" height="853" sizes="(max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2014/05/logitech-maus-640x427.jpg 640w, https://linuxundich.de/wp-content/uploads/2014/05/logitech-maus-768x512.jpg 768w, https://linuxundich.de/wp-content/uploads/2014/05/logitech-maus.jpg 1280w" width="1280" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2014/05/logitech-maus.jpg" alt="Logitech Anywhere MX wireless mouse" style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">All wireless mice and keyboards that use the 2.4 GHz band are affected, no matter whether they come from Logitech or another manufacturer.</figcaption></figure>



<h2 class="wp-block-heading" id="intel-knows">Intel has known about it since 2012</h2>



<p class="wp-block-paragraph">Intel has known about the problem for a long time. In the white paper <a href="https://cdrdv2.intel.com/v1/dl/getContent/841692?fileName=usb30radiofrequencyinterference.pdf">USB 3.0* Radio Frequency Interference Impact on 2.4 GHz Wireless Devices</a> from April 2012, the chipmaker describes over 22 pages how plugs, sockets and cables of USB 3.0 devices interfere with wireless signals in the 2.4 GHz band. The noise sits right in the middle of the band, so a filter won&#8217;t help. It lowers the signal-to-noise ratio and with it the sensitivity and range of the receivers.</p>



<p class="wp-block-paragraph">Intel advises manufacturers to shield USB 3.0 hardware better. What&#8217;s left for you is the practical advice: don&#8217;t plug the wireless receivers of your keyboard and mouse into a USB 3.0 port, use a classic USB 2.0 port instead. You can usually spot USB 3.0 ports by their blue insert or the SS logo for SuperSpeed, USB 2.0 by the white or black plastic tab. The small receivers don&#8217;t benefit from the higher speed anyway.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e916de1ab&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e916de1ab" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="1608" height="938" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-spectrum.png" alt="Line chart: interference power of a USB 3.0 data signal from 0 to 6 GHz, about -58 dBm/100 kHz in the marked 2.4 GHz band, down at the noise floor above 4.5 GHz" class="wp-image-242" style="width:100%" srcset="https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-spectrum.png 1608w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-spectrum-300x175.png 300w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-spectrum-1024x597.png 1024w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-spectrum-768x448.png 768w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-spectrum-1536x896.png 1536w" sizes="(max-width: 781px) 100vw, 680px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">The noise spectrum of an active USB 3.0 port reaches well beyond 2.4 GHz and thus covers the band used by wireless mice and keyboards. (Data: Intel)</figcaption></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e916defbe&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e916defbe" class="wp-block-image size-full wp-lightbox-container"><img loading="lazy" decoding="async" width="1608" height="938" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-24ghz.png" alt="Comparison chart from 2.3 to 2.6 GHz: with a USB 3.0 device connected, the noise in the 2.4 GHz band is up to 20 dB higher than without" class="wp-image-243" style="width:100%" srcset="https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-24ghz.png 1608w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-24ghz-300x175.png 300w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-24ghz-1024x597.png 1024w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-24ghz-768x448.png 768w, https://linuxundich.de/en/wp-content/uploads/2026/10/usb3-noise-24ghz-1536x896.png 1536w" sizes="auto, (max-width: 781px) 100vw, 680px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">With a USB 3.0 device connected, the noise in the 2.4 GHz band is about 20 dB higher, and the mouse&#8217;s weak signal gets lost in it. (Data: Intel)</figcaption></figure>



<h2 class="wp-block-heading" id="logitech-distance">Logitech also recommends more distance</h2>



<p class="wp-block-paragraph">Logitech hasn&#8217;t missed the problem either, USB 3.0 isn&#8217;t exactly new, after all. On the support page <a href="https://support.logi.com/hc/en-us/articles/360023414273">Wireless product not working properly when also using a USB 3.0 device</a>, the company lists the typical symptoms: mouse and keyboard respond with a delay, keystrokes or mouse clicks get lost, and the range between device and receiver shrinks noticeably.</p>



<p class="wp-block-paragraph">Logitech recommends plugging the receiver in as far away from USB 3.0 ports and devices as possible, for example on the opposite side of the computer, and bringing it as close to the mouse or keyboard as you can. According to the support page, Logitech even provides affected customers with a USB extension cable. You have to request it from support, though the page doesn&#8217;t say whether any conditions apply.</p>



<h2 class="wp-block-heading" id="fix-the-lag">How to get rid of the lag</h2>



<p class="wp-block-paragraph">In the end, it all comes down to a few simple steps. Ideally, try them in this order:</p>



<ol class="wp-block-list">
<li><strong>Move the receiver:</strong> Plug the dongle into a USB 2.0 port, as far away from USB 3.0 sockets as possible. Watch out for front ports: on newer cases, those are often USB 3.0 as well.</li>

<li><strong>Use an extension cable:</strong> A simple <a href="https://www.amazon.com/dp/B07N1C8KJV/?tag=linuxundich-20" target="_blank" rel="sponsored nofollow noopener">USB extension cable</a> gets the receiver out of the interference zone and puts it right next to your mouse and keyboard. Whether the cable supports USB 2.0 or 3.0 doesn&#8217;t matter, the receiver only runs at USB 2.0 speed anyway.</li>

<li><strong>Use your monitor as a hub:</strong> If your monitor has USB ports, plug the receiver in there. That&#8217;s exactly what fixed it for me.</li>

<li><strong>Keep interference sources away:</strong> External drives, card readers, hubs and cables with USB 3.0 don&#8217;t belong right next to the receiver.</li>

<li><strong>Ask the manufacturer:</strong> If you own a Logitech device, you can request the extension cable from Logitech support.</li>
</ol>



<h2 class="wp-block-heading" id="not-just-mice">It&#8217;s not just wireless mice</h2>



<p class="wp-block-paragraph">In general, you should keep devices with 2.4 GHz radios away from USB 3.0 hardware. Besides the ports themselves, cables and electronics of card readers or external drives can also cause interference. And it&#8217;s not just wireless mice and keyboards that are affected: Bluetooth, Wi-Fi in the 2.4 GHz band and baby monitors all operate in the same range. By the way, USB 3.0 is now officially called USB 3.2 Gen 1, but the new name doesn&#8217;t change the problem.</p>



<p class="wp-block-paragraph">There&#8217;s a catch with laptops that only have USB 3.0 ports or even just USB-C. A short <a href="https://www.amazon.com/dp/B0G2SLSN82/?tag=linuxundich-20" target="_blank" rel="sponsored nofollow noopener">USB-C to USB-A extension</a> helps here, moving the receiver at least a little away from the case. If you don&#8217;t want a dongle dangling on a cable at all, go for a mouse that talks to the built-in radio via Bluetooth. Bluetooth isn&#8217;t completely immune to USB 3.0 noise either, though.</p>



<p class="wp-block-paragraph">For me, moving the receiver to the monitor fixed the problem in one go back then, and the cursor has been gliding precisely across the desktop ever since. For weeks I blamed Arch Linux and the new computer, when the solution was just a meter away. Have you had similar experiences with USB 3.0, or do you have a better solution?</p>



<div class="wp-block-group lui-no-link-marker lui-no-autolink has-border-color has-base-2-background-color has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-389236d9 wp-block-group-is-layout-constrained" style="border-color:var(--wp--preset--color--line);border-width:1px;border-radius:8px;margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50);padding-top:var(--wp--preset--spacing--40);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)">
<p class="has-muted-color has-text-color has-small-font-size wp-block-paragraph" style="font-weight:700;letter-spacing:0.08em;text-transform:uppercase">What you need</p>



<p class="wp-block-paragraph">The mouse from the article is no longer sold. As of October 2026:</p>



<p class="wp-block-paragraph" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--20);font-weight:700">Extension, mouse and batteries</p>



<div class="wp-block-columns are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-957a3321 wp-block-columns-is-layout-flex" style="border-top-color:var(--wp--preset--color--line);border-top-width:1px;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20)">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:70%">
<p class="has-small-font-size wp-block-paragraph"><strong>UGREEN USB 2.0 extension cable</strong><br>Gets the receiver out of the USB 3.0 interference zone and puts it right next to your mouse and keyboard.</p>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:30%">
<div class="wp-block-buttons is-content-justification-right is-layout-flex wp-container-core-buttons-is-layout-c5ec1813 wp-block-buttons-is-layout-flex">
<div class="wp-block-button is-style-outline is-style-outline--1"><a class="wp-block-button__link has-small-font-size has-custom-font-size wp-element-button" href="https://www.amazon.com/dp/B07N1C8KJV/?tag=linuxundich-20" target="_blank" rel="sponsored nofollow noopener">On Amazon</a></div>
</div>
</div>
</div>



<div class="wp-block-columns are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-957a3321 wp-block-columns-is-layout-flex" style="border-top-color:var(--wp--preset--color--line);border-top-width:1px;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20)">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:70%">
<p class="has-small-font-size wp-block-paragraph"><strong>AXFEE USB-C to USB-A extension</strong><br>For laptops with USB-C: the receiver sits on the cable, a little away from the case.</p>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:30%">
<div class="wp-block-buttons is-content-justification-right is-layout-flex wp-container-core-buttons-is-layout-c5ec1813 wp-block-buttons-is-layout-flex">
<div class="wp-block-button is-style-outline is-style-outline--2"><a class="wp-block-button__link has-small-font-size has-custom-font-size wp-element-button" href="https://www.amazon.com/dp/B0G2SLSN82/?tag=linuxundich-20" target="_blank" rel="sponsored nofollow noopener">On Amazon</a></div>
</div>
</div>
</div>



<div class="wp-block-columns are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-957a3321 wp-block-columns-is-layout-flex" style="border-top-color:var(--wp--preset--color--line);border-top-width:1px;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20)">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:70%">
<p class="has-small-font-size wp-block-paragraph"><strong>Logitech MX Anywhere 3S</strong><br>Successor to the Anywhere MX, ships without a dongle and connects via Bluetooth through your computer&#8217;s built-in radio.</p>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:30%">
<div class="wp-block-buttons is-content-justification-right is-layout-flex wp-container-core-buttons-is-layout-c5ec1813 wp-block-buttons-is-layout-flex">
<div class="wp-block-button is-style-outline is-style-outline--3"><a class="wp-block-button__link has-small-font-size has-custom-font-size wp-element-button" href="https://www.amazon.com/dp/B07W6GJWZR/?tag=linuxundich-20" target="_blank" rel="sponsored nofollow noopener">On Amazon</a></div>
</div>
</div>
</div>



<div class="wp-block-columns are-vertically-aligned-center is-layout-flex wp-container-core-columns-is-layout-957a3321 wp-block-columns-is-layout-flex" style="border-top-color:var(--wp--preset--color--line);border-top-width:1px;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20)">
<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:70%">
<p class="has-small-font-size wp-block-paragraph"><strong>Panasonic eneloop AA</strong><br>Low self-discharge batteries that last much longer in a wireless mouse than ordinary NiMH cells.</p>
</div>



<div class="wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:30%">
<div class="wp-block-buttons is-content-justification-right is-layout-flex wp-container-core-buttons-is-layout-c5ec1813 wp-block-buttons-is-layout-flex">
<div class="wp-block-button is-style-outline is-style-outline--4"><a class="wp-block-button__link has-small-font-size has-custom-font-size wp-element-button" href="https://www.amazon.com/dp/B00JHKSMJU/?tag=linuxundich-20" target="_blank" rel="sponsored nofollow noopener">On Amazon</a></div>
</div>
</div>
</div>



<p class="has-muted-color has-text-color has-small-font-size wp-block-paragraph" style="margin-top:var(--wp--preset--spacing--40)"><strong>Ad:</strong> All links in this box are Amazon affiliate links. As an Amazon Associate I earn from qualifying purchases; the price stays the same for you. I deliberately don&#8217;t list prices because they change too often. You&#8217;ll see the current price directly on Amazon.</p>
</div>


<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/wireless-mouse-lag-usb-3-interference/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Impression: A GTK4 Tool for Flashing ISO Images</title>
		<link>https://linuxundich.de/en/impression-gtk4-tool-for-flashing-iso-images/</link>
					<comments>https://linuxundich.de/en/impression-gtk4-tool-for-flashing-iso-images/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Wed, 07 Jun 2023 06:16:47 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[ISO Image]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/impression-gtk4-tool-for-flashing-iso-images/</guid>

					<description><![CDATA[Impression writes ISO images to USB sticks and memory cards. The GTK4 program blends neatly into the GNOME desktop and only offers removable drives as targets.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">To flash ISO images to USB sticks, I usually use the <code>dd</code> command. After many years of playing around with Linux distributions for PCs, the Raspberry Pi and the like, the syntax <code>dd if=foo.iso of=/dev/sdx bs=1M; sync</code> has become second nature to me. Somehow, though, I always have a slightly queasy feeling: one day I&#8217;m bound to make a mistake when typing the device ID. One day I&#8217;ll accidentally overwrite important data, practically beyond recovery. I don&#8217;t think I&#8217;m alone with this feeling.</p>



<p class="wp-block-paragraph">That&#8217;s why I really like the idea behind tools such as GNOME&#8217;s built-in function for flashing ISOs or <a href="https://etcher.balena.io">Etcher</a>. As a user, a graphical interface gives you a bit more overview and control. However, GNOME Disks hides its ISO flashing function quite well, and with Etcher, Electron bothers me. Even if it may be convenient for developers: flooding the system with a software blob weighing dozens of megabytes, which is useless in itself, just for this seems a bit over the top to me.</p>



<figure data-wp-context="{&quot;galleryId&quot;:&quot;6b04e9170a86f&quot;}" data-wp-interactive="core/gallery" class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e9170a900&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e9170a900" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" height="753" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_4-1-640x436.png 640w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_4-1-768x523.png 768w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_4-1.png 1106w" width="1106" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_4-1.png" alt="Once the job is done, Impression reports that the image has been written." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e9170aae8&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e9170aae8" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" height="753" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_3-1-640x436.png 640w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_3-1-768x523.png 768w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_3-1.png 1106w" width="1106" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_3-1.png" alt="While writing, Impression shows a progress bar." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e9170ae05&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e9170ae05" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" height="753" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_2-1-640x436.png 640w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_2-1-768x523.png 768w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_2-1.png 1106w" width="1106" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_2-1.png" alt="Impression shows the selected Arch ISO and, below it, the selectable USB drives." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e9170b140&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e9170b140" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" height="753" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_1-1-640x436.png 640w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_1-1-768x523.png 768w, https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_1-1.png 1106w" width="1106" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2023/06/impression-gtk4-imagetool_1-1.png" alt="Impression's start window only offers a button for opening an image." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>
</figure>



<p class="wp-block-paragraph">For KDE Plasma users, there is <a href="https://apps.kde.org/isoimagewriter/">ISO Image Writer</a> as an alternative. The program integrates cleanly into the desktop environment and is fairly lightweight. Until now, there was no such small program for GNOME. Until now. For a few days, Impression (<a href="https://gitlab.com/adhami3310/Impression">GitLab</a>, <a href="https://flathub.org/apps/io.gitlab.adhami3310.Impression">Flatpak</a>) has offered fans of GTK desktops a modern option based on GTK4 for writing ISO images. It&#8217;s easy to use: launch the program, select the ISO image and the target, write the image, done. Mistakes can&#8217;t happen here, because Impression only offers USB sticks and memory cards as targets, never hard disks.</p>



<p class="wp-block-paragraph">At the moment, you won&#8217;t find Impression in the repositories of the usual Linux distributions yet. Installing it via Flatpak works without a hitch, though. The application&#8217;s version counter currently stands at 1.0.0, and the source code has only been online for a few days. That&#8217;s sure to change quickly, however. And it surely won&#8217;t be long before GNOME adds the project to its steadily growing <a href="https://circle.gnome.org/">GNOME Circle</a>, giving it considerably more visibility.</p>

<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/impression-gtk4-tool-for-flashing-iso-images/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Checking USB Sticks and SD Cards for Errors</title>
		<link>https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/</link>
					<comments>https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Wed, 08 Dec 2021 17:10:11 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/</guid>

					<description><![CDATA[Unlike hard disks, USB sticks and SD memory cards have no mechanical parts that wear out. Even so, modern flash memory breaks too. With Badblocks and F3, you can check flash memory for errors and expose fakes.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Lately I&#8217;ve often had the problem that the lousy sticks kept piling up at the top of the heap, so they were always the first ones in my hand when I reached into the junk box. At the latest when writing larger amounts of data, such as the ISO image of a Linux distribution or a Raspberry Pi OS image for a Raspberry Pi, problems appear. The read/write rate collapses, or more telling I/O errors show up right away. To rule this out, I want to check all my USB sticks and SD memory cards for errors once and sort out defective media for good. On Linux, you can do that with built-in tools.</p>



<h2 class="wp-block-heading">Checking USB sticks for errors</h2>



<p class="wp-block-paragraph">First, you need to find out the device ID of the USB stick or memory card. So plug the device into your computer or insert the SD card into the card reader and type <code>lsblk</code> in the terminal. The command lists all storage devices connected to the computer. As a rule, you can identify the device ID by the size of the device. In my example, the system attaches my 8 GB USB stick as <code>sdc</code> (that is, <code>/dev/sdc</code> in full). If you&#8217;re unsure, unplug the device you want to check and run <code>lsblk</code> again. If <code>sdc</code> is missing from the list, you have the right ID. Alternatively, graphical tools such as GNOME Disks also show the ID.</p>



<pre class="wp-block-preformatted">$ <strong>lsblk</strong>
[...]
sdc           8:32   1   7.5G  0 disk
├─sdc1        8:33   1   2.9G  0 part /run/media/toff/Ubuntu 21.10 amd64
├─sdc2        8:34   1   4.1M  0 part
└─sdc3        8:35   1   300K  0 part
[...]</pre>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6b04e917239f4&quot;}" data-wp-interactive="core/image" data-wp-key="6b04e917239f4" class="wp-block-image size-full wp-lightbox-container"><img loading="lazy" decoding="async" height="667" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung-640x443.png 640w, https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung-768x532.png 768w, https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung.png 963w" width="963" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on--pointerdown="actions.preloadImage" data-wp-on--pointerenter="actions.preloadImageWithDelay" data-wp-on--pointerleave="actions.cancelPreload" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung.png" alt="GNOME Disks shows the 8 GB USB stick with its device ID /dev/sdc." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">GNOME&#8217;s built-in Disks utility also shows the device IDs of hard disks, SSDs, USB sticks and other storage devices attached to the system.</figcaption></figure>



<p class="wp-block-paragraph">For the actual error check, the <code>badblocks</code> command from the <em>e2fsprogs</em> package comes into play, which is part of the standard installation of the usual distributions. Badblocks may refuse to start the check at first because the drive is supposedly in use by the system. This usually happens because the operating system mounts the device automatically as soon as you plug in the USB stick. On my system, clicking the eject icon in the file manager isn&#8217;t enough; I have to unmount the device ID of the drive and its partitions explicitly with <code>umount</code>.</p>



<p class="has-luminous-vivid-orange-background-color has-background wp-block-paragraph"><strong>Caution:</strong> I have to issue a warning at this point: when checking for errors, Badblocks overwrites all data and partitions on the specified device. So make absolutely sure you pass the right device ID to the command, and back up important data from the USB stick or SD memory card beforehand. If the worst happens, you won&#8217;t be able to recover the data after the check.</p>



<pre class="wp-block-preformatted">$ <strong>sudo badblocks -wsv /dev/sdc</strong>
/dev/sdc is apparently in use by the system; it's not safe to run badblocks!
$ <strong>sudo umount /dev/sdc*</strong>
umount: /dev/sdc: not mounted.
umount: /dev/sdc2: not mounted.
umount: /dev/sdc3: not mounted.</pre>



<p class="wp-block-paragraph">When calling Badblocks, you pass the parameters <code>-wsv</code> and the device ID. The parameters tell the program to run a destructive write test (<code>-w</code>), show the progress (<code>-s</code>) and output more information in general (<code>-v</code>). The thorough test writes every block of the device four times in a row with different patterns (0xaa, 0x55, 0xff and 0x00). Depending on speed and capacity, you need to allow quite some time for this. Checking the USB 2.0 stick with 8 GB of capacity from my example took more than an hour.</p>



<pre class="wp-block-preformatted">$ <strong>sudo badblocks -wsv /dev/sdc</strong>
Testing with pattern 0xaa:   0.00% done, 0:00 elapsed. (0/0/0 errors) done
Reading and comparing: done
Testing with pattern 0x55:   0.00% done, 23:47 elapsed. (0/0/0 errors) done
Reading and comparing: done
Testing with pattern 0xff:   0.00% done, 47:33 elapsed. (0/0/0 errors) done
Reading and comparing: done
Testing with pattern 0x00:   0.00% done, 1:11:26 elapsed. (0/0/0 errors) done
Reading and comparing: done</pre>



<p class="wp-block-paragraph">Besides the destructive method, Badblocks supports a non-destructive read-write mode. You enable it with the <code>-n</code> parameter instead of <code>-w</code>. In this variant, Badblocks first backs up the data of the block being checked to RAM, then overwrites the block with random data and checks whether the data was written correctly. Finally, Badblocks writes the backup back to the device. At first glance, this routine seems faster because there is only one pass, but in practice backing up and restoring the existing data takes considerably more time. In my example, it took more than 2.5 hours instead of just over one hour.</p>



<pre class="wp-block-preformatted">$ <strong>sudo badblocks -nsv /dev/sdc</strong>
Checking for bad blocks in non-destructive read-write mode
From block 0 to 7812607
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern:  94.36% done, 2:35:18 elapsed. (0/0/0 errors)</pre>



<h2 class="wp-block-heading">Detecting fake USB sticks</h2>



<p class="wp-block-paragraph">The tool <a href="https://github.com/AltraMayor/f3">F3</a>, short for Fight Flash Fraud, goes one step further. The open-source program thoroughly checks whether a storage device really has the capacity it claims to have. Unfortunately, this is still a relevant topic, especially if you buy super cheap deals online. To expose fake USB sticks or SD memory cards, install the program from your distribution&#8217;s repositories. Debian, Ubuntu, Fedora and others carry the command-line tool in their official repositories; the package is usually called <em>f3</em>. Arch Linux only has the program in the AUR, so you need an AUR helper to install it.</p>



<pre class="wp-block-preformatted">### Installation on Arch Linux or Manjaro:
$ <strong>yay -S f3</strong>
### Installation on Debian, Ubuntu or Raspberry Pi OS:
$ <strong>sudo apt install f3</strong></pre>



<p class="wp-block-paragraph">The commands for checking USB storage are <code>f3write</code>, <code>f3read</code> and <code>f3probe</code>. You have to use the first two in combination, passing each the mount point of the device as an option. <code>f3write</code> keeps writing one-gigabyte files to the mounted device until it runs out of space. Then you use <code>f3read</code> to check whether the written data can really be read back. If the device is a fake USB stick or a manipulated SD memory card, <code>f3read</code> would report corrupted sectors. This check leaves all data on the device intact; you just have to delete the h2w files at the end, otherwise there&#8217;s no space left on the stick.</p>



<pre class="wp-block-preformatted">$ <strong>f3write /run/media/toff/291E-6F9C</strong>
[...]
Free space: 3.72 GB
Creating file 1.h2w ... OK!
Creating file 2.h2w ... OK!
Creating file 3.h2w ... OK!
Creating file 4.h2w ... OK!
Free space: 0.00 Byte
Average writing speed: 3.91 MB/s
$ <strong>f3read /run/media/toff/291E-6F9C</strong>
[...]
                  SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 2097152/        0/      0/      0
Validating file 2.h2w ... 2097152/        0/      0/      0
Validating file 3.h2w ... 2097152/        0/      0/      0
Validating file 4.h2w ... 1518736/        0/      0/      0

  Data OK: 3.72 GB (7810192 sectors)
Data LOST: 0.00 Byte (0 sectors)
	       Corrupted: 0.00 Byte (0 sectors)
	Slightly changed: 0.00 Byte (0 sectors)
	     Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 14.73 MB/s
$ <strong>ls -al /run/media/toff/291E-6F9C</strong>
total 3907596
drwxr-xr-x  3 toff toff       4096 Jan  1  1970 .
drwxr-x---+ 4 root root         80 Dec  7 16:27 ..
-rw-r--r--  1 toff toff 1073741824 Dec  7 18:35 1.h2w
-rw-r--r--  1 toff toff 1073741824 Dec  7 18:40 2.h2w
-rw-r--r--  1 toff toff 1073741824 Dec  7 18:44 3.h2w
-rw-r--r--  1 toff toff  777592832 Dec  7 18:47 4.h2w
[...]</pre>



<p class="wp-block-paragraph"><code>f3probe --destructive</code> works a little faster. The <code>--destructive</code> option is optional, but it speeds things up considerably. In this test, F3 only writes the sectors it absolutely needs and doesn&#8217;t bother with backing up data. Since the probe accesses the hardware directly, you pass the device ID (here <code>/dev/sdg</code>) instead of the mount point. This way, the test with my 4 GB USB 2.0 stick takes only a little more than seven minutes. Keep in mind again, though, that this routine overwrites all data blocks on the device.</p>



<pre class="wp-block-preformatted">$ <strong>f3probe --destructive --time-ops /dev/sdg</strong>
[...]
Good news: The device `/dev/sdg' is the real thing

Device geometry:
	         *Usable* size: 3.73 GB (7831552 blocks)
	        Announced size: 3.73 GB (7831552 blocks)
	                Module: 4.00 GB (2^32 Bytes)
	Approximate cache size: 0.00 Byte (0 blocks), need-reset=no
	   Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 7'17"
 Operation: total time / count = avg time
      Read: 2.73s / 4812 = 568us
     Write: 7'13" / 3637313 = 119us
     Reset: 1us / 1 = 1us</pre>



<p class="wp-block-paragraph">Both Badblocks and F3 help you analyze errors on storage devices. You always need to bring a bit of time for the check, though. A thorough analysis of an 8 GB USB stick can easily take two hours, especially if the data is to be preserved during the check and the stick only supports the slow USB 2.0 protocol. Afterward, however, you can assume that the USB stick or SD memory card really works and has the capacity printed on the label.</p>


<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
