Does mounting a USB device automatically modify it?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












Most popular desktop Linux distributions automatically mount USB storage devices when the devices are connected or at least provide an easy way to mount them from the GUI. Does mounting a USB storage device the "default" way (from the GUI) write anything to the device? It's simple enough to mount the device as read-only, but if I don't explicitly write to the device (with cp, touch, mkdir, etc.) will the operating system write anything in the background?



I have a hardware RAID controller for two USB hard drives configured in RAID 1. At some point I may want to remove the drives and examine them individually to make sure that content is being written to both and to check on the drives' health. I'm concerned that if I forget to mount the drives as read-only the operating system (in my case Manjaro Linux) might update something that I'm unaware of (perhaps "last time mounted" or "last time data was accessed") and break the RAID 1 setup.



Thank you for your time!







share|improve this question



















  • Some filesystems like ext2 to 4 have mount counts and last mount times that are updated on the disk if it is not mounted readonly. See man tune2fs for example. You could use iosnoop to trace all i/o to your device.
    – meuh
    Apr 27 at 18:00














up vote
4
down vote

favorite












Most popular desktop Linux distributions automatically mount USB storage devices when the devices are connected or at least provide an easy way to mount them from the GUI. Does mounting a USB storage device the "default" way (from the GUI) write anything to the device? It's simple enough to mount the device as read-only, but if I don't explicitly write to the device (with cp, touch, mkdir, etc.) will the operating system write anything in the background?



I have a hardware RAID controller for two USB hard drives configured in RAID 1. At some point I may want to remove the drives and examine them individually to make sure that content is being written to both and to check on the drives' health. I'm concerned that if I forget to mount the drives as read-only the operating system (in my case Manjaro Linux) might update something that I'm unaware of (perhaps "last time mounted" or "last time data was accessed") and break the RAID 1 setup.



Thank you for your time!







share|improve this question



















  • Some filesystems like ext2 to 4 have mount counts and last mount times that are updated on the disk if it is not mounted readonly. See man tune2fs for example. You could use iosnoop to trace all i/o to your device.
    – meuh
    Apr 27 at 18:00












up vote
4
down vote

favorite









up vote
4
down vote

favorite











Most popular desktop Linux distributions automatically mount USB storage devices when the devices are connected or at least provide an easy way to mount them from the GUI. Does mounting a USB storage device the "default" way (from the GUI) write anything to the device? It's simple enough to mount the device as read-only, but if I don't explicitly write to the device (with cp, touch, mkdir, etc.) will the operating system write anything in the background?



I have a hardware RAID controller for two USB hard drives configured in RAID 1. At some point I may want to remove the drives and examine them individually to make sure that content is being written to both and to check on the drives' health. I'm concerned that if I forget to mount the drives as read-only the operating system (in my case Manjaro Linux) might update something that I'm unaware of (perhaps "last time mounted" or "last time data was accessed") and break the RAID 1 setup.



Thank you for your time!







share|improve this question











Most popular desktop Linux distributions automatically mount USB storage devices when the devices are connected or at least provide an easy way to mount them from the GUI. Does mounting a USB storage device the "default" way (from the GUI) write anything to the device? It's simple enough to mount the device as read-only, but if I don't explicitly write to the device (with cp, touch, mkdir, etc.) will the operating system write anything in the background?



I have a hardware RAID controller for two USB hard drives configured in RAID 1. At some point I may want to remove the drives and examine them individually to make sure that content is being written to both and to check on the drives' health. I'm concerned that if I forget to mount the drives as read-only the operating system (in my case Manjaro Linux) might update something that I'm unaware of (perhaps "last time mounted" or "last time data was accessed") and break the RAID 1 setup.



Thank you for your time!









share|improve this question










share|improve this question




share|improve this question









asked Apr 27 at 16:53









Ender Wiggin

14814




14814











  • Some filesystems like ext2 to 4 have mount counts and last mount times that are updated on the disk if it is not mounted readonly. See man tune2fs for example. You could use iosnoop to trace all i/o to your device.
    – meuh
    Apr 27 at 18:00
















  • Some filesystems like ext2 to 4 have mount counts and last mount times that are updated on the disk if it is not mounted readonly. See man tune2fs for example. You could use iosnoop to trace all i/o to your device.
    – meuh
    Apr 27 at 18:00















Some filesystems like ext2 to 4 have mount counts and last mount times that are updated on the disk if it is not mounted readonly. See man tune2fs for example. You could use iosnoop to trace all i/o to your device.
– meuh
Apr 27 at 18:00




Some filesystems like ext2 to 4 have mount counts and last mount times that are updated on the disk if it is not mounted readonly. See man tune2fs for example. You could use iosnoop to trace all i/o to your device.
– meuh
Apr 27 at 18:00










1 Answer
1






active

oldest

votes

















up vote
4
down vote













The answer depends on the file system. Those typically used on removable devices (FAT32 or ExFAT) shouldn’t be modified on mount, but many file systems store their last mount time and update that every time they’re mounted. Even when mounted read-only, some file systems such as Ext3 or Ext4 are liable to replay their journal (if the file system is dirty) and thus be modified.



There are ways to force a really read-only mount. One approach works with any file system: you can set the underlying block device itself to be read-only, using blockdev --setro. Others are file system-specific; for the Ext family, you can use the ro,noload mount options. To do this on a system with auto-mounting enabled, you’d have to add a udev rule to protect the device before it’s mounted.






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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f440477%2fdoes-mounting-a-usb-device-automatically-modify-it%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    The answer depends on the file system. Those typically used on removable devices (FAT32 or ExFAT) shouldn’t be modified on mount, but many file systems store their last mount time and update that every time they’re mounted. Even when mounted read-only, some file systems such as Ext3 or Ext4 are liable to replay their journal (if the file system is dirty) and thus be modified.



    There are ways to force a really read-only mount. One approach works with any file system: you can set the underlying block device itself to be read-only, using blockdev --setro. Others are file system-specific; for the Ext family, you can use the ro,noload mount options. To do this on a system with auto-mounting enabled, you’d have to add a udev rule to protect the device before it’s mounted.






    share|improve this answer



























      up vote
      4
      down vote













      The answer depends on the file system. Those typically used on removable devices (FAT32 or ExFAT) shouldn’t be modified on mount, but many file systems store their last mount time and update that every time they’re mounted. Even when mounted read-only, some file systems such as Ext3 or Ext4 are liable to replay their journal (if the file system is dirty) and thus be modified.



      There are ways to force a really read-only mount. One approach works with any file system: you can set the underlying block device itself to be read-only, using blockdev --setro. Others are file system-specific; for the Ext family, you can use the ro,noload mount options. To do this on a system with auto-mounting enabled, you’d have to add a udev rule to protect the device before it’s mounted.






      share|improve this answer

























        up vote
        4
        down vote










        up vote
        4
        down vote









        The answer depends on the file system. Those typically used on removable devices (FAT32 or ExFAT) shouldn’t be modified on mount, but many file systems store their last mount time and update that every time they’re mounted. Even when mounted read-only, some file systems such as Ext3 or Ext4 are liable to replay their journal (if the file system is dirty) and thus be modified.



        There are ways to force a really read-only mount. One approach works with any file system: you can set the underlying block device itself to be read-only, using blockdev --setro. Others are file system-specific; for the Ext family, you can use the ro,noload mount options. To do this on a system with auto-mounting enabled, you’d have to add a udev rule to protect the device before it’s mounted.






        share|improve this answer















        The answer depends on the file system. Those typically used on removable devices (FAT32 or ExFAT) shouldn’t be modified on mount, but many file systems store their last mount time and update that every time they’re mounted. Even when mounted read-only, some file systems such as Ext3 or Ext4 are liable to replay their journal (if the file system is dirty) and thus be modified.



        There are ways to force a really read-only mount. One approach works with any file system: you can set the underlying block device itself to be read-only, using blockdev --setro. Others are file system-specific; for the Ext family, you can use the ro,noload mount options. To do this on a system with auto-mounting enabled, you’d have to add a udev rule to protect the device before it’s mounted.







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited Apr 27 at 18:29


























        answered Apr 27 at 18:02









        Stephen Kitt

        140k22302363




        140k22302363






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440477%2fdoes-mounting-a-usb-device-automatically-modify-it%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?