On Sun, Apr 01, 2007 at 12:08:40PM -0400, Judah Milgram wrote: > Anyone know a fast way to test for presence/type of a file system on a > device from within a shell script? > > Background: am doing encrypted swap, works fine, but it occurs to me a > little extra safety might not be bad... goal is to make sure there's no > file system on the partition before writing random bytes to it through > the device mapper. > > (The disaster scenario is e.g. a typo or copying over the rc.swap to a > new machine and forgetting to change the swap partition device name)
Stab-in-dark: mount -vf /dev/XXX|& parse the output
