[mdlug] Notes about filesystems and LVM

Gib gibmaxn at gmail.com
Mon Mar 11 17:31:03 EDT 2024


Great, thank you.

On Mon, Mar 11, 2024 at 8:42 AM Carl T. Miller <carl at carltm.com> wrote:

> Hi All,
>
> Here's a quick recap of the commands in the demo.
> Bold formatting indicates an example usage.  If you'd
> like, create a vm and tinker away!
>
> c
>
>
>   * *mount*
>     displays mounted devices including filesystems
>
>   * *df -h*
>     lists mounted filesystems
>
>   * *lsblk*
>     lists block devices
>
>   * *lsblk -e7*
>     ignores loop devices
>
>   * *lsblk -f*
>     includes filesystem information, if available
>
>   * *blkid*
>     gives more detailed information about devices
>
>   * *pvs*, *vgs*, and *lvs*
>     shows summary of LVM physical volumes, volume groups, and logical
>     volumes
>
>   * *pvdisplay*, *vgdisplay*, and *lvdisplay*
>     shows details about physical volumes, volume groups, and logical
> volumes
>
>   * lvcreate and mkfs.ext4
>     creates and formats a new logical volume in a volume group
>     *lvcreate -L 6G -n home vgmint
>     lvcreate -L 100%FREE -n tmp vgmint
>     mkfs.ext4 /dev/vgmint/home
>     mkfs.ext4 /dev/vgmint/tmp
>
>     *
>   * mount
>     mounts newly formatted logical volumes
>     *mkdir -p /home2*
>     *mount /dev/vgmint/home /mnt/home2
>     *
>   * pvcreate
>     formats a new physical volume
>     after using fdisk to create a partition of type 8E:
>     *pvcreate /dev/vdb1*
>     to use entire harddrive:
>     *pvcreate /dev/vdc
>
>     *
>   * vgextend
>     adds one or more physical volumes to a volume group
>     *vgextend vgmint /dev/vdb1 /dev/vdc
>
>     *
>   * lvresize and resize2fs
>     increases size of a logical volume and resizes filesystem
>     *lvresize -L 10G /dev/vgmint/home*
>     *resize2fs -p /dev/vgmint/home
>
>     *
>   * pvmove, pvreduce, and pvremove
>     removes device from LVM
>     *pvmove /dev/vdb1
>     pvreduce vgmint /dev/vdb1*
>     *pvremove /dev/vdb1
>
>     *
>   * lvremove
>     removes a logical volume from a volume group
>     *lvremove /dev/vgmint/tmp*
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug


More information about the mdlug mailing list