LVM Quick Reference

From Wiki
Jump to navigationJump to search

Resizing a volume:

 
If volume is NFS exported      -- /etc/init.d/nfs stop 
Unmount the logical volume     -- umount /dev/lvm_vol/lvolx 
Resize with                    -- e2fsadm -L [+]size[KMGT] /dev/lvm_vol/lvolx 
Remount all volumes            -- mount -a 
If volume is NFS exported      -- /etc/init.d/nfs start 

Adding a new volume:

Create a logical volume        -- lvcreate -L 1G -n lvol9 lvm_vol 
Format as ext2                 -- mke2fs /dev/lvm_vol/lvol9 
Create a mountpoint            -- mkdir /mnt/lvol9_mnt 
Add to /etc/fstab              -- vi /etc/fstab (duplicate an existing line, modify) 
Mount new volume               -- mount -a 
Add to /etc/rsync/rsync.conf   -- vi /etc/rsync/rsync.conf (duplicate an existing section, modify) 
If volume is NFS exported      -- /etc/init.d/nfs stop 
Edit /etc/exports              -- vi /etc/exports (add entry) 
If volume is NFS exported      -- /etc/init.d/nfs start