Direkt zum Inhalt | Direkt zur Navigation

Benutzerspezifische Werkzeuge

This is SunRain Plone Theme

Sektionen

Sie sind hier: Startseite / Unix / Linux / Linux online LVM Partition unter VMWare vergrössern

Linux online LVM Partition unter VMWare vergrössern

LVM online unter VMWare vergrössern

Vvergrössern der Festplatte auf welcher das LVM PV (Physical Device) liegt,

In VMware wird die größe der virtuellen Platte erweitert

Festplatte in Linux neu einlesen

Die Festplatte wird neu eingelesen. Dafür wird der Pfad der Disk ermittelt.

ls -la /dev/disk/by-path |grep sdc

lrwxrwxrwx 1 root root   9 Oct 11 06:58 pci-0000:00:10.0-scsi-0:0:2:0 -> ../../sdc
lrwxrwxrwx 1 root root  10 Oct 11 06:58 pci-0000:00:10.0-scsi-0:0:2:0-part1 -> ../../sdc1

Mit diesen DevicePath können wir die Platte neu einlessen

echo "1" > /sys/class/scsi_disk/0\:0\:2\:0/device/rescan

<H> <B> <T> <L>

  • <H> : Host
  • <B> : Bus (Channel)
  • <T> : Target (Id)
  • <L> : LUN numbers

Die Meldung mit "dmesg"

[478399.861148] sd 0:0:1:0: [sdc] 6291456 512-byte logical blocks: (3.22 GB/3.00 GiB)
[478399.861273] sd 0:0:1:0: [sdc] Cache data unavailable
[478399.861277] sd 0:0:1:0: [sdc] Assuming drive cache: write through
[478399.861390] sdb: detected capacity change from 1073741824 to 3221225472

Überblick gewinnen, wo was ist.

pvdisplay

   --- Physical volume ---
  PV Name               /dev/sdc1
  VG Name               var01
  PV Size               3.00 GiB / not usable 3.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              767
  Free PE               42
  Allocated PE          725
  PV UUID               HbT1Dm-lOee-9XPp-UB73-3tfy-iR4Q-4J2WhU

  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               var02
  PV Size               1022.00 MiB / not usable 2.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              255
  Free PE               105
  Allocated PE          150
  PV UUID               uoVs3U-7qCy-1woY-CciW-u0YW-k8Ul-kTA83S
 

Alle Festplatte in Linux am SCSI-Bus neu einlesen

for i in `ls /sys/class/scsi_host/|sed -e s/"[A-Za-z]"//g`;do echo "- - -" > /sys/class/scsi_host/host${i}/scan;done

[339199.530888] scsi 0:0:3:0: Direct-Access     VMware   Virtual disk     1.0  PQ: 0 ANSI: 2
[339199.530904] scsi target0:0:3: Beginning Domain Validation
[339199.532261] scsi target0:0:3: Domain Validation skipping write tests
[339199.532264] scsi target0:0:3: Ending Domain Validation
[339199.532358] scsi target0:0:3: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127)
[339199.534554] sd 0:0:3:0: [sde] 4194304 512-byte logical blocks: (2.14 GB/2.00 GiB)
[339199.534618] sd 0:0:3:0: [sde] Write Protect is off
[339199.534622] sd 0:0:3:0: [sde] Mode Sense: 61 00 00 00
[339199.534693] sd 0:0:3:0: [sde] Cache data unavailable
[339199.534696] sd 0:0:3:0: [sde] Assuming drive cache: write through
[339199.535977] sd 0:0:3:0: [sde] Cache data unavailable
[339199.535980] sd 0:0:3:0: [sde] Assuming drive cache: write through
[339199.536307] sd 0:0:3:0: Attached scsi generic sg6 type 0
[339199.560913]  sde: unknown partition table
[339199.561078] sd 0:0:3:0: [sde] Cache data unavailable
[339199.561080] sd 0:0:3:0: [sde] Assuming drive cache: write through
[339199.561125] sd 0:0:3:0: [sde] Attached SCSI disk

Vergrössern des LVM Devices

Mit pvresize wird das Physical Device vergrössert.

pvresize /dev/sdc1

   Physical volume "/dev/sdc1" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

Überprüfung mit pvdisplay

pvdisplay /dev/sdc1

  --- Physical volume ---
  PV Name               /dev/sdc1
  VG Name               var01
  PV Size               1022.00 MiB / not usable 2.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              255
  Free PE               105
  Allocated PE          150
  PV UUID               uoVs3U-7qCy-1woY-CciW-u0YW-k8Ul-kTA83S

Vergrösserung von Logical Volume (LV)

lvextend -l+100%FREE /dev/var01/postgresql
lvextend -L +1000M /dev/var01/postgresql

 Extending logical volume postgresql to 1.14 GiB
 Logical volume postgresql successfully resized

Online Vergrösserung von dem  Dateisystem

resize2fs /dev/var01/postgresql
xfs_growfs /var/archive

Filesystem at /dev/var01/postgresql is mounted on /var/lib/postgresql; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/var01/postgresql to 299008 (4k) blocks.
The filesystem on /dev/var01/postgresql is now 299008 blocks long.

 Anhang

Neue Platte in der VG hinzufügen

pvcreate /dev/hdb7 
vgextend volg1 /dev/hdb7

 

GPT partition

parted

(parted) unit UNIT
(parted) print
(parted) mkpart

Model: Dell Virtual Disk (scsi)
Disk /dev/sda: 976224256kiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start      End          Size         File system  Name  Flags
 1      1024kiB    976896kiB    975872kiB    ext4
 2      976896kiB  15625216kiB  14648320kiB                     lvm

(parted) mkpart                                                           
Partition name?  []? lvm                                                  
File system type?  [ext2]? ext4                                           
Start? 15625216                                                           
End? 976224256                                                            
Warning: You requested a partition from 15625216kiB to 976224256kiB.      
The closest location we can manage is 15625216kiB to 976224239kiB.
Is this still acceptable to you?
Yes/No? Yes                      

 

Artikelaktionen

Kommentieren

Sie können einen Kommentar abgeben, indem Sie das untenstehende Formular ausfüllen. Nur Text. Web- und E-Mailadressen werden in anklickbare Links umgewandelt. Kommentare werden moderiert.

Enter the word