Trouble getting LVM Snapshots w/ ext3 working on TSL 2.2
Arne Brodowski <[email protected]>
| Newsgroups | gmane.linux.trustix.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have some trouble getting LVM snapshots to work with ext3 filesystems
on a TSL 2.2 Box (Running Kernel 2.4.33.3-2tr).
A snapshot taken from a mounted volume can not be mounted because the
filesystem's need_recovery flag is set and the snapshot is read-only.
I create a snapshot with the following command:
# lvcreate -L10G -s -n backup /dev/vg00/lvm00
lvcreate -- WARNING: the snapshot will be automatically disabled once
it gets full
lvcreate -- INFO: using default snapshot chunk size of 64 KB for
"/dev/vg00/backup"
lvcreate -- doing automatic backup of "vg00"
lvcreate -- logical volume "/dev/vg00/backup" successfully created
Mounting the snapshot throws the following error:
# mount /dev/vg00/backup /mnt/lvm-snapshot/
mount: block device /dev/vg00/backup is write-protected, mounting
read-only
mount: wrong fs type, bad option, bad superblock on /dev/vg00/backup,
or too many mounted file systems
Searching online I read that i have to change a line in the kernel source:
> The other problem of ext3 and resierfs not being able to mount
> a snapshot was
> fixed by changing the following line in "linux/drives/md/lvm.c" from:
>
> /* lvm_do_lv_create calls fsync_dev_lockfs()/unlockfs() */
> /* #define LVM_VFS_ENHANCEMENT */
>
> to:
>
> /* lvm_do_lv_create calls fsync_dev_lockfs()/unlockfs() */
> #define LVM_VFS_ENHANCEMENT
I have done that, but now I am not able to compile the kernel, i gives
me the following error:
drivers/md/mddev.o(.text+0x83a9): In function `lvm_do_lv_create':
: undefined reference to `unlockfs'
drivers/md/mddev.o(.text+0x83ee): In function `lvm_do_lv_create':
: undefined reference to `fsync_dev_lockfs'
make: *** [vmlinux] Error 1
I have also downloaded the LVM 1.0.8 Sourcecode and issued "make" in the
PATCHES directory to create a Patch against the kernel-tree - applying
the auto-created patch (lvm-1.0.8-2.4.33.3-2tr.patch) doesn't solve the
problem and I also tried to apply the 2.4.20-VFS-lock.patch but it
doesn't apply clean and some hunks fail completly. I also tried applying
the patched in different orders or not at all, but as soon as I
uncomment the #define LVM_VFS_ENHANCEMENT the kernel-build will fail.
Does anyone has a hint for me how to solve this problem, so that I can
mount my snapshots?
Thanks a lot,
Arne Brodowski