Punto 1 .
Como crear LVM, con un sistema corriendo .
1. instalar el hd, correctamente (fisico)
2. verificar que se encuentre funcionando /proc/hdX/settings
2. Utilizar la aplicaciones fdisk o parted para crear las particiones .
ejemplo de esto .
# fdisk -l /dev/hdc
# fdisk /dev/hdc
con esto podemos crear particiones, cambiar de ID, etc.
# sfdisk -d /dev/hda | sfdisk /dev/hdb
copiamos la estructura de particiones de un disco a otro disco duro , muy importante este comando es peligroso ya que nos modifica la estructura de nuestro disco duro
#mkfs.ext3 /dev/hdc1
formatea al sistema de archivos
#mkswap /dev/hdc1
prepara una partición para formato de swap .
# parted /dev/hda
para crear particiones , es igual que fdisk pero en mi forma personal es mas poderoso fdisk
trabajemos con un ejemplo de modificar el tamano de un volumen
# fdisk /dev/hdc
=============================
The number of cylinders for this disk is set to 44698.
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., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
e extended
p primary partition (1-4) p
Partition number (1-4): 2
First cylinder (1940-44698, default 1940):
Using default value 1940
Last cylinder or +size or +sizeM or +sizeK (1940-44698, default 44698): +1000M
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
===========================
esta creada las particiones ... ahora las agregamos a un volumen logico
#fdisk -l /dev/hdc
=============================
fdisk -l /dev/hdc
Disk /dev/hdc: 23.0 GB, 23068672000 bytes
16 heads, 63 sectors/track, 44698 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 1939 977224+ 8e Linux LVM
/dev/hdc2 1940 3878 977256 8e Linux LVM
=============================
# pvcreate /dev/hdc1 /dev/hdc2
============================
Physical volume "/dev/hdc1" successfully created
Physical volume "/dev/hdc2" successfully created
============================
# vgcreate volumen /dev/hdc1 /dev/hdc2
Volume group "volumen" successfully created
revisamos que este creado nuestro nuevo volumen
# vgs
============================
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 21.31G 0
volumen 2 0 0 wz--n- 1.86G 1.86G
============================
creamos un volumen logico nuevo
# lvcreate -L 1000M volumen -n lvolumen
==============================
Logical volume "lvolumen" created
==============================
formateamos la unidad logica .
# mkfs.ext3 /dev/volumen/lvolumen
==========================
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
128000 inodes, 256000 blocks
12800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=264241152
8 block groups
32768 blocks per group, 32768 fragments per group
16000 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
============================
revisamos nuestros volumenes logicos
# lvs
==================================
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 19.31G
LogVol01 VolGroup00 -wi-ao 2.00G
lvolumen volumen -wi-a- 1000.00M
=================================
Incrementamos el espacio
# lvresize -L 1500M /dev/volumen/lvolumen
===============================
Extending logical volume lvolumen to 1.46 GB
Logical volume lvolumen successfully resized
===============================
# resize2fs /dev/volumen/lvolumen 1400M
=============================
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/volumen/lvolumen to 358400 (4k) blocks.
The filesystem on /dev/volumen/lvolumen is now 358400 blocks long.
============================
después de hacer este paso, como medida precautoria tenemos que revisar la particion .
# e2fsck -f /dev/volumen/lvolumen
===========================
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/volumen/lvolumen: 11/176000 files (9.1% non-contiguous), 10014/358400 block
===========================
revisamos como quedo nuestro volumen
# lvs
=============================
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 19.31G
LogVol01 VolGroup00 -wi-ao 2.00G
lvolumen volumen -wi-a- 1.46G
=============================
editamos el punto de montaje /etc/fstab para montaje automatico al arranque o podemos hacer uso del auto.misc .. como mejor les parezca .
Esta pagina apesta
ResponderEliminar