Q wrt LVM snapshot of ext4 w/ external journal
Is it safe to mount an LVM2 snapshot of an ext4 fs that has an external journal?
My googling has revealed only that the snapshot procedure will cause the fs to checkpoint the journal (if that's the right term) but also that the fs will want to replay the journal when mounted, even if -o ro. If my journal is on an external device (NVRAM device in my case) I don't want the snapshot instance to interfere with the main on-line fs's use of the journal.
Is there any documentation, other than code, that describes this scenario?
If there is another, more appropriate, venue for my question please let me know.
Thank you,
--Larkin
Quoted 5 lines · On 4/13/2010 2:22 PM, [email protected] wrote:
It's safe to mount the LVM2 snapshot only if you use the mount option noload. This will prevent it from using the journal, which is good, since the journal is in use by the original file system. :-)
I was able to verify that mounting with noload worked as advertised. Thank you. The exact message was "mounted filesystem without journal".
Quoted 4 lines
Hopefully, mounting the snapshot without using noload _should_ fail, since the journal is already in use, but I'm not sure we have that check in place, so I don't recommend trying it on a production file system.
I also verified that mounting w/o noload causes the mount operation to fail. The message was "failed to claim external journal device".
When I unmounted the original fs so that the journal device was not in use and then tried to mount the snapshot w/o noload, the mounted snapshot was able to claim the journal. Of course I would never do that on purpose but I wanted to see what would happen. I believe this falls under the "don't do that or bad things will happen" category.
Thank you very much for your response to my query.
--Larkin
Quoted 9 lines · Larkin Lowrey
Is it safe to mount an LVM2 snapshot of an ext4 fs that has an external journal?
My googling has revealed only that the snapshot procedure will cause the fs to checkpoint the journal (if that's the right term) but also that the fs will want to replay the journal when mounted, even if -o ro. If my journal is on an external device (NVRAM device in my case) I don't want the snapshot instance to interfere with the main on-line fs's use of the journal.
It's safe to mount the LVM2 snapshot only if you use the mount option noload. This will prevent it from using the journal, which is good, since the journal is in use by the original file system. :-)
Quoted 1 line
Is there any documentation, other than code, that describes this scenario?
No, it's not documented. It probably should be.
Hopefully, mounting the snapshot without using noload _should_ fail, since the journal is already in use, but I'm not sure we have that check in place, so I don't recommend trying it on a production file system.
- Ted