Partitions, RAID and LVM

This page explains how hard disks are partitioned and how filesystems are created on them. It also covers the use of RAID and LVM to combine multiple partitions into one large filesystem.

Introduction to hard disk partitions

All hard disks used by Linux and other operating systems on PC hardware are divided into one or more non-overlapping regions called partitions. Sometimes an entire hard disk will be taken up by one partition, but usually your system will have at least two partitions on the primary disk - one for the root filesystem, and one for virtual memory (also known an swap space). As explained in chapter 5, each partition can be used for either a single filesystem or for virtual memory.

Every partition has a type which identifies the kind of data that it stores. There is a type for Linux filesystems, a type for Linux swap space, a type for Windows filesystems and many more. Almost every kind of operating system that runs on PC hardware has its own partition type for its own filesystems. However, when adding new partitions on your system you will very rarely use any types other than those specifically for Linux.

On PC systems, each hard disk can only contain four primary partitions. Because this is often not enough, it is possible for one of those four to be a special extended partition that can contain an unlimited number of logical partitions. If you make use of an extended partition, there is effectively no limited on the number that your hard disk can contain.

Every hard disk is divided into equal sized cylinders, which represent concentric circles on the surface of the disk. Larger hard disks generally have more cylinders, but due to different drive geometries this is not always the case. Each partition has a starting and ending cylinder, and occupies all the space on the disk between them.

Be very careful when changing or re-formatting any existing partitions on your system. Because they contain filesystem data, deleting or modifying one could wipe out all your files or make your system unbootable. Webmin tries to prevent this, but it is still possible to do a lot of damage with only a few mouse clicks! Normally you should only need to create or edit partitions when adding a new hard disk to your system.

The Partitions on Local Disks module

All disk partition management is Webmin is done using the Partitions on Local Disks module, which can be found under the Hardware category. When you enter the module, a page showing all hard disks and partitions found on your system will be displayed, as shown in Figure 8-1.


The Partitions on Local Disks module

All IDE and SCSI disks are shown, along with their manufacturers and model numbers. If your system has a hardware RAID controller that is supported by the module, the RAID devices will be shown instead of the actual underlying hard disks that make them up. However, disks and partitions used for software RAID will be shown, but not the logical or virtual drives that they have been combined into.

For each disk, all partitions on it will be listed showing their type, start and end cylinders and current mount point or other use. If the partition contains a filesystem, the amount of free disk space will be displayed as well. If a partition is being used for software RAID, their raid device that it is part of will be shown. Similarly, if a partitions is part of an LVM volume group the group name will be displayed under the Use column.

Adding and formatting a new partition

If you have just added a new hard disk to your system and want to make use if it under Linux, you must first partition it and then format the partition as the filesystem type of your choice. The steps to follow the do this are :

  1. In the main page of the Partitions on Local Disks module, locate your new hard disk. It will probably not have any partitions on it, but it may have been set up with one large partition by the manufacturer.
  2. Assuming no partitions exist yet, click the Add primary partition link next to your new hard disk. This will take you to the creation form shown in Figure 8-2 for entering the details of the new partition.
  3. If the new partition is to take up the entire hard disk, the Extent fields can be left unchanged as they are always automatically filled in to cover all the free space left on the disk. However, if you want to create more than one partition, adjust the extent so that it takes up only part of the disk.
  4. If this partition is to be for an ext2, ext3, reiserfs or xfs filesystem, set the Type field to Linux. If it is to be for virtual memory, set the Type to Linux swap. If it is for software RAID, set the Type to Linux raid. If it is for LVM, set the Type to Linux LVM. If you are creating the filesystem for some other operating system to use, set the Type field to whatever is appropriate for that OS.
  5. Click the Create button to add the partition. Assuming no errors were detected, you will be returned to the list of disks and partitions on the main page of the module, which should now include the new partition.
  6. If the new partition is to have a Linux filesystem created on it, you must follow the steps in the Creating a new filesystem section below. Virtual memory partitions can be added immediately in the Disk and Network Filesystems module. Partitions for use with RAID can be also be used immediately in the Linux RAID module, but you must have created all the partitions that will make up a RAID device before creating it. Partitions that will be part of an LVM volume group can be added immediately using the Logical Volume Management module.


The partition creation form

Creating a new filesystem

Before a newly created partition can be used to store files, it must first have a filesystem created on it. Filesystems can also be created on partitions that have been used before, perhaps by another operating system. However, be very careful when formatting a partition with a new filesystem, as any files that it used to contain will be lost forever.

The steps to follow to create a new filesystem are :

  1. On the main page of the module, click on the number of the partition that you want to re-format. This will take you to the partition editing form, as shown in Figure 8-3.
  2. Near the bottom of the page is a button labeled Create Filesystem with a menu of supported filesystem types next to it. See the section on A comparison of filesystem types in DiskAndNetworkFilesystems for information on the pluses and minuses of each type. When you have made a selection, click the button which will take you to a form for selecting options for the new filesystem.
  3. Depending on the type of filesystem chosen, different creation options are available. For ext2 or ext3 filesystems, the only one that you might want to change is Reserved blocks which determines the amount of disk space reserved for the exclusive use of root user. The default is 5%, which I think is rather wasteful.
  4. Click the Create Filesystem button to format the partition. A page showing the progress of the new filesystem's creation will be displayed, which can take some time for large hard disks.
  5. Assuming that the formatting is successful, you can now use the Disk and Network Filesystems module to mount the new filesystem.


The partition editing form

Partition labels

Labels are a feature of newer versions of Linux that allow a partition to be identified in the /etc/fstab file by a short name, rather than its IDE or SCSI device file such as /dev/hdb3. Device files can change if you change an IDE drive from one controller to another, change the ID of a SCSI drive, or even add a new SCSI drive with an ID lower than an existing drive. Any of these changes could cause a partition to fail to mount at boot time, possibly making your system un-bootable. However, partitions with labels can be referred to be label name, which does not change even if the device file does.

Some newer Linux distributions use labels by default for filesystems that you create at install time. If you use the Disk and Network Filesystems module on such a system, the Location column for these filesystems will be something like _Partition labeled /home_.

Only partitions with ext2, ext3 or xfs filesystems on them can be labeled, as the label is stored in the filesystem rather than the partition table. To label an existing filesystem, follow these steps :

  1. On the main page of the module, click on the number of the partition that you want to label. This will take you to the partition editing form, as shown in Figure 8-3.
  2. Assuming the partition is not currently in use, you will be able to enter the new label into the Partition label field. It must be at most 16 characters long - for example /home or root.
  3. After you have entered the label, click the Save button. It will be stored in the filesystem, and the browser will return to the module's main page.
  4. At this point, the Disk and Network Filesystems module can be used to mount the labeled filesystem by label name, as explained in chapter 5.

Deleting or changing a partition

Once a partition has been created, its size or position on the hard disk cannot be changed using Webmin. The only things you can do are change its type, or delete it. However, neither are possible if a filesystem on the partition is listed in the Disk and Network Filesystems module - that is, if it is currently mounted or recorded for mounting at boot time.

Changing the type of a partition will not harm the data on it in any way. However, it may make it unusable by some operating systems or for some purposes. The steps to make a change are :

  1. On the main page of the module, click on the number of the partition that you want to change. This will take you to the partition editing form.
  2. As long as the partition is not in use, you will be able to select a new type from the Type field and click the Save button.
  3. Once the change has been made, the browser will return to the list of disks and partitions.

Deleting a partition should be done only if you are sure that you want to lose all the data on it. However, it is the only way to make some changes to the partition table in Webmin, such as replacing two small partitions with one larger one. If you are sure that you want to go ahead with the deletion, the process is as follows :

  1. On the main page of the module, click on the number of the partition that you want to delete, which will take you to the partition editing form.
  2. Click the Delete button, which will only appear if the partition is not in use. This will take you to a page for confirming the deletion.
  3. If you are really sure you want to go ahead, click the Delete Now button. One the job is done, you will be returned to the main page of the module.

Theoretically, it is possible to restore a deleted partition by creating a new one with the exact same size and extents.

Module access control

Surprisingly, it is possible to limit the access that a Webmin user has to certain disks in the Partitions on Local Disks module. This could be useful if your system has a removable drive (like a Zip or Jaz drive) that you want users to be allowed to partition with Webmin, while preventing them from re-formatting the primary hard disk.

Once a user has been granted access to the module, to restrict the disks that he can access, the steps to follow are :

  1. In the Webmin Users module, click on Partitions on Local Disks next to his username. This will bring up the module access control form.
  2. Change the Disks this user can partition and format field to Selected, and choose the disks that the user should be allowed to partition and create filesystems on from the list below.
  3. To stop the user seeing disks on the main page that he cannot manage, change the Can view non-editable disks? option to No.
  4. Finally, click the Save button to activate the access control restrictions.

Just being able to partition and format a disk is not particularly useful, unless it can be mounted as well. The Disk and Network Filesystems module has no support for access control restrictions, because giving a user the rights to mount a filesystem would open up several security holes. A better solution is to set up an automounter filesystem so that removable devices can be mounted by just entering a special mount-point directory.

Other operating systems

Solaris is the only other operating system that has a module for managing disks and partitions. However, there are several differences between the two :

Every Solaris disk has exactly 8 partitions, some of which may have no extent if they are not being used. Partitions never need to be created or deleted, and there are no extended or logical partitions.

  • When editing a Solaris partition, its extents can be changed without needing to delete and re-create it. However, this will almost certainly result in the loss of data on the partition.

  • Every partition has a type that indicates what it is used for. The root type is usually for the root directory filesystem, the swap type is for virtual memory, the usr type is for other filesystems and the unassigned type is for empty partitions.

  • Each partition has two flags - Mountable and Writable, which indicate whether it can be mounted or written to respectively.

  • The only filesystem supported on Solaris partitions is ufs, the native Unix filesystem type.

  • Partition labeling is not supported on Solaris.

  • When editing the module access control, there is no Can view non-editable disks? option.

The RAID and LVM modules explained below are not available on Solaris or any other operating system.

Introduction to RAID

RAID (which stands for Redundant Array of Inexpensive Disks) is a method for combining multiple partitions on different disks into one large virtual device, also known as a RAID array. This has several advantages :

You can create a single filesystem that is as big as all your existing hard disks, instead of needing to mount each one separately at a different mount point directory.

In most cases, reading to and writing from a RAID device is faster than accessing a single disk, because the data being read or written is spread across multiple drives.

With the right configuration, data on a RAID device can survive even if any one of the hard disks fails. This is done by spreading redundant information across all drives, and comes at the cost of some disk space.

The different types of RAID configuration are called levels. The levels supported by Linux are :

  • Concatendated or Linear
    In this mode, all the partitions in the RAID array are combined end-to-end into one large virtual device. Data written to the device will fill up the first disk, then go on to the second disk and so on. Linear mode does not generally make data access any faster, as all the blocks of a file being read or written are likely to be next to each other on the same disk.

  • RAID 0 or Striped
    In striped mode, multiple partitions are also combined into one large device as in linear mode. However, data written to the array will be spread evenly across all disks, so that reading or writing a single large file is much faster. Ideally, if you had 5 disks in your striped RAID array then accessing data would be 5 times faster. The only problem with this mode is that it does not deal well with disks that are not all the same size - any space on a disk that is larger than the rest will still be used, but only at its normal speed.

  • RAID 1 or Mirrored
    In mirrored mode, every partition in the array contains exactly the same data. This means that in the event of a disk failure, your data is safe even if only one disk survives. The down side is that under normal conditions most of the disks are wasted, and the usable space on the array is only as big as the smallest partition. Reading from a mirrored array is as fast as reading from a striped array, but writing will be as slow as the slowest disk due to the need to write all data to all disks simultaneously.

  • RAID 4 or Parity
    Parity mode is rarely used, as it offers no real advantage over RAID 5. It provides protection against a single disk failure and increases read speed but not write. A RAID 4 array can survive the loss of any one disk because it dedicates one disk to the storage of parity information, which can be used to re-construct data on other disks if one fails. Because all writes to the array cause a write to this disk, it becomes a bottleneck that slows done the entire array.

  • RAID 5 or Redundant
    This is the most useful RAID mode as it provides protection against a disk failure, increases read and write speeds, and combines multiple partitions into one large virtual device. A RAID 5 array can survive the loss of any one disk without the loss of all data, but at the expense of sacrificing some space on all the disks for storing redundant information. It is faster than linear mode, but not quite as fast as striped mode due to the need to maintain redundancy.

This chapter only covers the configuration software RAID on Linux. If your system has a separate hardware RAID controller card or external array, you will need special software to set it up. Virtual RAID devices on hardware controllers will show up in the Partitions on Local Disks module for partitioning, just like any real hard disk would. They will not be visible or configurable in the Linux RAID module.

The Linux RAID module

This module allows you to create, format and delete RAID arrays on your Linux system. Like the other hard-disk related modules, it can be found under the Hardware category. When you enter the module, the main page will display existing RAID devices (if any) as shown in Figure 8-4.


The Linux RAID module

If Webmin detects that the commands that is uses to setup RAID are missing from your system, an error message will be displayed on the main page of the module instead. Most Linux distributions should have a package on their CD or website containing the raid commands though. A different error will be displayed if your Linux kernel has not been compiled with RAID support. In this case, you may have to re-compile the kernel with RAID supported turned on.

Assuming all the necessary packages have been installed, adding a new RAID device is relatively easy. The steps to follow are :

  1. In the Partitions on Local Disks module, create a partition on each disk that you want to use for RAID. Existing partitions can also be used, as long as they do not contain any data that you do not want overwritten. A disk that is partially used for some other purpose can also have a new partition added for RAID use, although this may negate some of the performance benefits. Every partition that is going to be part of the RAID array should have its type set to Linux raid. Unless you are using linear mode, all partitions should be the same size so that space on the larger partitions is not wasted.
  2. At this point, it may be necessary to reboot your system. Some Linux kernels can only detect new partitions at boot time. If you do not reboot and the partition is not detected, the creation of the RAID device will fail.
  3. On the main page of the module, select the RAID level that you want to use and click the Create RAID device of level button. This will take you to a form for selecting the partitions to be part of the array and other options, assuming Webmin detects at least one unused partition on your system.
  4. The Partitions in RAID option will list all hard disk partitions that are not currently in use for possible inclusion in your RAID device. It will also list any other RAID devices that are not in use, allowing you to theoretically create an array that contains other arrays. Select all the partitions that you want to be part of your new RAID device.
  5. The Force initialization of RAID? option should be set to Yes if any of the selected partitions have been used before for other purposes. Otherwise, the creation of the new array will fail if a filesystem is detected on any of the partitions.
  6. Click the Create button to set up the new array. If everything is successful, you will be returned to the main page of the module, which should now include your new RAID device.
  7. If you want to create a filesystem on the new device so that it can be mounted, click on its icon to go to the device status page. If the RAID device is to be used for virtual memory, as part of an LVM volume group or as part of another RAID array, then this is not necessary.
  8. Select the type of filesystem you want to create from the menu at the bottom of the page, and click the Create filesystem of type button.
  9. Select any options for the new filesystem, as explained in the Creating a new filesystem section. When done, click the Create button. A page showing the progress of the new filesystem's creation will be displayed, which can take some time for large arrays.
  10. Assuming that the formatting is successful, you can now use the Disk and Network Filesystems module to mount the new filesystem.

Existing RAID devices that are not in use can be deleted or de-activated by clicking on their icon on the main page of the module, and pressing the Delete appropriate button. Deleting a device will cause any data stored on it to be lost forever.

Introduction to LVM

LVM (Logical Volume Manager) is a powerful Linux feature that adds a layer of abstraction between the physical partitions on your system and the filesystems that they store. Partitions managed by LVM are called a physical volumes, which are combined together to form volume groups. From each volume group _logical volumes_ can be created, on which filesystems are actually stored. The size of each volume group is the sum of the sizes of all its physical volumes. This space can be handed out to as many logical volumes as will fit into it, so that it could contain many small logical volumes or one huge one that spans multiple physical volumes (and thus partitions).

At first glance, LVM may seem to be not much more powerful than RAID, which can also combine multiple partitions into one large filesystem. However, it gives you far more freedom to carve up disks into separate filesystems that may take up part of a disk, several disks or anything in between. The only down side is that LVM does not support redundancy as RAID does in levels 1 and 5.

The most useful feature of LVM is the ability to re-size logical volumes and the filesystems within them, up to the amount of free space in the volume group. Additional physical volumes (such as newly installed hard disk partitions) can be added to an existing volume group, increasing the amount of free space. For example, if your system had two hard disks whose partitions were combined to form a volume group, you might have a filesystem on a logical volume that is as big as both disks combined. If you began to run out of disk space and wanted to enlarge the filesystem, you could install a new hard disk, add it to the volume group and then enlarge the logical volume to make use of all the new free space! This is far more convenient than mounting the new hard disk as a subdirectory somewhere under the existing filesystem.

Physical volumes can also be removed from an LVM volume group, as long as there is enough free space in the group to store data that used to be on the physical volume. This means that you could theoretically remove a small hard disk from your system and replace it with a larger one, without having to manually copy files around.

The Logical Volume Management module

Webmin's Logical Volume Manager module allows you to perform almost all of the tasks that can be done using the command-line LVM tools. When you enter the module from the Hardware category, the main page shows all existing volume groups and their physical and logical volumes, as shown below.


The Logical Volume Management module

Because the module depends upon the LVM tools such as vgcreate, the main page will display an error message if they are not found. However, they should be available on your distribution CD or web site if you are running a reasonably recent version of Linux. It also checks if your kernel supports LVM by looking for the /proc/lvm directory. If support is missing, you will need to load the lvm-mod kernel module with the command modprobe lvm-mod or re-compile your kernel with LVM support.

Creating a new volume group

Assuming you have at least one partition free for use by LVM, setting up a new volume group is easy. The process to follow is :

  1. In the Partitions on Local disks module, change the types of any partitions that you want to include in the volume group to Linux LVM. Trying to use partitions of any other type will fail.
  2. Back in the Logical Volume Manager module, click on the Add a new volume group link, which will take you to the volume group creation form.
  3. Enter a name for your new volume group in the Volume group name field. This should be short and contain no spaces, like data_vg.
  4. Select the initial partition to be included in your volume group with the Initial physical device field. Only partitions or RAID devices that Webmin determines are not in use will appear in the list. You also specify a partition by device file name by selecting the Other option and entering the file name into the field next to it. If Other is the only option available, Webmin has not detected any partitions free for use by LVM. Be aware that any data on the partition or device that you select will be lost forever, even if the volume group is not actually used.
  5. Click the Create button. If all goes well, you will be returned to the main page of the module and your volume group with its initial physical volume will be displayed.
  6. To add more physical volumes to your new volume group, see the section below.

Adding and removing a physical volume

Once a volume group has been created with its initial physical volume, you can add new partitions or RAID devices to it at any time. This will increase the amount of free space in the volume group, and allow you to create more logical volumes or extend existing ones. To add a physical volume, follow these steps :

  1. If you are adding a disk partition, use the Partitions on Local Disks module to change its type to Linux LVM.
  2. On the main page of the Logical Volume Management module, click on Add a physical volume to the group inside the section for the appropriate volume group. This will take you to a page for selecting the partition or RAID device to add.
  3. Choose the one that you want to add from the list in the Disk device field, or select the Other option and enter a device file manually. Only partitions that Webmin thinks are not in use elsewhere will be available for selection. Be aware that any data on the partition or device that you select will be lost forever.
  4. Click the Add to volume group button to add the physical volume. If successful, you will be returned to the main page of the module.

It is also possible to remove a physical volume from a volume group, as long as there is enough free space in the group to store all the data that was previously on the physical volume. The steps for doing this are :

  1. On the main page, click on the icon for the physical volume that you want to remove.
  2. Click the Remove from volume group button. Assuming that removal is possible, there may be a delay as data is shifted to other physical volumes.
  3. Once the removal is complete and the browser returns to the list of volume groups, you can immediately use the partition for mounting, RAID even adding to another volume group.

Creating and deleting a logical volume

As long as a volume group has some free space, you can add a logical volume to it at any time. A logical volume can be any size, but the size will always be rounded up to a multiple of the allocation block size used by the volume group (4 MB by default). You can see the current block size, blocks allocated and total blocks by clicking on a volume group's icon on the main page of the module.

The steps for adding a new logical volume are as follows :

  1. On the list of volume groups, click on the Create a new logical volume link next to the volume group that you want to add it to.
  2. In the Volume name field, enter a name for your new logical volume. This should be short and contain no spaces, like data_lv.
  3. For the Volume size field, enter the number of kilobytes to allocate to this volume. Whatever you enter will be rounded up to the nearest Allocation block size shown below. By default, this field will be set to the total amount of free space in the volume group.
  4. If the Allocation method option is set to Contiguous, all space reserved for this logical volume will be in one large block on disk. This can speed up access to the data, but is inflexible if you are adding and removing logical volumes causing the volume group to become fragmented. Therefore, it is usually best to leave the option set to Non-contiguous.
  5. The Volume striping option controls how data for the logical volume is layed out on disk. The Disabled option is similar to linear mode in RAID, while the Stripe across option is similar to striped mode. See the Introduction to RAID section for a more detailed explanation.
  6. When all the fields are set to your satisfaction, click the Create button. As long as all fields have been filled in properly and there enough free space in the volume group, the browser will return to the main page of the module and a new icon for your logical volume should be visible.
  7. Assuming you want to mount the new logical volume somewhere, you will first need to create a filesystem on it. To do this, click on its icon on the main page of the module which will take you to the logical volume editing page.
  8. Select the type of filesystem you want to create from the menu at the bottom of the page, and click the Create filesystem of type button.
  9. Select any options for the new filesystem, as explained in the Creating a new filesystem section. When done, click the Create button. A page showing the progress of the new filesystem's creation will be displayed, which can take some time for large volumes.
  10. Assuming that the formatting is successful, you can now use the Disk and Network Filesystems module to mount the new filesystem.

Existing logical volumes can be deleted from their volume group, in order to free up space or reduce the volume group size. Before you can delete a logical volume, it must have been un-mounted in the Disk and Network Filesystems module. When it is deleted, any data that it contained will be lost forever.

To remove a logical volume, follow these steps :

  1. Click on its icon on the main page of the module, which will take you to the logical volume editing form.
  2. Click the Delete button. This will bring up a page asking if you are really sure about deleting it.
  3. Click Delete Now to confirm. Once it has been removed from the volume group, your browser will return to the main page of the module. The space freed up can be re-used for another logical volume immediately.

Resizing a logical volume

One of the most powerful features of LVM is its ability to enlarge or reduce existing logical volumes, even if they contain a filesystem. However, Webmin only supports the resizing of ext2, ext3, reiserfs and jfs filesystems at the moment 0 logical volumes formatted with other filesystem types (such as xfs) cannot be resized without losing data. You must also un-mount a logical volume before resizing it, and then re-mount afterwards - there is no way to resize a filesystem that is currently in use.

As would be expected, a logical volume can only be enlarged by the amount of free space in its volume group. When shrinking a logical volume containing a supported filesystem, its size cannot be reduced to less that the space occupied by files on the filesystem. Currently, jfs filesystems cannot be shrunk at all - only enlarged.

The steps to follow for resizing a logical volume are :

  1. In the Disk and Network Filesystems module, make sure the logical volume is unmounted.
  2. On the main page of the Logical Volume Management module, click on its icon which will take you to the volume editing form.
  3. Enter a new size in kB in the Volume size field. The size cannot be increased by more than the amount of free space in the volume group, or reduced to less that the space occupied by files on the filesystem unless you plan to re-create the filesystem.
  4. Click the Save button. When resizing a volume containing an ext2, ext3, reiserfs or jfs filesystem, as long as no problems are encountered you will be returned to the main page of the module. However, if the filesystem could not be shrunk below the amount of space occupied by its files, an error page will appear offering you the option of resizing anyway. Clicking the Resize Logical Volume button will force a resize, but any files on the volume will be lost and you will need to re-create the filesystem. If resizing a logical volume containing some other type of filesystem (such as xfs) or one whose contents are unknown to Webmin, a page asking you to confirm the resize will appear. If you click the Resize Logical Volume to go ahead, any filesystem on the volume will be lost and need to be created again.
  5. If the filesystem was resized successfully, you can re-mount it in the Disk and Network Filesystems module. Otherwise, you will need to re-create it as explained in the section on Creating and deleting a logical volume.

Creating a snapshot

A snapshot is special kind of logical volume that is actually a temporary read-only copy of another volume. When a snapshot is created, it appears to contain a copy of all the data in the source volume, so that if the source is changed the snapshot remains the same. In order to save on disk space, the snapshot really only stores data that has changed on the original logical volume since it was created. This makes it possible to create a snapshot copy of a 100 MB volume even if the volume group has less that 100 MB of free space.

Snapshots are useful for quickly freezing a filesystem at some point so that it can be safely backed up. A snapshot can even act as a kind of backup itself, which you can revert to if something goes wrong with files on the original volume. The only down side is that a snapshot can only be safely created when the source logical volume is un-mounted, as a mounted filesystem will not be in a valid state for copying.

To create a snapshot, follow these steps :

  1. In the Disk and Network Filesystems module, un-mount the filesystem on the original logical volume if necessary.
  2. Back in the Logical Volume Management module, click on the Create a new snapshot link in the same volume group as the original volume.
  3. On the snapshot creation form, enter a short name without spaces into the Volume name field - data_snap for example.
  4. For the Volume size, enter the amount of disk space in kB that you want to allocate to this snapshot for storing differences made to the original logical volume after the snapshot was created. If the amount of space is too small and too many changes are made to the logical volume, I/O errors will start to occur when reading files in the snapshot filesystem.
  5. For the Snapshot of logical volume field, select the logical volume that you want to make a copy of.
  6. Click the Create button to create the snapshot and return to the main page. An icon for your new snapshot will appear among the other logical volumes in its volume group.
  7. In the Disk and Network Filesystems module, re-mount the filesystem on the original logical volume. You can mount the filesystem on the snapshot separately here as well.

Once created, a snapshot can be resized in the same way that you would resize a normal logical volume. However, this does not resize the filesystem on the snapshot - instead, it changes the amount of space available for storing differences between the snapshot and original volume group. A snapshot can also be deleted, assuming the filesystem on it has been un-mounted first. Any data in the snapshot will be lost, but since it is just a copy of another volume this isn't likely to matter much.

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
Topic revision: r2 - 12 Apr 2007 - 04:26:05 - JamieCameron
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback