0

I create an LVM snapshot of a mounted ext4 fs:

lvcreate -L 10GiB -s -n "root-snapshot" "/dev/myvgname/root"

If I then run e2fsck on /dev/myvgname/root-snapshot, it says:

e2fsck 1.42.5 (29-Jul-2012)
Clearing orphaned inode 263640 (uid=0, gid=0, mode=0100600, size=0)
Clearing orphaned inode 260744 (uid=0, gid=0, mode=0100600, size=0)
Clearing orphaned inode 266864 (uid=0, gid=0, mode=0100600, size=0)
Clearing orphaned inode 261058 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 261057 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 261001 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 260918 (uid=103, gid=107, mode=0100600, size=0)
Clearing orphaned inode 260913 (uid=103, gid=107, mode=0100600, size=0)
root: clean, 52533/977280 files, 811160/3905536 blocks

Why is it clearing those orphaned inodes? Shouldn't LVM make the underlying fs be in a consistent (clean) state?

2
  • The filesystem OVERLAYS the block device (LVM) - so no it can't ensure the filesystem is consistent. That's your job.
    – symcbean
    Sep 16, 2013 at 12:04
  • 1
    @symcbean: from man fsfreeze: The device-mapper (and LVM) automatically freezes filesystem on the device when a snapshot creation is requested.
    – dragonroot
    Sep 16, 2013 at 12:27

1 Answer 1

2

When a snapshot is taken, the filesystem is frozen, but that state is not exactly the same as the one of a cleanly unmounted filesystem. From man fsfreeze:

Note that even after freezing, the on-disk filesystem  can  con‐
tain  information  on  files  that  are  still in the process of
unlinking.  These files will not be unlinked until the  filesys‐
tem is unfrozen or a clean mount of the snapshot is complete.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .