Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
The filesystem OVERLAYS the block device (LVM) - so no it can't ensure the filesystem is consistent. That's your job. –  symcbean Sep 16 '13 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 '13 at 12:27
add comment

1 Answer

up vote 1 down vote accepted

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.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.