Red Hat LVM ADMINISTRATOR 5.0 Bedienungsanleitung Seite 5

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 6
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 4
7. Bring the logical volume online:
mount /logical_volume_mounting_point
For this scenario, enter:
mount /home
8. Verify that the added space is accounted for:
df –h
Administrators can also use the e2fsadm command to expand
the logical volume and resize its file system; this command com-
bines the
lvextend, e2fsck, and resize2fs commands.
Scenario B: Reducing another logical volume
Administrators should expand logical volumes by reducing another
only when the other volume has sufficient additional space. For
instance, if a data volume uses only a fraction of its allocated space
and this usage is expected to continue, administrators can safely
reduce that volume by some amount and assign that space to another
logical volume, /home in this scenario. Administrators should not
reduce the logical volume before reducing the file system, because
doing so can corrupt the file system on the reduced logical volume.
Again, Dell recommends backing up the system before following the
approach in this scenario. Performing the following procedure
expands one logical volume by reducing another—in this case, by
adding 2 GB from /data to /home:
1. Identify a logical volume to shrink that has sufficient free
space. The command
df -h reports information about the
system storage usage.
2. Bring the system down to runlevel 1:
init 1
3. Take both logical volumes offline:
umount /logical_to_shrink
umount /logical_to_grow
For this scenario, enter:
umount /data
umount /home
4. Reduce the selected logical volume and its associated file system:
e2fsadm -L –X /dev/lvm_name/logical_volume_name
where X is the size by which the volume should be reduced.
Take care not to reduce the size beyond its free space; doing
so can cause data loss—or corrupt the file system.
For this scenario, enter the following command to reduce both
the file system and the logical volume /data by 2 GB:
e2fsadm -L -2G /dev/lvm00/data
5. Expand the logical volume by the same amount the other
volume was reduced:
e2fsadm -L +X /dev/lvm_name/logical_volume_name
where X is the expansion size. For this scenario, expand
/home by 2 GB by entering:
e2fsadm -L +2G /dev/lvm00/home
6. Mount both file systems and bring the system up to
runlevel 3 or 5:
mount –a
init desired_runlevel
7. Verify the changes:
df –h
Administrators can also use the resize2fs, lvreduce, and
lvextend commands in place of e2fsadm to achieve these results.
STORAGE ENVIRONMENT
www.dell.com/powersolutions POWER SOLUTIONS
115
Figure A shows various LVM commands used in resizing and managing
logical volumes. Detailed information about each command is available
from the command’s man page.
Figure A. LVM commands
LVM COMMANDS FOR MANAGING
AND MAINTAINING SYSTEM STORAGE
Command Description
pvcreate Creates a physical volume by initializing a disk or a partition
pvscan Scans all drives for physical volumes and reports drive usage, including
available space
lvscan Scans all disks for logical volumes
lvextend Expands the size of a logical volume by adding a given amount of space
from a given physical volume
lvreduce Reduces the size of a logical volume (if a file system exists on the volume,
the file system must be reduced using
resize2fs before running this
command;
lvreduce does not permit reducing a logical volume size
below its used space)
vgextend Extends a volume group by adding physical volumes
lvdisplay Displays information about the attributes of a logical volume
vgdisplay Displays information about the attributes of volume groups
e2fsadm Expands or reduces an ext2 file system and logical volume together
resize2fs Expands or reduces an ext2 or ext3 file system
e2fsck Checks a Linux ext2
Seitenansicht 4
1 2 3 4 5 6

Kommentare zu diesen Handbüchern

Keine Kommentare