Control: reassign -1 src:linux Hi,
(reassigning to src:linux, because I think thats where the problem "is" - mount is the messenger) * GSR <gsr.b...@infernal-iceberg.com> [230122 02:30]: > Package: mount > Version: 2.38.1-4 > Severity: normal > > Hello, > > I have been trying different commands to temporarily mount a partition > as read-only in a different place than the one declared in fstab > (which will be used by a different partition). I tried simple commands > and ended passing all long parameters hoping it was a > misunderstanding: > > ---8<--- > # umount /dev/mapper/VGSeagate1500-LVStorageA > # mount --verbose --type ext4 --options-source disable --options ro,noload > --source /dev/mapper/VGSeagate1500-LVStorageA --target /mnt/storage-b > mount: /mnt/storage-b: /dev/mapper/VGSeagate1500-LVStorageA already mounted > or mount point busy. > dmesg(1) may have more information after failed mount system call. > # mount --verbose --type ext4 --options-source disable --options relatime > --source /dev/mapper/VGSeagate1500-LVStorageA --target /mnt/storage-b > mount: /dev/mapper/VGSeagate1500-LVStorageA mounted on /mnt/storage-b. > --->8--- > > The man page says "To prevent this kind of write access, you may want > to mount an ext3 or ext4 filesystem with the ro,noload mount options > or set the block device itself to read-only mode, see the blockdev(8) > command." That is "or", not "and", and failed anyway. > > Replacing "ro,noload" with "relatime" lets it mount, but RW. The only > text in dmesg is "dm-10: Can't mount, would change RO state" when it > fails. I also tried removing the line from /etc/fstab (assuming it was > getting in the way, even with "--options-source disable"), still not > mounting as read-only. > > OK, lets try with blockdev too: > > ---8<--- > # umount /dev/mapper/VGSeagate1500-LVStorageA > # blockdev --getro /dev/mapper/VGSeagate1500-LVStorageA > 0 > # blockdev --setro /dev/mapper/VGSeagate1500-LVStorageA > # blockdev --getro /dev/mapper/VGSeagate1500-LVStorageA > 1 > # mount --verbose --type ext4 --options-source disable --options ro,noload > --source /dev/mapper/VGSeagate1500-LVStorageA --target /mnt/storage-b > mount: /mnt/storage-b: /dev/mapper/VGSeagate1500-LVStorageA already mounted > or mount point busy. > dmesg(1) may have more information after failed mount system call. > # mount --verbose --type ext4 --options-source disable --options relatime > --source /dev/mapper/VGSeagate1500-LVStorageA --target /mnt/storage-b > mount: /mnt/storage-b: /dev/mapper/VGSeagate1500-LVStorageA already mounted > or mount point busy. > dmesg(1) may have more information after failed mount system call. > # blockdev --setrw /dev/mapper/VGSeagate1500-LVStorageA > # blockdev --getro /dev/mapper/VGSeagate1500-LVStorageA > 0 > # mount --verbose --type ext4 --options-source disable --options relatime > --source /dev/mapper/VGSeagate1500-LVStorageA --target /mnt/storage-b > mount: /dev/mapper/VGSeagate1500-LVStorageA mounted on /mnt/storage-b. > --->8--- > > This is even worse, no mount possible until "--setrw". dmesg showed > "/dev/mapper/VGSeagate1500-LVStorageA: Can't open blockdev" and > "dm-10: Can't mount, would change RO state" after the first "--options > realtime" cmd (while getro = 1). I assume the "change RO state" now > means to writable, and the other times was to not writable. > > Maybe the bug is in the man page (needs update to newer procedure?), > maybe bug in code (mount? filesystem? LVM?). There must be a way to > mount read-only as initial state (not via second invocation with > "remount,ro", which works), to avoid even the tiniest window of > writability (not important for my usage, but surely for others). And > if not possible anymore (uh? since when?), it could be explicitly > documented. As far as I know, this was never possible. If ext3/4 determines it needs to replay journal, it cannot mount ro. But that's just my understanding of things, maybe the linux people have more insight. kernel log messages would be very useful, I would imagine. Chris