[linux-lvm] determining lv from mount point
Galen Seitz
galens at seitzassoc.com
Tue Sep 23 15:38:02 UTC 2003
Montgomery, Kendal L <kendal.montgomery at qwest.com> wrote:
> The df command will already do that. For instance, on my machine, if I do:
>
> [klmontg at klmontg klmontg]$ df /opt
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/vg01/opt 4194172 1610880 2583292 39% /opt
>
> It gives me the filesystem, etc.
Unfortunately, this doesn't help when trying to distinguish between
regular and lvm filesystems. On my system, / and /boot are on regular
partitions.
bash-2.05b$ df /boot
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 99134 13828 80187 15% /boot
bash-2.05b$ df /usr
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/Volume00/LV_usr 4031680 2151280 1675600 57% /usr
I'd like to distinguish between these two without hardcoding knowledge
of device or volume names into my script. One thing I have considered
is doing an ls -l on the device name and checking for the lvm major.
Of course, then I would have to hardcode the lvm major into my script.
I just figured someone must have a better way to do this.
thanks,
galen
More information about the linux-lvm
mailing list