LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-15-2012, 08:45 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121
Blog Entries: 1

Rep: Reputation: Disabled
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?

Last edited by LittleMaster; 06-15-2012 at 08:46 AM.
 
Old 06-15-2012, 09:17 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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).
 
Old 06-15-2012, 09:35 AM   #3
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 06-15-2012, 10:38 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 2 06-02-2017 04:50 PM
Problem with Multipath Configuration LVM. RHEL 5.3 iam33 Red Hat 1 03-24-2011 11:05 PM
LVM configuration in UBUNTU8.04.1 ajay.karn Linux - Server 4 08-18-2008 05:04 AM
LVM for non-Raid configuration smeissner Linux - Newbie 1 12-20-2007 03:03 PM
LVM configuration deweirdt Linux - Software 0 02-03-2004 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration