Gentoo Archives: gentoo-user

From: Joost Roeleveld <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] LVM for data drives but not the OS
Date: Thu, 07 Apr 2011 14:35:19
Message-Id: 20110407143351.EBADA1391@data.antarean.org
In Reply to: Re: [gentoo-user] LVM for data drives but not the OS by Dale
1 On Thursday 07 April 2011 08:57:40 Dale wrote:
2 > Neil Bothwick wrote:
3 > > On Thu, 07 Apr 2011 15:21:33 +0200, Joost Roeleveld wrote:
4 > >> I think Dale will probably succeed in breaking it :)
5 > >>
6 > >> Dale, this comment isn't meant as an insult. I honestly think you
7 > >> would
8 > >> be perfect for some QA or Testing job :)
9 > >
10 > > But not on any project you wanted to finish on time ;-)
11 >
12 > Joost, I see your point. This is my life saying. If it wasn't for bad
13 > luck, I wouldn't have any luck at all. I hope for the best but expect
14 > the worst. You should see my dining room. Full of food stuff just in
15 > case. After my last visit to the grocery store, I'm thinking I may not
16 > have enough yet. o_O I also have a generator and some gas stored too.
17 > I also have a big garden to grow food as well. I may be disabled but I
18 > ain't stupid. I just try to keep the bad things that can happen in the
19 > back of my mind and keep a plan going, just in case it does hit the fan.
20
21 The Internet is a mixed blessing. We only see what people type. But have
22 difficulty understanding their personal situation because we don't see it.
23 Up untill the point you mentioned you're disabled, I was like "Hmm... I know a
24 few people like that :) "
25 I would call that self-sufficient and quite clever. I would like to be able to
26 move somewhere where I could just enjoy life and life of some piece of land.
27
28 I would not consider you stupid, you've shown, at least in my opinion, that
29 you're not :)
30
31 > I'm sort of wanting to use this as a learning experience. If I can get
32 > things set up, working and understand what the heck things do, then I
33 > may try some more stuff. Right now, my light bulb is pretty dim on
34 > LVM. I don't understand how it works and what the heck those commands
35 > do. I'll have my light bulb moment eventually. Since I don't have the
36 > new drive ordered yet, I got time to read, listen and try to grasp it all.
37
38 The beginning of wisdom is admitting you don't have it ;)
39
40 > Just a old dog trying to learn new tricks. lol
41
42 I'm lousy at training dogs (or other animals), but lets see if I can make LVM,
43 or at least the way I use it, a bit clearer.
44 If anything isn't clear, please ask.
45
46 We've already discussed the benefits of using it in a previous thread. So I'll
47 just skip those for now.
48
49 With LVM, you end up with 1 or more VGs (Volume Group)
50 Each VG consists of 1 or more PV (Physical Volume)
51 Each VG can contain 1 or more LV (Logical Volume)
52
53 In simple graphic:
54 PV <-> VG <-> LV
55
56 A PV is either an entire physical disk or a partition on a physical disk. This
57 is why they're called "Physical Volume"
58
59 A VG is a collection of Physical Volumes. The size of this depends equals the
60 total size of all the PVs in this group.
61
62 An LV is a partition on this Volume Group.
63
64 Now, here comes the nice part. It is possible to extend a VG and LV.
65 A VG is extended by adding a PV. It can also be reduced in size by removing a
66 PV.
67 NOTE: when removing a PV, ensure it is not used. (Tools exist for this)
68
69 An LV can be extended as long as the VG has room for this. No movement of LVs
70 is necessary, just like files on a filesystem, they get spread over available
71 space.
72 NOTE: Yes, this does lead to fragmentation (Tools exist to assist in
73 defragmenting LVM)
74 You can also reduce the size of an LV. (Again, make sure reducing the LV in
75 size does not lead to loss of data)
76
77 On top of an LV, any filesystem (Ext2/3/4, Reiserfs, XFS, JFS,....) can be
78 placed. Once an LV is created, the filesystem tools can simply access it just
79 like any other block device (eg. physical disk)
80
81 When selecting a filesystem to put on top of an LV, do check wether or not it
82 at least supports increasing the size after creation. Most filesystems in use
83 do support this even while the filesystem is mounted.
84 Reducing the size of the filesystem is, in my use, less common. And I tend to
85 simply copy data to a temporary location when I do need to reduce the size.
86
87 I hope the above makes it a bit clearer on how it "works".
88
89 The actual commands for creating and managing an LVM-system, I'll leave for
90 another time if and when they are needed.
91
92 --
93 Joost

Replies

Subject Author
Re: [gentoo-user] LVM for data drives but not the OS Dale <rdalek1967@×××××.com>