IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

RedHat / CentOS / Fedora Discussion :

Extension LVM dans environnement SAN


Sujet :

RedHat / CentOS / Fedora

  1. #1
    Membre actif
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Mars 2005
    Messages
    363
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Mars 2005
    Messages : 363
    Points : 210
    Points
    210
    Par défaut Extension LVM dans environnement SAN
    Bonjour,

    je tente d'agrandir un filesystem sur RHEL4 suite à une extension d'une de mes LUN. Je connais bien les commandes LVM (enfin je pense !) pour retaille mon PV et mon FS. Cependant, un pvresize ne change rien car la machine ne doit pas réussir à comprendre que le disque a changé de taille. En effet, j'ai tenté ce qui est indiqué dans cette doc mais j'utilise Powerpath (impératif) et non multipath. J'ai essayé d'adapter à mon système mais sans succès. Vais-je être obligé de créer une seconde partition primaire que je rattacherai à mon VG ou mon PV est-il en mesure de reconnaitre la nouvelle taille de la LUN svp ?

  2. #2
    Membre actif
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Mars 2005
    Messages
    363
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Mars 2005
    Messages : 363
    Points : 210
    Points
    210
    Par défaut
    La commande blockdev m'a permis de mettre une info intéressante à jour :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    [root@XXX bin]# blockdev --getsize /dev/emcpowerl1
    10477194
    [root@XXX bin]# blockdev --getsize /dev/emcpowerl
    12582912
    On remarque que la nouvelle taille disque a bien été prise en compte au niveau partition physique. En revanche, je suis obligé du coup de créer avec fdisk une seconde partition primaire, /dev/emcpowerl2, ou puis-je étendre ma première partition /dev/emcpowerl1 ?

  3. #3
    Membre actif
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Mars 2005
    Messages
    363
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Mars 2005
    Messages : 363
    Points : 210
    Points
    210
    Par défaut
    Je me suis débrouillé tout seul comme un grand (nan j'déconne, j'ai réussi à trouver de l'aide sur un autre forum).

    Solution :
    Si vous utilisez Powerpath, il faut absolument effectuer la commande :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    echo "1" > /sys/class/scsi_device/3\:0\:0\:0/device/rescan
    echo "1" > /sys/class/scsi_device/4\:0\:0\:0/device/rescan
    en adaptant au device qui va bien.

    Ensuite, il vous suffit de suivre à la lettre ce qui est indiqué à l'adresse

    Je remets dans le code, ce qu'il contient au cas où la page serait supprimée :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    # First unmount everything that uses the given volume group
    # List all the logical volumes that are in vol01
    $ lvdisplay /dev/vol01
      --- Logical volume ---
      LV Name                /dev/vol01/lv01
      VG Name                vol01
      LV UUID                q3eQP3-4V9E-7yvo-LUZR-zbXz-F2Mh-Pn5fDt
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                139.70 GB
      Current LE             35762
      Segments               2
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           254:0
     
      --- Logical volume ---
      LV Name                /dev/vol01/lv02
      VG Name                vol01
      LV UUID                b53h7W-VO2U-3Ok5-WvW3-GbDp-Tbvb-6bbdkw
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                29.31 GB
      Current LE             7504
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           254:1
     
    # Now unmount all these volumes (if they are mounted)
    $ umount /dev/vol01/lv01
    $ umount /dev/vol01/lv02
    # In case you get a "device is busy" error, check out what processes use them (lsof /dev/vol01/lv01) and stop/kill them.
    # Now deactive the volume group.
    $ vgchange -a n vol01
    # Increase the size of the sda2 partition to the desired value.
    # You do this by deleting the partition and recreating it with a higher end cylinder.
    # I assume that pvresize can handle partition expansions only if the partition start remains the same and the partition end cylinder is moved to a higher value.
    $ fdisk /dev/sda
     
    The number of cylinders for this disk is set to 60801.
    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): p
     
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000e4bad
     
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         486     3903763+  83  Linux
    /dev/sda2             487       18722   146480670   8e  Linux LVM
     
    Command (m for help): d
    Partition number (1-4): 2
     
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 2
    First cylinder (487-60801, default 487):
    Using default value 487
    Last cylinder or +size or +sizeM or +sizeK (487-60801, default 60801):
    Using default value 60801
     
    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): p
     
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000e4bad
     
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         486     3903763+  83  Linux
    /dev/sda2             487       60801   484480237+  8e  Linux LVM
     
    Command (m for help): w
    The partition table has been altered!
     
    Calling ioctl() to re-read partition table.
     
    WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
    The kernel still uses the old table.
    The new table will be used at the next reboot.
    Syncing disks.
     
    # Now comes the interesting part: we force the system with partprobe to re-read the partition table.
    $ pvdisplay /dev/sda2
      --- Physical volume ---
      PV Name               /dev/sda2
      VG Name               vol01
      PV Size               139.69 GB / not usable 3.53 MB
      Allocatable           yes (but full)
      PE Size (KByte)       4096
      Total PE              35761
      Free PE               0
      Allocated PE          35761
      PV UUID               S0cDcl-7mr8-2AAb-172u-HClq-J2aQ-DfC2V5
    $ partprobe
    $ pvresize /dev/sda2
    $ pvdisplay /dev/sda2
      --- Physical volume ---
      PV Name               /dev/sda2
      VG Name               vol01
      PV Size               462.04 GB / not usable 1.04 MB
      Allocatable           yes
      PE Size (KByte)       4096
      Total PE              118281
      Free PE               82520
      Allocated PE          35761
      PV UUID               S0cDcl-7mr8-2AAb-172u-HClq-J2aQ-DfC2V5
    # Voala! :-) The physical volume got increased.
    # Time to reactivate the volume group.
    $ vgchange -a y vol01
    # Now check the volume group details.
    $ vgdisplay vol01
      --- Volume group ---
      VG Name               vol01
      System ID             
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  18
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                3
      Open LV               3
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               927.79 GB
      PE Size               4.00 MB
      Total PE              237515
      Alloc PE / Size       68866 / 269.01 GB
      Free  PE / Size       168649 / 658.79 GB
      VG UUID               0eY2tg-AOny-XsDL-wfLR-d290-2jxO-TDTNnQ
    # You can now use lvextend to increase logical volumes in the volume group.
    $ lvextend -L +10G --name lv01 /dev/vol01
    # And resize2fs to extend the Ext2/3 filesystem on the logical volume.
    $ resize2fs /dev/vol01/lv01
    # And finally mount the filesystems.
    $ mount /dev/vol01/lv01
    $ mount /dev/vol01/lv02
    # You're now ready.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. AWT dans un environnement sans interface graphique
    Par peyo_le_fou dans le forum AWT/Swing
    Réponses: 5
    Dernier message: 28/10/2008, 15h06
  2. Réponses: 2
    Dernier message: 29/08/2005, 16h35
  3. Script Java appelé dans Xsl sans résultats
    Par metallic dans le forum XSL/XSLT/XPATH
    Réponses: 7
    Dernier message: 03/08/2005, 15h39
  4. ouverture de fichiers word dans delphi (sans utiliser word)
    Par poussinphp dans le forum API, COM et SDKs
    Réponses: 2
    Dernier message: 11/07/2005, 14h25

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo