ADMIRAL LVM migration
From ImageWeb
Contents |
Migrating ADMIRAL data to use larger iSCSI storage volume
These instructions assume that LVM software has been set and is probably already in use for the current volume. See ADMIRAL_LVM_allocation for details. It is assumed that the new storage is being provided by an external service,m and hence would be inappropriate to mix it with the storage currently in use.
Create and connect new virtual disk
- Connect the new storage to the VMWare host system (IT support handle this for us)
- Use VMWare console to allocate new virtual disk on the new VMWare datastore, and connect it to the ADMIRAL Virtual Machine. Allocate all (or as much as required) of the new storage when creating the new disk image.
- It may now be necessary to reboot the ADMIRAL virtual machine so that it can see the new virtual disk.
- Log in to the target ADMIRAL system and check the new disk is visible:
fdisk -l
Create and format new logical volume
- allocate a single partition occupying the entire disk:
fdisk /dev/sdc
- in response to prompts, enter 'n' (new parition), 'p' (primary partition), '1' (partition number 1), then accept defaults (use all of disk for new partition)
- create a LVM physical extent on the new partition, create a volume group and create a logical volume using all the available space in the volume group:
pvcreate /dev/sdc1 vgcreate vg-admiral-data-ext /dev/sdc1 lvcreate --name lv-admiral-data-ext --extents 100%FREE vg-admiral-data-ext
- Create a file system on the logical volume, and create a symlink to it:
mkfs.ext3 /dev/vg-admiral-data-ext/lv-admiral-data-ext
Copy data and configuration and switch to new volume
NOTE: do not use the ADMIRAL system while this step is being performed.
NOT FULLY TESTED
- Edit
/etc/fstabto add a line as follows:
/dev/vg-admiral-data-ext/lv-admiral-data-ext /mnt/lv-admiral-data-ext ext3 defaults,acl 0 0
- Mount the new file system on the logical volume:
mkdir /mnt/lv-admiral-data-ext mount /mnt/lv-admiral-data-ext mount # check ACLs are enabled
- Copy all files
cp -axv /mnt/data/* /mnt/lv-admiral-data-ext/
- Change symlinks to point to data on new volume (note, some user home data is still accessed on the original volume following this: check symlinks in /home directory)
rm /mnt/data ln -s /mnt/lv-admiral-data-ext /mnt/data rm /home/data ln -s /mnt/lv-admiral-data-ext/data/ /home/data

