Add a new filesystem – LVM

  1. Search for your new disk ls -l /dev/sd* or fdisk -l
  2. Create the partition fdisk /dev/sdb (New, Primary, 1 partition number, first cylinder, last cylinder, Write)
  3. Check for your new partition ls -l /dev/sdb* or fdisk -l
  4. Create physical volume pvcreate /dev/sdb1
  5. Check the physical volume pvdisplay /dev/sdb1
  6. Create the volume group vgcreate vg_server2 /dev/sdb1
  7. Check the volume group vgdisplay vg_server2
  8. Create the logical volume lvcreate -n lv_user1 -l 100%VG vg_server2
  9. Check the logical volume lvdisplay
  10. Create the filesystem mkfs.ext3 /dev/vg_server2/lv_user1
  11. Create the mount point mkdir /user1
  12. Mount the disk mount /dev/vg_server2/lv_user1 /user1
  13. Edit filesystem table vi /etc/fstab and add the following line
    /dev/vg_server2/lv_user1  /user1  ext3  defaults  0  2

Leave a Reply

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

*