Manual lvm

Solo disponible en BuenasTareas
  • Páginas : 12 (2965 palabras )
  • Descarga(s) : 0
  • Publicado : 29 de diciembre de 2010
Leer documento completo
Vista previa del texto
http://www.mythtv.org/docs/mythtv-HOWTO-24.html

24.1 Logical Volume Manager (LVM)

LVM greatly increases the flexibility you have in managing your storage than traditional physical partitions. This section will provide some brief notes on how to use LVM to create storage space for your video files and how to add additional disk space in the future. There's lots more that can be done withLVM, so check the LVM HOWTO http://tldp.org/HOWTO/LVM-HOWTO/ document for details.

[pic]NOTE: If you are running MythTV 0.21 and you are using LVM to create one large filesystem to store your recordings, it's no longer recommended that you go the LVM route. The preferred solution is to use Storage Groups. They're more flexible and less likely to lose all of your recordings if you have a drivefailure.

If you don't understand how to partition a drive, or how to change the partition type you should stop and look at documentation on how to perform these steps.

[pic]BIG FAT WARNING: Using an incorrect parameter can make your files inaccessible, prevent your computer from booting, etc. Be careful!

Make sure your kernel configuration includes LVM support or that it's available as amodule. Today, most vendors include this by default. You'll also want to ensure that you have a copy of the LVM utilities; check your distribution, or get the latest versions from http://www.sistina.com/products_lvm.htm and build them manually.

Check that the vgscan program is being run at some point during your boot sequence - most distributions do this by default. Look for a message during bootup that looks like this: vgscan -- reading all physical volumes (this may take a while...) If you don't see any messages during boot, you may need to install a LVM init script or confirm that you have all of the LVM packages installed from your distribution.

LVM uses a few concepts you should be familiar with before starting.

• PV (Physical Volume). The actual partition on the hard drive.• VG (Volume Group). The aggregation of all the PVs make a VG.
• LV (Logical Volume). Subdivision of the pool of space available in the VG into individual chunks, like /usr, /var/video, etc.

The following example assumes that you want to create a LVM partition from a chunk of space in /dev/hda5, using a reiserfs filesystem and mounted on /var/video. You later decide to extend thisfilesystem by adding a new disk: /dev/hdb.

You need to create at least one LVM partition for a physical volume. Use fdisk or your favorite partition editor to set the type to LVM (0x8e). If you're using an entire disk, create one big partition rather than using the device itself. e.g. use /dev/hdb1 not /dev/hdb.

In the following example, you have a 15GB disk. The first 6GB are set as your bootpartition. /dev/hda2 was added as an extended partition, and within that partition you created the /dev/hda5 linux (ext2) partition.

# fdisk /dev/hda

The number of cylinders for this disk is set to 1823.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., oldversions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 15.0 GB, 15000330240 bytes
255 heads, 63 sectors/track, 1823 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 7646136798+ 83 Linux
/dev/hda2 765 1823 8506417+ 5 Extended
/dev/hda5 765 1823 8506417 83 Linux

Command (m for help): t
Partition number (1-6): 5
Hex code (type L to list codes): 8e

Command (m for help): p

Disk /dev/hda: 15.0 GB, 15000330240 bytes
255 heads, 63 sectors/track, 1823 cylinders
Units = cylinders of...
tracking img