Lvmraid : Différence entre versions

De SME Server Wiki
(resize machine vmware)
Ligne 41 : Ligne 41 :
  
 
d'abord:
 
d'abord:
  C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -x 8GB "F:\Documents\M
+
  C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -x 8GB "F:\Documents\My Virtual Machines\VMWP-SME7\sme7pre1.vmdk"
y Virtual Machines\VMWP-SME7\sme7pre1.vmdk"
+
 
  C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -c -s 8GB -a ide -t 1
 
  C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -c -s 8GB -a ide -t 1
 
  "F:\Documents\My Virtual Machines\VMWP-SME7\sme7pre2.vmdk"
 
  "F:\Documents\My Virtual Machines\VMWP-SME7\sme7pre2.vmdk"

Version du 15 janvier 2008 à 19:16

grace a lvm et raid1 par defaut sur sme vous pouvez gerer facilement les disques, voir meme changer un disque ou deux et retoucher la taille des partitions.

voir http://forums.ixus.fr/viewtopic.php?t=38235&start=15 http://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size

resumé Upgrading the Hard Drive Size

   * CAUTION MAKE A FULL BACKUP!
   * Ensure you have e-smith-base-4.16.0-33 or newer installed. [or Update to at least 7.1.3] 
  1. Shut down and install larger drive in system.
  2. Boot up and manage raid to add new (larger) drive to system.
  3. Wait for raid to fully sync.
  4. Repeat steps 1-3 until all drives in system are upgraded to larger capacity.
  5. Ensure all drives have been replace with larger drives and array is in sync and redundant!
  6. Issue the following commands:
        1. mdadm --grow /dev/md2 --size=max
        2. pvresize /dev/md2
        3. lvresize -l +$(vgdisplay -c main | cut -d: -f16) main/root 
           ou   lvresize -l +$(vgdisplay -c vg_primary | cut -d: -f16) vg_primary/lv_root

[-l (lower case L)]

        4. ext2online -C0 /dev/main/root 
             ou ext2online -C0 /dev/mapper/vg_primary-lv_root

[is -C0 (zero)]

Notes :

   * All of this can be done while the server is up and running with the exception of #1.
   * These instructions should work for any raid level you have as long as you have >= 2 drives
   * If you have disabled lvm 
  1. you don't need the pvresize or lvresize command
  2. the final line becomes ext2online -C0 /dev/md2 (or whatever / is mounted to) 


resize machine vmware

d'abord:

C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -x 8GB "F:\Documents\My Virtual Machines\VMWP-SME7\sme7pre1.vmdk"
C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -c -s 8GB -a ide -t 1
"F:\Documents\My Virtual Machines\VMWP-SME7\sme7pre2.vmdk"

puis modifier le fichier de la machine pour ajouter le disque

ensuite meme chose que ajout de disque


  1. Freeing /dev/sda:
  2. First, removing all RAID1 partitions on /dev/sda:
mdadm /dev/md1 --fail /dev/sda3 --remove /dev/sda3
mdadm /dev/md0 --fail /dev/sda1 --remove /dev/sda1
  1. Then, stopping the swapspace on /dev/sda:

swapoff /dev/sda2

  1. Then, altering the partition tables:
fdisk /dev/sda
 #entering 'w' at the end to write. This should go OK now.
  1. Start using the partitions again:
swapon /dev/sda2
mdadm /dev/md0 --add /dev/sda1
mdadm /dev/md1 --add /dev/sda3
  1. wait for both md devices to be fully synced
  2. (check /proc/mdstat)
  1. same with /dev/sdb
mdadm /dev/md1 --fail /dev/sdb3 --remove /dev/sdb3
mdadm /dev/md0 --fail /dev/sdb1 --remove /dev/sdb1
fdisk /dev/sdb
mdadm /dev/md0 --add /dev/sdb1
  1. don't add /dev/sdb3 yet, to have a spare copy while resize2fs-ing
mdadm --grow /dev/md1 --size=max
resize2fs /dev/md1
  1. If the resize2fs-ing went OK, we can now add /dev/sdb3:
mdadm /dev/md1 --add /dev/sdb3


http://www.debian-administration.org/articles/424