HowTo: Como extender tu LV (lvm2)

Hoy tuve algunas broncas con este rollo. Ahí te va una muestra de idiotez:

1. Creé mi Physical Volume (PV)
pvcreate /dev/sdb

2. Lo agregué al Volume Group (VG)
vgextend vg_introdesk /dev/sdb

3. Extendí mi Logical Volume (LV)
lvresize /dev/vg_introdesk/lv_home -L +500G

4. Hice un df y me quedé ??? (no aumentó el tamaño)

5. Reduje, de nuevo
lvresize /dev/vg_introdesk/lv_home -L -500G

6. Eliminé el PV (gran pendejada!)
pvremove /dev/sdb -ff

El resultado de esto fue que no podía montar mis LV! Ahhh!!

Como arreglé esto?
vgreduce --removemissing

Cómo se hace bien?
Después del paso 3:
resize2fs /dev/vg_introdesk/lv_home

Después de esto, un shutdown -Fr now sería muy bueno. O, si no quieres reiniciar, solo desmonta el LV.

# En mi caso, como es /home, necesito usar:
ctrl+alt+f2

# Entrar como root y hacer un init a single user mode.
init 1

# Luego, un:
umount /home && fsck.ext4 /dev/vg_introdesk/lv_home

;)

# tip 1
Para aumentar al máximo el tamaño de tu lvm, usé:
lvresize /dev/vg_introdesk/lv_home -l +100%FREE

Share and Enjoy:
  • Print
  • Digg
  • Google Bookmarks
  • FriendFeed
  • Identi.ca
  • LinkedIn
  • NewsVine
  • Reddit
  • Technorati
  • email
  • Slashdot
  • Add to favorites
  • del.icio.us
  • RSS
  • StumbleUpon
  • Facebook
  • Google Buzz
  • Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>