On Apr 16, 2014, at 2:46 AM, Wayne Chou <gmmark12@xxxxxxxxx> wrote: > I create a LVM snapshot from a mounted ext4 file system by: > "lvcreate -kn --snapshot --name snap1 /dev/mapper/vg1/lv1" > > And after I mount this snapshot to another folder like: > "mount -t ext4 /dev/mapper/vg1-snap1 /mnt/test" > the following messages prompted in dmesg: > > [ 2445.480908] EXT4-fs (dm-6): orphan cleanup on readonly fs > [ 2445.502317] EXT4-fs (dm-6): ext4_orphan_cleanup: deleting > unreferenced inode 131180 > [ 2445.502355] EXT4-fs (dm-6): ext4_orphan_cleanup: deleting > unreferenced inode 131176 > [ 2445.502360] EXT4-fs (dm-6): ext4_orphan_cleanup: deleting > unreferenced inode 131175 > [ 2445.502366] EXT4-fs (dm-6): ext4_orphan_cleanup: deleting > unreferenced inode 131174 > [ 2445.502372] EXT4-fs (dm-6): ext4_orphan_cleanup: deleting > unreferenced inode 131173 > [ 2445.502376] EXT4-fs (dm-6): 5 orphan inodes deleted The first question is whether you are experiencing any actual problems as a result of the orphan inode cleanup? This is normal behaviour if there are applications with open-unlinked files when the snapshot is taken, or if the system crashes at this point. The orphan cleanup will free up these open-unlinked inodes and their blocks at mount time, keeping the filesystem consistent. > To find out what the reason is, I use 'lsof' on lv1's mount point before I take > the snapshot. Then I got some MySQL services that opened these temporary files > which causes the orphan inodes in LVM snapshots: > mysqld 26257 admin 7u REG 253,5 0 131173 > /LV1/.system/tmp/ibTidhzb (deleted) > mysqld 26257 admin 8u REG 253,5 0 131174 > /LV1/.system/tmp/ibgWhCYc (deleted) > mysqld 26257 admin 9u REG 253,5 0 131175 > /LV1/.system/tmp/ibJE5pne (deleted) > mysqld 26257 admin 10u REG 253,5 0 131176 > /LV1/.system/tmp/ibsvL9hg (deleted) > mysqld 26257 admin 14u REG 253,5 0 131180 > /LV1/.system/tmp/ibcz1qOM (deleted) > > > From the above investigation, the problem gets solved if I > disable the MySQL service before taking the LVM snapshot. > > However, I wonder if there's any other way to solve this issue. > For example, can I just blindly remove these orphan inodes when > ext4_freeze() is called? Thank you. What problem needs to be solved? Is it just the printing of these error messages that is confusing, or something else? Cheers, Andreas
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail