[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

VFS Semantics and "find"

From: John R. Graham
Subject: VFS Semantics and "find"
Date: Mon, 13 Jul 2009 12:43:39 -0400 (GMT-04:00)

Although it makes sense, I hadn't until recently realized that the VFS layer 
imposed the following semantic on mounted filesystems:  the filesystem type of 
the mount point is made to reflect the filesystem type of the mounted 
filesystem.  To illustrate the effect, consider the following command sequence:

    ceres ~ # umount /mnt/usb
    ceres ~ # find /mnt/usb -maxdepth 0 -printf "%F %p\n"
    rootfs /mnt/usb
    ceres ~ # mount /dev/sdb1 /mnt/usb
    ceres ~ # find /mnt/usb -maxdepth 0 -printf "%F %p\n"
    vfat /mnt/usb

Note that the reported filesystem type changed from "rootfs" to "vfat" after 
the mount.  As a result of this perfectly logical behavior, I've tripped over a 
subtle issue with my favorite little backup program (flexbackup). It's 
hard-coded to not back up filesystems of type "tmpfs" (and others like "proc" 
and "devfs"), which is generally a good thing. But since the filesystem type of 
the mount point is a reflection of the mounted filesystem type, flexbackup 
fails to backup empty directories that are the mount points of those special 
filesystems.  After a recent RAID subsystem write hole crash and subsequent 
restore from tape, I was left with a system that wouldn't boot cleanly because 
some unobvious mount points were missing.  Now this was simple to fix: I booted 
a rescue CD, mounted the root filesystem, and created the mount points. It took 
all of three minutes. Still, it would be much better if the system was ready to 
boot after a full restore and didn't require manual tweaking.

flexbackup uses "find" to create the file list to back up and, after studying 
the situation, I don't think that "find" has a test that can identify a mount 
point's underlying masked filesystem type and, as a result, I can't see an easy 
way to get those mount points that mount "special" filesystems on the list to 
back up.

So, two questions:
1)  Am I missing something?  Is there a "find" test that will test the 
underlying mount point's filesystem type?
2)  Would a patch that introduces a new test like that be considered?  Or, 
perhaps, welcomed?

Thanks in advance.

- John

reply via email to

[Prev in Thread] Current Thread [Next in Thread]