Where am I hitting the invisible SD card cache?2019 Community Moderator ElectionOptimal Linux Distro to Install to SD card to use as USB-Bootloader for PC?Linux support for new Sony Vaio Z external graphics card?Udev triggers are not firing on insert of CF card into USB card reader (anymore)Mount an SD card over USB?Set PERM_WRITE_PROTECT on an SD cardReduce cache size of flash storage deviceswhat's the difference between page cache and buffer cache?How to know which user agent is hitting my server?Where to set kernelns buffer/cache sizeWhere does kernel define the SD card naming index?

When is "ei" a diphthong?

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?

Would a primitive species be able to learn English from reading books alone?

What does "tick" mean in this sentence?

How were servants to the Kaiser of Imperial Germany treated and where may I find more information on them

Why does a 97 / 92 key piano exist by Bösendorfer?

Echo with obfuscation

Why do Radio Buttons not fill the entire outer circle?

How can I safely use "Thalidomide" in my novel while respecting the trademark?

Do I have to know the General Relativity theory to understand the concept of inertial frame?

Why is the Sun approximated as a black body at ~ 5800 K?

Personal or impersonal in a technical resume

Integral Notations in Quantum Mechanics

What is this high flying aircraft over Pennsylvania?

Should I warn new/prospective PhD Student that supervisor is terrible?

Deciphering cause of death?

In One Punch Man, is King actually weak?

Do I have to take mana from my deck or hand when tapping a dual land?

Should I assume I have passed probation?

Pre-Employment Background Check With Consent For Future Checks

How would a solely written language work mechanically

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

Is there anyway, I can have two passwords for my wi-fi



Where am I hitting the invisible SD card cache?



2019 Community Moderator ElectionOptimal Linux Distro to Install to SD card to use as USB-Bootloader for PC?Linux support for new Sony Vaio Z external graphics card?Udev triggers are not firing on insert of CF card into USB card reader (anymore)Mount an SD card over USB?Set PERM_WRITE_PROTECT on an SD cardReduce cache size of flash storage deviceswhat's the difference between page cache and buffer cache?How to know which user agent is hitting my server?Where to set kernelns buffer/cache sizeWhere does kernel define the SD card naming index?










0















I'm trying to clear an SD card connected via a USB dongle.



Here's what I do:



# dd if=/dev/zero of=/dev/sdb bs=$((1024*4))
dd: error writing '/dev/sdb': No space left on device
1002267+0 records in
1002266+0 records out
4105281536 bytes (4.1 GB, 3.8 GiB) copied, 2.10549 s, 1.9 GB/s


The weird things I see are: This is an SD HC I card, so the transfer should never reach 1.9GB/s. The card is 16GB and correctly reports as such in dmesg.



Ok, let's check it's written:



# head -c 4105281536 /dev/zero | sha1sum 
a1750724bfbf0ada57d986f16b26e789a6c61a1d -
(reverse-i-search)`': ^C
# head -c 4105281536 /dev/sdb | sha1sum
a1750724bfbf0ada57d986f16b26e789a6c61a1d -


Seems ok. But when I plug is out and in again, it magically has the same filesystem available as before.
When I mount them and change the files, the modification is also persisted, even though the sha1sum still shows it as zeros.



The device is definitely /dev/sdb:



[ 9895.437518] scsi 4:0:0:0: Direct-Access Mass Storage Device PQ: 0 ANSI: 0 CCS
[ 9895.439248] sd 4:0:0:0: [sdb] 30318592 512-byte logical blocks: (15.5 GB/14.5 GiB)
[ 9895.439398] sd 4:0:0:0: [sdb] Write Protect is off
[ 9895.439404] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 9895.439557] sd 4:0:0:0: [sdb] No Caching mode page found
[ 9895.439564] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 9895.441922] sdb: sdb1 sdb2
[ 9895.443517] sd 4:0:0:0: [sdb] Attached SCSI removable disk


What's happening here?



Running on kernel 4.20.3.










share|improve this question


























    0















    I'm trying to clear an SD card connected via a USB dongle.



    Here's what I do:



    # dd if=/dev/zero of=/dev/sdb bs=$((1024*4))
    dd: error writing '/dev/sdb': No space left on device
    1002267+0 records in
    1002266+0 records out
    4105281536 bytes (4.1 GB, 3.8 GiB) copied, 2.10549 s, 1.9 GB/s


    The weird things I see are: This is an SD HC I card, so the transfer should never reach 1.9GB/s. The card is 16GB and correctly reports as such in dmesg.



    Ok, let's check it's written:



    # head -c 4105281536 /dev/zero | sha1sum 
    a1750724bfbf0ada57d986f16b26e789a6c61a1d -
    (reverse-i-search)`': ^C
    # head -c 4105281536 /dev/sdb | sha1sum
    a1750724bfbf0ada57d986f16b26e789a6c61a1d -


    Seems ok. But when I plug is out and in again, it magically has the same filesystem available as before.
    When I mount them and change the files, the modification is also persisted, even though the sha1sum still shows it as zeros.



    The device is definitely /dev/sdb:



    [ 9895.437518] scsi 4:0:0:0: Direct-Access Mass Storage Device PQ: 0 ANSI: 0 CCS
    [ 9895.439248] sd 4:0:0:0: [sdb] 30318592 512-byte logical blocks: (15.5 GB/14.5 GiB)
    [ 9895.439398] sd 4:0:0:0: [sdb] Write Protect is off
    [ 9895.439404] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
    [ 9895.439557] sd 4:0:0:0: [sdb] No Caching mode page found
    [ 9895.439564] sd 4:0:0:0: [sdb] Assuming drive cache: write through
    [ 9895.441922] sdb: sdb1 sdb2
    [ 9895.443517] sd 4:0:0:0: [sdb] Attached SCSI removable disk


    What's happening here?



    Running on kernel 4.20.3.










    share|improve this question
























      0












      0








      0








      I'm trying to clear an SD card connected via a USB dongle.



      Here's what I do:



      # dd if=/dev/zero of=/dev/sdb bs=$((1024*4))
      dd: error writing '/dev/sdb': No space left on device
      1002267+0 records in
      1002266+0 records out
      4105281536 bytes (4.1 GB, 3.8 GiB) copied, 2.10549 s, 1.9 GB/s


      The weird things I see are: This is an SD HC I card, so the transfer should never reach 1.9GB/s. The card is 16GB and correctly reports as such in dmesg.



      Ok, let's check it's written:



      # head -c 4105281536 /dev/zero | sha1sum 
      a1750724bfbf0ada57d986f16b26e789a6c61a1d -
      (reverse-i-search)`': ^C
      # head -c 4105281536 /dev/sdb | sha1sum
      a1750724bfbf0ada57d986f16b26e789a6c61a1d -


      Seems ok. But when I plug is out and in again, it magically has the same filesystem available as before.
      When I mount them and change the files, the modification is also persisted, even though the sha1sum still shows it as zeros.



      The device is definitely /dev/sdb:



      [ 9895.437518] scsi 4:0:0:0: Direct-Access Mass Storage Device PQ: 0 ANSI: 0 CCS
      [ 9895.439248] sd 4:0:0:0: [sdb] 30318592 512-byte logical blocks: (15.5 GB/14.5 GiB)
      [ 9895.439398] sd 4:0:0:0: [sdb] Write Protect is off
      [ 9895.439404] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
      [ 9895.439557] sd 4:0:0:0: [sdb] No Caching mode page found
      [ 9895.439564] sd 4:0:0:0: [sdb] Assuming drive cache: write through
      [ 9895.441922] sdb: sdb1 sdb2
      [ 9895.443517] sd 4:0:0:0: [sdb] Attached SCSI removable disk


      What's happening here?



      Running on kernel 4.20.3.










      share|improve this question














      I'm trying to clear an SD card connected via a USB dongle.



      Here's what I do:



      # dd if=/dev/zero of=/dev/sdb bs=$((1024*4))
      dd: error writing '/dev/sdb': No space left on device
      1002267+0 records in
      1002266+0 records out
      4105281536 bytes (4.1 GB, 3.8 GiB) copied, 2.10549 s, 1.9 GB/s


      The weird things I see are: This is an SD HC I card, so the transfer should never reach 1.9GB/s. The card is 16GB and correctly reports as such in dmesg.



      Ok, let's check it's written:



      # head -c 4105281536 /dev/zero | sha1sum 
      a1750724bfbf0ada57d986f16b26e789a6c61a1d -
      (reverse-i-search)`': ^C
      # head -c 4105281536 /dev/sdb | sha1sum
      a1750724bfbf0ada57d986f16b26e789a6c61a1d -


      Seems ok. But when I plug is out and in again, it magically has the same filesystem available as before.
      When I mount them and change the files, the modification is also persisted, even though the sha1sum still shows it as zeros.



      The device is definitely /dev/sdb:



      [ 9895.437518] scsi 4:0:0:0: Direct-Access Mass Storage Device PQ: 0 ANSI: 0 CCS
      [ 9895.439248] sd 4:0:0:0: [sdb] 30318592 512-byte logical blocks: (15.5 GB/14.5 GiB)
      [ 9895.439398] sd 4:0:0:0: [sdb] Write Protect is off
      [ 9895.439404] sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00
      [ 9895.439557] sd 4:0:0:0: [sdb] No Caching mode page found
      [ 9895.439564] sd 4:0:0:0: [sdb] Assuming drive cache: write through
      [ 9895.441922] sdb: sdb1 sdb2
      [ 9895.443517] sd 4:0:0:0: [sdb] Attached SCSI removable disk


      What's happening here?



      Running on kernel 4.20.3.







      linux usb removable-storage






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 20 hours ago









      viraptorviraptor

      1927




      1927




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I notice dd it only copies 3.8 GiB when the drive is 14.5 GiB. So what you're writing to is most likely not the sd card. Unplug the SD card and then check ls -lh /dev/sdb.



          I suspect you have accidentally created a regular file on /dev called /dev/sdb. Since /dev is a ram disk it explains why you can write to it at 2GBps



          When you've finished your dd command, remember to sync just in case. This will tell the kernel to flush any cache it has.






          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507388%2fwhere-am-i-hitting-the-invisible-sd-card-cache%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I notice dd it only copies 3.8 GiB when the drive is 14.5 GiB. So what you're writing to is most likely not the sd card. Unplug the SD card and then check ls -lh /dev/sdb.



            I suspect you have accidentally created a regular file on /dev called /dev/sdb. Since /dev is a ram disk it explains why you can write to it at 2GBps



            When you've finished your dd command, remember to sync just in case. This will tell the kernel to flush any cache it has.






            share|improve this answer



























              0














              I notice dd it only copies 3.8 GiB when the drive is 14.5 GiB. So what you're writing to is most likely not the sd card. Unplug the SD card and then check ls -lh /dev/sdb.



              I suspect you have accidentally created a regular file on /dev called /dev/sdb. Since /dev is a ram disk it explains why you can write to it at 2GBps



              When you've finished your dd command, remember to sync just in case. This will tell the kernel to flush any cache it has.






              share|improve this answer

























                0












                0








                0







                I notice dd it only copies 3.8 GiB when the drive is 14.5 GiB. So what you're writing to is most likely not the sd card. Unplug the SD card and then check ls -lh /dev/sdb.



                I suspect you have accidentally created a regular file on /dev called /dev/sdb. Since /dev is a ram disk it explains why you can write to it at 2GBps



                When you've finished your dd command, remember to sync just in case. This will tell the kernel to flush any cache it has.






                share|improve this answer













                I notice dd it only copies 3.8 GiB when the drive is 14.5 GiB. So what you're writing to is most likely not the sd card. Unplug the SD card and then check ls -lh /dev/sdb.



                I suspect you have accidentally created a regular file on /dev called /dev/sdb. Since /dev is a ram disk it explains why you can write to it at 2GBps



                When you've finished your dd command, remember to sync just in case. This will tell the kernel to flush any cache it has.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 16 hours ago









                Philip CoulingPhilip Couling

                1,964920




                1,964920



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507388%2fwhere-am-i-hitting-the-invisible-sd-card-cache%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                    Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                    Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.