Deploying Suse Linux Enterprise Server
| Purchase "Deploying Suse Linux Enterprise Server" at Lulu.com |
Installing Suse Linux Enterprise Server
Working with Logical Volume Management
LVM brings many features to the table, the two most popular and most used are the ability to resize volumes and the ability to create a snapshot of a volume.
Resizing a LVM Volume
There are 2 ways to resize a LVM Volume with Suse Linux Enterprise Server. Probably the easiest way is to simply use the Yast LVM Module. When you launch the LVM module you are presented with a screen that shows all the logical volumes on your system. Simply click on one of them and select "Edit". This will bring up a screen that will allow you to adjust the size of the volume, simply grow the volume to whatever size you want and click OK, then click on Finish within the Yast LVM Module to apply the settings. The module will take care of growing the volume and adjusting the filesystem for you.
Note: Again, you can only increase the size of mounted volumes if they are formated with the reiserfs or xfs filesystems (ext3 resize functionality should be implemented relatively soon). Also you must unmount all volumes to reduce their size (except for xfs formatted volumes as the xfs filesystem will not allow it to be shrunk).
![]()
![]()
The Yast LVM Module and editing a Logical Volume
The second way to resize a volume is to manually do it within a terminal. Fortunately this is not much harder than using the Yast LVM Module. In fact you may prefer it. There are two steps in manually resizing a logical volume, first you resize the volume, then you must ensure the filesystem makes the appropriate changes.
To do this the manual way, the command you issue to actually change the size of the volume is the "lvextend" command, such as these examples where the first command will increase the volume to 25GB and the second command simply adds 10GB the volume.
lvextend -L25G /dev/system/home lvextend -L+10G /dev/system/home
Once you resize the volume, the next thing you have to do is to resize the filesystem to accommodate the change in volume size. The command you run to do this varies depending upon the filesystem. For instance:
ext2/ext3 filesystems
umount /home resize2fs /dev/system/home mount /dev/system/home /home
reiserfs filesystems
resize_reiserfs -f /dev/system/home
xfs filesystems
xfs_growfs /home
Creating Snapshots
Another feature that LVM allows is the ability to create "snapshots" of your volumes. A snapshot is basically a "clone" of another volume at the time you create the snapshot. The interesting thing with these snapshots is the fact that they can be very small in size, since they only hold the changes made to the original volume after you create the snapshot.
These snapshots are very useful when doing backups (this is their primary purpose). However, now that virtualization has started to become feasible to deploy, snapshots will probably play an important role in virtualization solutions.
To actually create a snapshot, you use the lvcreate command with the -s switch, for instance, to do a backup of the /var volume one could do:
First create the snapshot
lvcreate -L1G -s -n varbackup /dev/system/var
Now mount the snapshot
mkdir /mnt/var_snapshot mount /dev/system/varbackup /mnt/var_snapshot
Run a backup command, for instance: (of course you would use a better command for the backup)
tar czf varbackup.tgz /mnt/var_snapshot
Now unmount and remove the snapshot
umount /mnt/var_snapshot lvremove /dev/system/varbackup
| Purchase "Deploying Suse Linux Enterprise Server" at Lulu.com |


