Montag, 14. März 2011

vmware mehr als 256 GB bereitstellen (bei einer Blockgröße von 1MB)

wir hatten das Problem, dass wir auf einem NFS Server nur einzelne Platten mit einer maximalen Größe a 256 GB hinzufügen konnten. Somit mussten wir auf dem CentOS Server eine volumegroup definieren der aus mehreren Platten besteht. D.h. wir haben fünf 252 GB Platten zu einer großen Volumengroup.

Andere Lösung wäre gewesen die Blockgröße auf der Hostmaschine auf eine Blockgröße von 8 MB zu setzen somit hätten wir der VM bis zu 2TB zuweisen können.

Anzeigen welche Volumegroup sind momentan definiert:
[root@localhost]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
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 19.88 GB
PE Size 32.00 MB
Total PE 636
Alloc PE / Size 636 / 19.88 GB
Free PE / Size 0 / 0
VG UUID ft0v1w-AyMt-zTE1-1UJB-NCnc-2xQ0-57e6RC

Erstellen von Disks bzw. Partitionen für die Nutzung durch LVM;
[root@localhost]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created
[root@localhost]# pvcreate /dev/sdc
Physical volume "/dev/sdc" successfully created
[root@localhost]# pvcreate /dev/sdd
Physical volume "/dev/sdd" successfully created

Erstellen einer Volumegroup:
[root@localhost]# vgcreate nfsvg01 /dev/sdb /dev/sdc /dev/sdd
Volume group "nfsvg01" successfully created

Erstellen eines logical Volumes:
[root@localhost]# lvcreate -n nfslv01 -L 1200G nfsvg01
Logical volume "nfslv01" created

mit Filesystem formatieren:
[root@localhost]#
mkfs -t ext3 /dev/nfsvg01/nfslv01
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
157286400 inodes, 314572800 blocks
15728640 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
9600 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Danach konnte der Pfad der Datei in die /etc/exports hinzugefügt werden.

Zum Schluss muss noch der Mountpoint definiert werden:
[root@localhost]# mount -t ext3 /dev/nfsvg01/nfslv01 /mnt/nfsvg01/nfslv01/

pvcreate - initialize a disk or partition for use by LVM

SYNOPSIS

pvcreate [-d|--debug] [-f[f]|--force [--force]] [-y|--yes] [-h|--help] [-v|--verbose] [-V|--version]
PhysicalVolume...]


DESCRIPTION

pvcreate initializes for later use by the Logical Volume Manager (LVM). Each can be a disk partition, whole disk, meta device, or loopback file. For DOS disk partitions, the partition id must be set to 0x8e using fdisk(8), cfdisk(8), or a equivalent. For whole disk devices only the partition table must be erased, which will effectively destroy all data on that disk. This can be done by zeroing the first sector with:

dd if=/dev/zero of= bs=512 count=1

Continue with vgcreate(8) to create a new volume group on, or vgextend(8) to add to an existing volume group.

OPTIONS

-d, --debug
Enables additional debugging output (if compiled with DEBUG).
-f, --force
Force the creation without any confirmation. You can not recreate (reinitialize) a physical volume belonging to an existing volume group. In an emergency you can override this behaviour with -ff. In no case case can you initialize an active physical volume with this command.
-s, --size
Overrides the size of the physical volume which is normally retrieved. Useful in rare case where this value is wrong. More useful to fake large physical volumes of up to 2 Terabyes - 1 Kilobyte on smaller devices for testing purposes only where no real access to data in created logical volumes is needed. If you wish to create the supported maximum, use "pvcreate -s 2147483647k PhysicalVolume [PhysicalVolume ...]". All other LVM tools will use this size with the exception of lvmdiskscan(8)
-y, --yes
Answer yes to all questions.
-h, --help
Print a usage message on standard output and exit successfully.
-v, --verbose
Gives verbose runtime information about pvcreate's activities.
-V, --version
Print the version number on standard output and exit successfully.

Example

Initialize partition #4 on the third SCSI disk and the entire fifth SCSI disk for later use by LVM:

pvcreate /dev/sdc4 /dev/sde

Keine Kommentare: