XenServer: HDD Volume CeNTOS verhogen Afdrukken
Geschreven door Administrator   
maandag, 20 augustus 2012 11:55

Je harde schijf verhogen in CeNTOS met XenServer:

root:~# fdisk /dev/xvda
 
The number of cylinders for this disk is set to 6527.
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/xvda: 53.6 GB, 53687091200 bytes     <-- note that fdisk already sees the new device size of 53.6 GB
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004e475

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          31      248976   83  Linux
/dev/xvda2              32        1305    10233405   8e  Linux LVM     <-- note that the existing entry is still 10 GB

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 (32-6527, default 32):
Using default value 32
Last cylinder or +size or +sizeM or +sizeK (32-6527, default 6527):
Using default value 6527

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/xvda: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004e475

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          31      248976   83  Linux
/dev/xvda2              32        6527    52179120   8e  Linux LVM     <-- note that the new entry is now 50 GB

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.
master:~# reboot

Broadcast message from [email protected] (pts/0) (Fri Oct  2 08:47:05 2009):
 
 
The system is going down for reboot NOW!

 

 

Vertel LVM van de nieuwe gewijzgde fyische (physical) volume

 

Partitie 2 is nu succesvol verhoogd in volume. Nu LVM de nieuwe blokken vertellen.

 pvdisplay
 
  --- Physical volume ---
  PV Name               /dev/xvda2
  VG Name               dsk
  PV Size               9.76 GB / not usable 1.37 MB
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              2498
  Free PE               0
  Allocated PE          2498
  PV UUID               7TyUyk-hyVf-0kdC-OCok-QdSJ-lqTE-YFJAi0

master:~# pvresize /dev/xvda2
  Physical volume "/dev/xvda2" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

master:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/xvda2
  VG Name               dsk
  PV Size               49.76 GB / not usable 3.98 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              12738
  Free PE               10240
  Allocated PE          2498 
 
 
  PV UUID               7TyUyk-hyVf-0kdC-OCok-QdSJ-lqTE-YFJAi0

 

Wijzigen logische volume

De volgende stap voegt de nieuwe blokken toe aan het logische volume. De nieuwe volume groep heeft 10240 extra blokjes van  4 Kbyte. Nieuwe opslag kan toegvoegd worden met de lvresize command.

 

# vgdisplay
 
  --- Volume group ---
  VG Name               dsk
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               49.76 GB
  PE Size               4.00 MB
  Total PE              12738
  Alloc PE / Size       2498 / 9.76 GB
  Free  PE / Size       10240 / 40.00 GB
  VG UUID               nCjL0f-XWps-G77Z-Oq0t-lMEc-ULsJ-2qFUnw

master:~# lvdisplay
  --- Logical volume ---
  LV Name                /dev/dsk/root
  VG Name                dsk
  LV UUID                QejNO3-8bB0-ykJ0-TUhR-56Ko-W5ed-SvF9fv
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                7.76 GB
  Current LE             1986
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

master:~# lvresize -l +10240 /dev/dsk/root
  Extending logical volume root to 47.76 GB
  Logical volume root successfully resized

master:~# vgdisplay
  --- Volume group ---
  VG Name               dsk
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  11
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               49.76 GB
  PE Size               4.00 MB
  Total PE              12738
  Alloc PE / Size       12738 / 49.76 GB
  Free  PE / Size       0 / 0 
 
 
  VG UUID               nCjL0f-XWps-G77Z-Oq0t-lMEc-ULsJ-2qFUnw

 

 

Wijzig file system

De laatste stap is het bestandensysteem wijzigen. Daarna reboten.

root:~# resize2fs /dev/dsk/root
 
resize2fs 1.41.3 (12-Oct-2008)
Filesystem at /dev/dsk/root is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 3
Performing an on-line resize of /dev/dsk/root to 12519424 (4k) blocks.
The filesystem on /dev/dsk/root is now 12519424 blocks long.

master:~# reboot

Broadcast message from [email protected] (pts/0) (Fri Oct  2 08:47:05 2009):
 
 
The system is going down for reboot NOW!

 

 

 

 

Bron: http://www.schirmacher.de/display/INFO/How+to+increase+XenServer+virtual+machine+root+or+swap+partition

 

Andere guide: Hoe XenServer ISO op een USB Stick krijgen met FAT formattering: http://blogs.citrix.com/2010/01/17/install-xenserver-from-usb-drive/

Laatst aangepast op donderdag, 23 augustus 2012 16:25