SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If mount sdc2 partition: mount -t ext4 -o ro /dev/sdc2 /mnt/bob2 then try to write file tihi 1.txt with command (of course unsuccessfully): touch /mnt/bob 2/tihi 1.txt
when I do md5sum /dev/sdc2 /
I get a different md5 hash than before, although my partition can only Read-only, I don't why?
If mount sdc2 partition: mount -t ext4 -o ro /dev/sdc2 /mnt/bob2 then try to write file tihi 1.txt with command (of course unsuccessfully): touch /mnt/bob 2/tihi 1.txt
when I do md5sum /dev/sdc2 /
I get a different md5 hash than before, although my partition can only Read-only, I don't why?
If mount sdc2 partition: mount -t ext4 -o ro /dev/sdc2 /mnt/bob2 then try to write file tihi 1.txt with command (of course unsuccessfully): touch /mnt/bob 2/tihi 1.txt
when I do md5sum /dev/sdc2 /
I get a different md5 hash than before, although my partition can only Read-only, I don't why?
best,
John
I think checksum different because, on partition every time write information about last mount
Or fsck write information about checking filesystem
Last edited by StreamThreader; 11-04-2021 at 06:26 PM.
I think checksum different because, on partition every time write information about last mount
Or fsck write information about checking filesystem
Exactly, even if you mount a filesystem in read-only mode, this only means that files inside the filesystem can't be modified.
The filesystem itself (and so the content of the partition) are modified during a mount, eg. the superblock last mount timestamp gets updated.
You can check it with the following command:
Code:
# tune2fs -l /dev/sdc2 | grep time
Last mount time: Fri Nov 5 09:07:47 2021
Last write time: Wed Apr 28 14:47:26 2021
Lifetime writes: 2765 GB
In computer forensics there are hardware "forensics bridges" that blocks write commands to the destination drives.
Some forensics linux live distro (eg. Caine) use the trick of removing write permission on the device itself to avoid writes, and it seems to work:
Then clearly the difference is just the change due to the mount, not the attempted write. To demonstrate that simply omit the write operation and you will see the sum changes depending on whether the partition is mounted or not, and the write operation is a red herring.
The reason, as noted by others, is that mount parameters in the partition's table are updated by the mount action itself.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.