LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2016, 07:03 PM   #1
r00t15
LQ Newbie
 
Registered: Aug 2016
Posts: 3

Rep: Reputation: Disabled
Question LVM


Hello Guys,

I have some questions regarding LVM.

I am partitioning my disk and I am planning to use LVM.

I have created 3 partitions of 5GB each (this is just for testing):

/dev/sda1 5G LVM -> swap
/dev/sda2 5G LVM -> home
/dev/sda3 5G LVM -> root

Physical Volume (PV)

# pvcreate /dev/sda1 /dev/sda2 /dev/sda3

Volume Group (VG)

# vgcreate myVirtualGroup /dev/sda1 /dev/sda2 /dev/sda3

Logical Volume (LV)

# lvcreate -n swap -L 5G myVritualGroup
# lvcreate -n home -L 5G myVritualGroup
# lvcreate -n root -L 5G myVirtualGroup

Code:
||========================================================||
Logical Volumes (LV)     root (/) swap (swap) home (/home)
                         -------------------------------
Volume Group (VG)                myVritualGroup
                         -------------------------------
Physical Volumes (PV)    /dev/sda1  /dev/sda2  /dev/sda3
||========================================================||
My questions are:
  1. Should I create a Volume Group (VG) for each Physical Volume (PV)? or it's recommended to have all PVs in just one VG.
  2. Is it recommended to use LVM? I guess yes, right?

Any other recommendation will be highly appreciated!

Last edited by r00t15; 08-28-2016 at 07:14 PM.
 
Old 08-28-2016, 07:44 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
LVM principally offers flexibility - take advantage of it, and don't impose inflexibilities over the top of it. Do as you wish, but don't get into a one-to-one mapping mindset. Use what feels comfortable to your way of working.
LVM is a good option unless you have reasons not to use it.
 
Old 08-28-2016, 07:54 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Putting them all in one VG makes it easier to reshuffle space later if the need arises. It does mean, though, that you need to specify which PV to use when you create each of the LVs. If there were three separate VGs, that would of course be automatic.

Switching to or from multiple VGs can be done later, though not while the LVs are in use.
 
Old 08-28-2016, 07:56 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Indeed: any "distro" that you might use, if you choose to use LVM, will automatically set up a perfectly-acceptable partitioning arrangement and then map those to physical and then logical volumes.
 
  


Reply



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
LVM and RAID - will I get better throughput or recoverability vs linear lvm? jdelaporte Linux - Server 2 09-06-2015 09:28 AM
LVM and encrypted lvm - vgchange -ay needed everytime andrew44 Linux - Server 2 04-19-2014 08:47 PM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 12:59 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:30 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