Click to See Complete Forum and Search --> : How to find the time a filesystem was mounted without using root or su -


neuralninja
04-04-2008, 01:23 PM
Hi,

Im running RHEL. How do I find the time a particular filesystem was mounted?

Please Let me know

Thanks

bwkaz
04-04-2008, 07:13 PM
What filesystem type?

If ext2 or ext3, you can dumpe2fs -h /dev/XXXX (where /dev/XXXX is the device that the filesystem is stored on). This will work whether the filesystem is mounted or not. One of the fields is named "Last mount time:", which looks like it's exactly what you want.

For other filesystem types, you'd have to see if they have some way to dump out the contents of their superblock. (Assuming the last-mount time is stored in the superblock; some filesystems don't store it anywhere. I believe XFS is one of those (though maybe they just don't store the mount count, I'm not quite sure).)