Check whether all data is flushed to usb flash from command line

Colin Law clanlaw at gmail.com
Fri Oct 6 19:34:39 UTC 2023


On Fri, 6 Oct 2023, 13:40 Josef Wolf, <jw at raven.inka.de> wrote:

> Hello,
>
> what is the proper way to check whether all (low-level) data is flushed to
> usb
> flash from command line?
>
> Please note that this question is NOT about
> - sync (flushing file system data)
> - umount (implies sync)
> - eject (implies umount)
> because all those commands are about file system level.
>

Are you sure that sync does not do what you want?

If you are sure, please convince me.

Colin


>
> When I do (for example):
>
> $ sudo dd bs=10M status=progress if=ubuntu-22.04.2-live-server-amd64.iso
> of=/dev/sdX
> $ sudo eject /dev/sdX
>
> then there is low-level buffering under the hood.
>
> At the moment I execute "eject", dmesg starts showing ugly things like:
>
>  [178454.973055] blk_update_request: I/O error, dev sdb, sector 488570480
> op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
>
> and reading back confirms that writing the contents aborted at some point
> in
> time.
>
> So how do I know that all (low-level) data has been flushed to the disk
> and it
> is safe to eject/unplug the usb drive?
>
> --
> Josef Wolf
> jw at raven.inka.de
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20231006/776581de/attachment.html>


More information about the ubuntu-users mailing list