I've got a SUSE Linux (SLES) system where after a power outage, one of the directories appears to be out of date. It has got some mount points for various logical volumes e.g.

/dir      -> lv1
/dir/db   -> lv2
/dir/log  -> lv3

The db directory appears to not be updated for months, while the log shows data throughout the whole time period.

lv1 is showing as 80% full, and I can only account for 20% of that space.

I'm going with the assumption that for some reason before the power outage, the /dir/db directory was not mounted, so writes to /dir/db were just going into a directory on lv1. After the restart, the mount has been setup and so I'm seeing old data from the last time the mount point worked.

Is there any way to examine 'under' the mountpoint, and see if the data is there, without unmounting the filesystem?

link|improve this question
Can you not mount lv1 on a different mount point and inspect it there? – Shawn Chin Aug 26 '11 at 12:10
feedback

migrated from stackoverflow.com Aug 26 '11 at 14:25

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 4 down vote accepted

Yes, just mount /dirs parent directory somewhere else with mount --bind:

# mkdir /mnt/tmp
# mount --bind / /mnt/tmp
# cd /mnt/tmp/dir

Then inspect the state of the directory. When done:

# umount /mnt/tmp
# rmdir /mnt/tmp
link|improve this answer
Fantastic, and there is the missing data! – asc99c Aug 26 '11 at 13:05
feedback

Your Answer

 
or
required, but never shown

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