Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] LVM for data drives but not the OS Alan McKinnon <alan.mckinnon@×××××.com>