Rich Freeman via plug on 31 Oct 2023 08:02:11 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Cached USB Disk Info Weirdness / Fix a USB Disk


On Tue, Oct 31, 2023 at 10:09 AM Casey Bralla via plug
<plug@lists.phillylinux.org> wrote:
>
> How to clear this cached info and force a full re-reading of the USB disk structure without rebooting?

partprobe <device>

> Why does the cache even get involved?  Doesn't utilities such as fdisk simply bang the hardware?

The kernel creates device nodes for the partitions on the device, and
those have data structures in memory separate from the disk itself.
Most disk utilities that manipulate partition tables automatically
tell the kernel to re-read the partition table when they make changes.
Of course, dd being a low level utility doesn't do this, since it
doesn't even know what a partition table is, or whether you're
changing one.

I'm not sure what utilities read what data from where exactly.  Thumb
drives could also potentially have some internal logic that is
impacted by a hardware reset - I'm not sure that is a factor here but
it is something to think about.  Just about anything you plug into a
computer these days is itself a computer with memory/firmware/etc.

-- 
Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug