Add a Filesystem to a Red Hat Linux Virtual Machine

Steps to add a mount point to a Red Hat Linux system using LVM:

  1. Add a disk in VMware.
  2. Ensure the disk is visible on your server.
    [root@server]# lsblk
    sde                     8:64   0  250G  0 disk
    
  3. Create a physical volume.
    [root@server]# pvcreate /dev/sde
    [root@server]# pvs
    /dev/sde   VolGroup02 lvm2 a--  <250.00g      0
    
  4. Create a volume group.
    [root@server]# vgcreate VolGroup02 /dev/sde
    [root@server]# vgs
    VolGroup02   1   1   0 wz--n- <250.00g      0
    
  5. Create a logical volume.
    [root@server]# lvcreate -l 100%FREE -n u01 VolGroup02
    [root@server]# lvs
    u01    VolGroup02 -wi-ao---- <250.00g
    
  6. Make a filesystem.
    [root@server]# mkfs.xfs /dev/VolGroup02/u01
    
  7. Mount the volume. (Create the mount point if necessary.)
    [root@server]# mount /dev/VolGroup02/u01 /u01
    
  8. Add it to /etc/fstab to be mounted on reboot.
    [root@server]# vi /etc/fstab
    /dev/mapper/VolGroup00-lvol01 swap                    swap    defaults        0 0
    /dev/mapper/VolGroup02-u01 /u01                    xfs     defaults        0 0
    

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *