[dm-devel] Buffer I/O and journaling errors while using snapshot

cramerj cramerj at intel.com
Thu Jul 22 00:21:48 UTC 2004

I'm not too familiar with device mapper or filesystems yet, so please bear with me.

So I'm attempting to create a writeable snapshot of a read-only device in order to create a ramdisk overlay for temporary changes that will be discarded later.   DM seems to do the job.  However, after tinkering with the ramdisk overlay for awhile, I encounter Buffer I/O errors with "__journal_remove_journal_head: freeing b_frozen_data" messages.

>From what I understand, the ramdisk size should simply cover the changes incurred, not necessarily the full size of the read-only device.  Even so, doesn't the ramdisk size grow as needed?  Either way, I don't know if it's a case of running out of ramdisk space or physical memory, or something else I'm missing.

1GB physical ram
Size of MyImage.img is anywhere between 1.4GB and 3GB.

Here's the script and basic steps of what I'm doing to get the errors...

losetup /dev/loop0 MyImage.img
echo "0 `blockdev --getsize /dev/loop0` snapshot-origin /dev/loop0" | dmsetup create MyImage-ro
mkdir /mnt/MyImage-ro
mount -r /dev/mapper/MyImage-ro /mnt/MyImage-ro
losetup /dev/loop1 /dev/ram0
echo "0 `blockdev --getsize /dev/loop0` snapshot /dev/loop0 /dev/loop1 n 128" | dmsetup create COWDrive-rw
mkdir /mnt/COWDrive-rw
mount /dev/mapper/COWDrive-rw /mnt/COWDrive-rw

- I copy some files over to /mnt/COWDrive-rw/home/me/,
- do a mount --bind /proc /mnt/COWDrive-rw/proc because I'm messing with RPM,
- chroot into /mn/COWDrive, then do some file ops.

...and then come the errors.  After exiting the chroot environment, tear down the mounts and remove the dm's, I reboot.  However not everything unmounts cleanly because I get fsck'd on boot-up.

Am I running out of memory?  Is what I'm doing completely silly?


More information about the dm-devel mailing list