3

I have an old ext4 disk partition that I have to investigate without disturbing it. So I copied the complete partition to an image file and mounted that image file while continuing my investigation.

Now while I do not write to the mounted filesystem, I do have to mount it with read/write access, because one of the programs makes assumptions on what I intend to do, and requires write access, even though I do not intend to write to it. You know the kind of 'smart' programs.

Now the problem is that, when mounting an ext4 filesystem read/write, the last mount point is written into the filesystem itself, i.e. the mount command changes my image file, including file access time and file modification time. That is annoying for a lot of other reasons. I cannot find an option in mount(8) nor in ext4(5) to avoid this.

Is there another way to mount with read/write access, without the mount command writing to the filesystem?

6
  • 6
    I don't have enough practical experience with it to properly suggest it, but OverlayFS could be useful to put a writeable separate layer over your image file. Feb 17, 2020 at 16:06
  • I don't know about the "write the last mount point" issue, but the lazytime option should at least inhibit the on-disk update of atime/mtime/ctime.
    – AdminBee
    Feb 17, 2020 at 16:08
  • This isn’t all that helpful, but on Ext4, the mount point is stored the first time a file is opened in a file system, not when the file system is mounted. Feb 18, 2020 at 10:20
  • @AdminBee I use the noatime mount option; mtime and ctime won't change as long as I don't create or modify files, I guess.
    – db-inf
    Feb 20, 2020 at 13:12
  • @StephenKitt Not immediately helpfull, but interesting.
    – db-inf
    Feb 20, 2020 at 13:13

1 Answer 1

3

I agree with @UlrichSchwarz mount it read-only, then use overlayFS or unionFS to create a writeable file-system. You can make the writable layer (the bit where the modifications go, disposable, or persistent. Ether way the changes are not stored on the master file-system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .