Here is a short summary of LVM configuration and setup.
Check to make sure you have LVM2:
vgscan --version
If vgscan complains about missing driver:
modprobe dm_mod
Create physical volumes:
pvcreate /dev/sda1
pvcreate /dev/sda2
Add the physical volumes to a volume group:
vgcreate VolGroup01 /dev/sda1 /dev/sdb1
To create logical volumes out of the volume group:
lvcreate -L <length> -n LogVol01 VolGroup01
ex: lvcreate -L 500M VolGroup01 -n LogVol01
ex: lvcreate -L 20G VolGroup01 -n LogVol01
Create a filesystem
mkfs -t ext3 /dev/VolGroup01/LogVol01
Mount the logical volume
mount /dev/VolGroup01/LogVol01 /mnt/debian
Extending Logical Volume
Unmount the Logical Volume
umount /dev/VolGroup01/LogVol01
If there is free space in the volume group:
lvextend -L +1G /dev/VolGroup01/LogVol01
If the volume group is full then add a disk/partition to it:
vgextend VolGroup01 /dev/sdc1
and then extend the logical volume:
lvextend -L +1G /dev/VolGroup01/LogVol01
Finally, extend the filesystem (any of the below 3 methods)
extendfs -F ext3 /dev/VolGroup01/LogVol01
resize2fs /dev/VolGroup01/LogVol01
resize2fs /dev/VolGroup01/LogVol01 500M
Mount the logical volume
mount /dev/VolGroup01/LogVol01 /mnt/debian
Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts
Sunday, January 2, 2011
Saturday, January 1, 2011
Beginning the new year with Xen
Being the geek that I am, I enter the new year working late with Xen and trying to build an HD file image using the qemu command and watching some early Season 5 episodes of Dexter.
I am just going to document some of my starting out with Xen.
To list all running domains
xm list
To install a new domU from location (online or local)
virt-install --prompt
qemu -hda /dev/domU -cdrom linuxDistro.iso -boot d
Location of domU configuration file on dom0
/etc/xen/nameOfDomU
Start the domU image
xm create -c [nameOfDomU or ID]
Move from domU to dom0
Press: Ctrl-] (control, minus, right bracket)
Connect from dom0 to a running domU
xm console [nameofDomU or ID]
Reboot and Shutdown
xm reboot nameOfDomU
xm shutdown nameOfDomU
The Book of Xen does not have instructions on how to install Xen on a pre-installed system, so the best and most recent guide of installing Xen on CentOS is this one:
Install Xen on CentOS (for 32 bit systems)
Install Xen on CentOS (for 64 bit systems)
They are very similar.
I did create a new CentOS VM to be used as Xen hypervisor. Here are a couple of things I had forgotten:
CentOS time servers are busted, and base install of CentOS doesn't install ntpd.
Initial Configuration
Setting hostname on CentOS 5.5:
I am just going to document some of my starting out with Xen.
To list all running domains
xm list
To install a new domU from location (online or local)
virt-install --prompt
qemu -hda /dev/domU -cdrom linuxDistro.iso -boot d
Location of domU configuration file on dom0
/etc/xen/nameOfDomU
Start the domU image
xm create -c [nameOfDomU or ID]
Move from domU to dom0
Press: Ctrl-] (control, minus, right bracket)
Connect from dom0 to a running domU
xm console [nameofDomU or ID]
Reboot and Shutdown
xm reboot nameOfDomU
xm shutdown nameOfDomU
The Book of Xen does not have instructions on how to install Xen on a pre-installed system, so the best and most recent guide of installing Xen on CentOS is this one:
Install Xen on CentOS (for 32 bit systems)
Install Xen on CentOS (for 64 bit systems)
They are very similar.
I did create a new CentOS VM to be used as Xen hypervisor. Here are a couple of things I had forgotten:
CentOS time servers are busted, and base install of CentOS doesn't install ntpd.
Initial Configuration
- yum install ntp
- Edit /etc/ntp.conf (change the servers to ones that work)
- Edit /etc/sysconfig/ntpd (enable option to sync the hardware clock)
- ntpdate pool.ntp.org
- chkconfig ntpd on (add ntpd to run when system starts)
- service ntpd start
Setting hostname on CentOS 5.5:
- Edit /etc/sysconfig/network
- Edit /etc/hosts
Subscribe to:
Posts (Atom)