LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Lvm Configuration problem (https://www.linuxquestions.org/questions/linux-server-73/lvm-configuration-problem-4175411617/)

LittleMaster 06-15-2012 08:45 AM

Lvm Configuration problem
 
Hello,
First Post Starting the carrers with Lvm First.I just installed Centos 6.2 in VirtualBox.

For configuring i just followed the below link

http://www.linuxhelp.in/2010/04/logi...lvm-every.html

But i perform the same command it throws off error

Quote:

[root@example ~]# fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b6c32

Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 6271 50056192 83 Linux
/dev/sda3 6271 6528 2064384 82 Linux swap / Solaris
[root@example ~]# pvcreate /dev/sda1
Can't open /dev/sda1 exclusively. Mounted filesystem?
[root@example ~]# pvcreate /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?
[root@example ~]# pvcreate /dev/sda3
Can't open /dev/sda3 exclusively. Mounted filesystem?

MensaWater 06-15-2012 09:17 AM

The message is clearly suggesting it thinks your partitions are already in use.

What do you see when you run "df -h"? What do you see when you run "swapon -s"? What is in your /etc/fstab?

Also your partition TYPES are incorrect. Linux is for use as normal partition - You need to use fdisk to change the type to Linux LVM. Linux Swap is a special partition type used for swap devices and won't show up in df but may be in your /etc/fstab.

In essence your virtual machine (VM) appears to have been laid using standard partitioning on the assumption you'll use partitions for your devices rather than logical volumes (LVs).

LittleMaster 06-15-2012 09:35 AM

Whether i could could create Lvm in virtual box running linux.
whether its possibble to create lvm after booting of operating system .

I Took over a standlone machine with single sata hdd and booted of linux with 500HDD 2Gb RAM with following partitions

/boot-4Gb
swap -4 GB
remainig free spache i had allocated to /

Whether im doing wright configuration for installing Lvm

Can someone suggest me a Good link for configuration LVM for beginner .That could help me a lot in learning Lvm


[root@example ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Jun 6 03:51:30 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=ca1f834e-82f8-460c-87a8-911372359439 / ext4 defaults 1 1
UUID=e52a59fc-06c7-4fd5-8171-5c87e47d0924 /boot ext4 defaults 1 2
UUID=b25e2d30-c3d5-4b22-9fb9-9f619f578fe2 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/increase/swaps none swap sw 0 0
/mnt/swappp none swap sw 0 0
/mnt/swappiness none swap sw 0 0
[root@example ~]# swapon -s
Filename Type Size Used Priority
/dev/sda3 partition 2064376 0 -1
/increase/swaps file 1048568 0 -2
/mnt/swappp file 1048568 0 -3
/mnt/swappiness file 4194296 0 -4

MensaWater 06-15-2012 10:38 AM

swapon confirms you're using /dev/sda3 for swap so it can't be used for LVM unless you remove it as a swap device then change its type as previously mentioned.

Your other filesystems are in fstab using UUID rather than device. However you can find the UUID for your partitions by running:
blkid <device>
e.g.
blkid /dev/sda1

You will likely see that the UUIDs shown by blkid for the partitions matches what you have in /etc/fstab which would mean the devices are in fact used for filesystem.

Your issue isn't knowing how to do LVM but rather that you don't understand basic setups such as fdisk partitioning and filesystems creation. You need to go back to some basics. LVM lives on top of disks/partitions. To set it up you must have free disk space/partitions and what you've shown so far indicates that you don't.

Usually you setup the initial layout during the OS installation. When installing the OS on the VM you should see a choice for how to lay things out and it may default to partitioning but allow you to do LVM (or meta disks for software RAID). How that is done depends on lot on your distribution so I'd suggest you review the documentation for installing your distribution.

It isn't impossible to remove existing filesystems and redo setup for LVM but this gets a bit complicated so it would be simpler if you did the correct choices during installation.


All times are GMT -5. The time now is 03:51 PM.