0

There is some weird thing I don't understand:

I have 2G block.img file with an ext4 filesystem inside. There is a 2G test.txt file in block.img. test.txt consists of letters 'a'. Then I mount block.img to /mnt/first. And I can see this test.txt with letters 'a' inside. All is fine.

Weird thing begins here: simultaneously I mount block.img on /mnt/second and change all 'a' to 'b' in this text file. And I can see two different 2G files. I have two files 2G (4G used space) on one 2G partition! Unbelievable (:

Therefore, there is some mistake in my words, unfortunately I can't find it.

Mat
  • 52,586
rush
  • 27,403
  • 1
    How exactly did you change a to b? How do you force the mount a second time? – Nils Dec 14 '11 at 19:47
  • Actually I just rewrited file. And there is no need to force second mount. You can freely mount one device so many times as you want. – rush Dec 15 '11 at 04:24
  • How did you rewrite the file? Did you open it with an editor and replaced a with b? – Nils Dec 20 '11 at 21:50
  • What happens when you close /mnt/first/test.txt and reopen it ? Does it shows a or b ? – SHW Jun 29 '12 at 07:36
  • Oh, I forgot about my question. I've already found the answer. Thank you. – rush Jun 29 '12 at 07:54

1 Answers1

0

Actually the problem was that it is not network filesystem. Operation system doesn't expect that something else will modify the data at the partition. It also cache small files and it's physical place on partition, therefore seems like it doesn't change at all.

In case the size of partition will be much greater of RAM size and files will be huge enough it can lead to at least system error and died mount point or even to kernel panic.

So that's all is ok. Nothing strange. I was just a little impatient in my tests and made precipitate conclusion.

rush
  • 27,403